More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 51,798 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 134875665 | 15 hrs ago | IN | 0 ETH | 0.000004327209 | ||||
Claim | 134875523 | 15 hrs ago | IN | 0 ETH | 0.000003894131 | ||||
Claim | 134861271 | 23 hrs ago | IN | 0 ETH | 0.000000421616 | ||||
Claim | 134842121 | 33 hrs ago | IN | 0 ETH | 0.00000042479 | ||||
Claim | 134834799 | 37 hrs ago | IN | 0 ETH | 0.00000032678 | ||||
Claim | 134815316 | 2 days ago | IN | 0 ETH | 0.000000421051 | ||||
Claim | 134794921 | 2 days ago | IN | 0 ETH | 0.000000058526 | ||||
Claim | 134794921 | 2 days ago | IN | 0 ETH | 0.000000058552 | ||||
Claim | 134794921 | 2 days ago | IN | 0 ETH | 0.000000058552 | ||||
Claim | 134794921 | 2 days ago | IN | 0 ETH | 0.000000058552 | ||||
Claim | 134791701 | 2 days ago | IN | 0 ETH | 0.000000151235 | ||||
Claim | 134765767 | 3 days ago | IN | 0 ETH | 0.000000094899 | ||||
Claim | 134762210 | 3 days ago | IN | 0 ETH | 0.00000006865 | ||||
Claim | 134756554 | 3 days ago | IN | 0 ETH | 0.000000183704 | ||||
Claim | 134744295 | 3 days ago | IN | 0 ETH | 0.000000198862 | ||||
Claim | 134744266 | 3 days ago | IN | 0 ETH | 0.000000310213 | ||||
Claim | 134735733 | 3 days ago | IN | 0 ETH | 0.000000396731 | ||||
Claim | 134735581 | 3 days ago | IN | 0 ETH | 0.000000292695 | ||||
Claim | 134701404 | 4 days ago | IN | 0 ETH | 0.00000237875 | ||||
Claim | 134695729 | 4 days ago | IN | 0 ETH | 0.000020087278 | ||||
Claim | 134687543 | 4 days ago | IN | 0 ETH | 0.000008691345 | ||||
Claim | 134685023 | 5 days ago | IN | 0 ETH | 0.000015269019 | ||||
Claim | 134675528 | 5 days ago | IN | 0 ETH | 0.000004029117 | ||||
Claim | 134675432 | 5 days ago | IN | 0 ETH | 0.000003419389 | ||||
Claim | 134664546 | 5 days ago | IN | 0 ETH | 0.000001519098 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xFb4D5A94...aAF7D4dB7 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
MerkleDistributor
Compiler Version
v0.8.12+commit.f00d7308
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.8.12; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; import "./interfaces/IMerkleDistributor.sol"; contract MerkleDistributor is IMerkleDistributor { address public immutable override token; bytes32 public immutable override merkleRoot; uint256 public constant ONE_YEAR_IN_SECONDS = 31_536_000; uint256 public immutable activationTimestamp; address public immutable airdropTreasury; bool public isActive; // This is a packed array of booleans. mapping(uint256 => uint256) private claimedBitMap; event Finalised( address indexed calledBy, uint256 timestamp, uint256 unclaimedAmount ); constructor( address token_, bytes32 merkleRoot_, address _treasury ) { token = token_; merkleRoot = merkleRoot_; activationTimestamp = block.timestamp; isActive = true; airdropTreasury = _treasury; } function isClaimed(uint256 index) public view override returns (bool) { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; uint256 claimedWord = claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function _setClaimed(uint256 index) private { uint256 claimedWordIndex = index / 256; uint256 claimedBitIndex = index % 256; claimedBitMap[claimedWordIndex] = claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external override { require(!isClaimed(index), "MerkleDistributor: Drop already claimed."); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(index, account, amount)); require( MerkleProof.verify(merkleProof, merkleRoot, node), "MerkleDistributor: Invalid proof." ); // Mark it claimed and send the token. _setClaimed(index); require( IERC20(token).transfer(account, amount), "MerkleDistributor: Transfer failed." ); emit Claimed(index, account, amount); } /** * @dev Finalises the airdrop and sweeps unclaimed tokens into the Optimism multisig */ function clawBack() external { // Airdrop can only be finalised once require(isActive, "Airdrop: Already finalised"); // Airdrop will remain open for one year require( block.timestamp >= activationTimestamp + ONE_YEAR_IN_SECONDS, "Airdrop: Drop should remain open for one year" ); // Deactivate airdrop isActive = false; // Sweep unclaimed tokens uint256 amount = IERC20(token).balanceOf(address(this)); require( IERC20(token).transfer(airdropTreasury, amount), "Airdrop: Finalise transfer failed" ); emit Finalised(msg.sender, block.timestamp, amount); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/MerkleProof.sol) pragma solidity ^0.8.0; /** * @dev These functions deal with verification of Merkle Trees proofs. * * The proofs can be generated using the JavaScript library * https://github.com/miguelmota/merkletreejs[merkletreejs]. * Note: the hashing algorithm should be keccak256 and pair sorting should be enabled. * * See `test/utils/cryptography/MerkleProof.test.js` for some examples. */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) internal pure returns (bool) { return processProof(proof, leaf) == root; } /** * @dev Returns the rebuilt hash obtained by traversing a Merklee tree up * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. * * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = _efficientHash(computedHash, proofElement); } else { // Hash(current element of the proof + current computed hash) computedHash = _efficientHash(proofElement, computedHash); } } return computedHash; } function _efficientHash(bytes32 a, bytes32 b) private pure returns (bytes32 value) { assembly { mstore(0x00, a) mstore(0x20, b) value := keccak256(0x00, 0x40) } } }
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.8.12; // Allows anyone to claim a token if they exist in a merkle root. interface IMerkleDistributor { // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external; // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); }
{ "optimizer": { "enabled": false, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"address","name":"_treasury","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":false,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Claimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"calledBy","type":"address"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"unclaimedAmount","type":"uint256"}],"name":"Finalised","type":"event"},{"inputs":[],"name":"ONE_YEAR_IN_SECONDS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"activationTimestamp","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"airdropTreasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"clawBack","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isActive","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isClaimed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100935760003560e01c806357888c291161006657806357888c291461010e5780639e34070f14610118578063b114c09814610148578063e7c8fed414610166578063fc0c546a1461018457610093565b80630423c7de1461009857806322f3e2d4146100b65780632e7ba6ef146100d45780632eb4a7ab146100f0575b600080fd5b6100a06101a2565b6040516100ad91906108ca565b60405180910390f35b6100be6101c6565b6040516100cb9190610900565b60405180910390f35b6100ee60048036038101906100e99190610a14565b6101d7565b005b6100f8610423565b6040516101059190610ab5565b60405180910390f35b610116610447565b005b610132600480360381019061012d9190610ad0565b61070e565b60405161013f9190610900565b60405180910390f35b610150610764565b60405161015d9190610b0c565b60405180910390f35b61016e610788565b60405161017b91906108ca565b60405180910390f35b61018c610790565b6040516101999190610b0c565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000670606bb81565b60008054906101000a900460ff1681565b6101e08561070e565b15610220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161021790610baa565b60405180910390fd5b600085858560405160200161023793929190610c33565b6040516020818303038152906040528051906020012090506102bb838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507fbf21d3ef0aacb51d1c85ae8da5a282e14050984b1eef3382b0b47e6287b44ab5836107b4565b6102fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102f190610ce2565b60405180910390fd5b610303866107cb565b7f000000000000000000000000420000000000000000000000000000000000004273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b815260040161035e929190610d02565b6020604051808303816000875af115801561037d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103a19190610d57565b6103e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103d790610df6565b60405180910390fd5b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed02686868660405161041393929190610e16565b60405180910390a1505050505050565b7fbf21d3ef0aacb51d1c85ae8da5a282e14050984b1eef3382b0b47e6287b44ab581565b60008054906101000a900460ff16610494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048b90610e99565b60405180910390fd5b6301e133807f00000000000000000000000000000000000000000000000000000000670606bb6104c49190610ee8565b421015610506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fd90610fb0565b60405180910390fd5b60008060006101000a81548160ff02191690831515021790555060007f000000000000000000000000420000000000000000000000000000000000004273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161057b9190610b0c565b602060405180830381865afa158015610598573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105bc9190610fe5565b90507f000000000000000000000000420000000000000000000000000000000000004273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb7f00000000000000000000000030f8c9274be0e35b5452f929a769869d4186ebe5836040518363ffffffff1660e01b8152600401610639929190610d02565b6020604051808303816000875af1158015610658573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067c9190610d57565b6106bb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b290611084565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f128cc738ca9206ffb8400614f512cfe0011fe176b354930f336d65a219a5174342836040516107039291906110a4565b60405180910390a250565b6000806101008361071f91906110fc565b9050600061010084610731919061112d565b90506000600160008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b7f00000000000000000000000030f8c9274be0e35b5452f929a769869d4186ebe581565b6301e1338081565b7f000000000000000000000000420000000000000000000000000000000000004281565b6000826107c18584610825565b1490509392505050565b6000610100826107db91906110fc565b90506000610100836107ed919061112d565b9050806001901b6001600084815260200190815260200160002054176001600084815260200190815260200160002081905550505050565b60008082905060005b845181101561088f57600085828151811061084c5761084b61115e565b5b6020026020010151905080831161086e57610867838261089a565b925061087b565b610878818461089a565b92505b5080806108879061118d565b91505061082e565b508091505092915050565b600082600052816020526040600020905092915050565b6000819050919050565b6108c4816108b1565b82525050565b60006020820190506108df60008301846108bb565b92915050565b60008115159050919050565b6108fa816108e5565b82525050565b600060208201905061091560008301846108f1565b92915050565b600080fd5b600080fd5b61092e816108b1565b811461093957600080fd5b50565b60008135905061094b81610925565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061097c82610951565b9050919050565b61098c81610971565b811461099757600080fd5b50565b6000813590506109a981610983565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126109d4576109d36109af565b5b8235905067ffffffffffffffff8111156109f1576109f06109b4565b5b602083019150836020820283011115610a0d57610a0c6109b9565b5b9250929050565b600080600080600060808688031215610a3057610a2f61091b565b5b6000610a3e8882890161093c565b9550506020610a4f8882890161099a565b9450506040610a608882890161093c565b935050606086013567ffffffffffffffff811115610a8157610a80610920565b5b610a8d888289016109be565b92509250509295509295909350565b6000819050919050565b610aaf81610a9c565b82525050565b6000602082019050610aca6000830184610aa6565b92915050565b600060208284031215610ae657610ae561091b565b5b6000610af48482850161093c565b91505092915050565b610b0681610971565b82525050565b6000602082019050610b216000830184610afd565b92915050565b600082825260208201905092915050565b7f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060008201527f636c61696d65642e000000000000000000000000000000000000000000000000602082015250565b6000610b94602883610b27565b9150610b9f82610b38565b604082019050919050565b60006020820190508181036000830152610bc381610b87565b9050919050565b6000819050919050565b610be5610be0826108b1565b610bca565b82525050565b60008160601b9050919050565b6000610c0382610beb565b9050919050565b6000610c1582610bf8565b9050919050565b610c2d610c2882610971565b610c0a565b82525050565b6000610c3f8286610bd4565b602082019150610c4f8285610c1c565b601482019150610c5f8284610bd4565b602082019150819050949350505050565b7f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f6660008201527f2e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000610ccc602183610b27565b9150610cd782610c70565b604082019050919050565b60006020820190508181036000830152610cfb81610cbf565b9050919050565b6000604082019050610d176000830185610afd565b610d2460208301846108bb565b9392505050565b610d34816108e5565b8114610d3f57600080fd5b50565b600081519050610d5181610d2b565b92915050565b600060208284031215610d6d57610d6c61091b565b5b6000610d7b84828501610d42565b91505092915050565b7f4d65726b6c654469737472696275746f723a205472616e73666572206661696c60008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b6000610de0602383610b27565b9150610deb82610d84565b604082019050919050565b60006020820190508181036000830152610e0f81610dd3565b9050919050565b6000606082019050610e2b60008301866108bb565b610e386020830185610afd565b610e4560408301846108bb565b949350505050565b7f41697264726f703a20416c72656164792066696e616c69736564000000000000600082015250565b6000610e83601a83610b27565b9150610e8e82610e4d565b602082019050919050565b60006020820190508181036000830152610eb281610e76565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ef3826108b1565b9150610efe836108b1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610f3357610f32610eb9565b5b828201905092915050565b7f41697264726f703a2044726f702073686f756c642072656d61696e206f70656e60008201527f20666f72206f6e65207965617200000000000000000000000000000000000000602082015250565b6000610f9a602d83610b27565b9150610fa582610f3e565b604082019050919050565b60006020820190508181036000830152610fc981610f8d565b9050919050565b600081519050610fdf81610925565b92915050565b600060208284031215610ffb57610ffa61091b565b5b600061100984828501610fd0565b91505092915050565b7f41697264726f703a2046696e616c697365207472616e73666572206661696c6560008201527f6400000000000000000000000000000000000000000000000000000000000000602082015250565b600061106e602183610b27565b915061107982611012565b604082019050919050565b6000602082019050818103600083015261109d81611061565b9050919050565b60006040820190506110b960008301856108bb565b6110c660208301846108bb565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611107826108b1565b9150611112836108b1565b925082611122576111216110cd565b5b828204905092915050565b6000611138826108b1565b9150611143836108b1565b925082611153576111526110cd565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000611198826108b1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156111cb576111ca610eb9565b5b60018201905091905056fea26469706673582212207aeaf571be1c192c451802c4ce0e69a1c89fb4a71d884a3b8fec5e3bea39698464736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
OP | 100.00% | $0.75136 | 817,559.548 | $614,281.54 |
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.