More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,973 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 13295065 | 1107 days ago | IN | 0 ETH | 0.00200153 | ||||
Claim | 12974667 | 1157 days ago | IN | 0 ETH | 0.00399494 | ||||
Claim | 12846770 | 1177 days ago | IN | 0 ETH | 0.00145391 | ||||
Claim | 12755909 | 1191 days ago | IN | 0 ETH | 0.00088848 | ||||
Claim | 12734655 | 1194 days ago | IN | 0 ETH | 0.00137348 | ||||
Claim | 12716087 | 1197 days ago | IN | 0 ETH | 0.00080725 | ||||
Claim | 12624768 | 1212 days ago | IN | 0 ETH | 0.00105069 | ||||
Claim | 12618886 | 1212 days ago | IN | 0 ETH | 0.00071087 | ||||
Claim | 12617841 | 1213 days ago | IN | 0 ETH | 0.00105059 | ||||
Claim | 12615026 | 1213 days ago | IN | 0 ETH | 0.00193773 | ||||
Claim | 12604401 | 1215 days ago | IN | 0 ETH | 0.00097718 | ||||
Claim | 12541876 | 1224 days ago | IN | 0 ETH | 0.00118648 | ||||
Claim | 12527846 | 1227 days ago | IN | 0 ETH | 0.00169614 | ||||
Claim | 12514776 | 1229 days ago | IN | 0 ETH | 0.00191094 | ||||
Claim | 12495219 | 1232 days ago | IN | 0 ETH | 0.00306937 | ||||
Claim | 12443709 | 1240 days ago | IN | 0 ETH | 0.00387614 | ||||
Claim | 12390393 | 1248 days ago | IN | 0 ETH | 0.00129236 | ||||
Claim | 12390391 | 1248 days ago | IN | 0 ETH | 0.00331382 | ||||
Claim | 12351990 | 1254 days ago | IN | 0 ETH | 0.00201987 | ||||
Claim | 12340408 | 1256 days ago | IN | 0 ETH | 0.00250458 | ||||
Claim | 12321438 | 1258 days ago | IN | 0 ETH | 0.00266689 | ||||
Claim | 12318882 | 1259 days ago | IN | 0 ETH | 0.00331382 | ||||
Claim | 12317961 | 1259 days ago | IN | 0 ETH | 0.00331251 | ||||
Claim | 12315945 | 1259 days ago | IN | 0 ETH | 0.0030072 | ||||
Claim | 12309747 | 1260 days ago | IN | 0 ETH | 0.00323979 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
MerkleDistributor
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-01-19 */ // SPDX-License-Identifier: MIT pragma solidity 0.6.12; /** * @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 `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, 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 ); } /** * @dev These functions deal with verification of Merkle trees (hash trees), */ 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) { 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 = keccak256( abi.encodePacked(computedHash, proofElement) ); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256( abi.encodePacked(proofElement, computedHash) ); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } // 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); } contract MerkleDistributor is IMerkleDistributor { address public immutable override token; bytes32 public immutable override merkleRoot; // This is a packed array of booleans. mapping(uint256 => uint256) private claimedBitMap; address public governance; constructor(address token_, bytes32 merkleRoot_) public { token = token_; merkleRoot = merkleRoot_; governance = msg.sender; } 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); } /** * This function allows governance to take unsupported tokens out of the contract. This is in an effort to make someone whole, should they seriously mess up. * There is no guarantee governance will vote to return these. It also allows for removal of airdropped tokens. */ function governanceRecoverUnsupported( IERC20 _token, uint256 _amount, address _to ) external { require(msg.sender == governance, "!governance"); _token.transfer(_to, _amount); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"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"},{"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":"governance","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"},{"internalType":"address","name":"_to","type":"address"}],"name":"governanceRecoverUnsupported","outputs":[],"stateMutability":"nonpayable","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"}]
Contract Creation Code
60c060405234801561001057600080fd5b506040516108753803806108758339818101604052604081101561003357600080fd5b5080516020909101516001600160601b0319606083901b1660805260a0819052600180546001600160a01b031916331790556001600160a01b03909116906107dd610098600039806102c152806104bb52508061034c528061064952506107dd6000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c80635aa6e675116100505780635aa6e6751461016f5780639e34070f146101a0578063fc0c546a146101d157610072565b80632e7ba6ef146100775780632eb4a7ab1461011257806354575af41461012c575b600080fd5b6101106004803603608081101561008d57600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff60208201351691604082013591908101906080810160608201356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184602083028401116401000000008311171561010557600080fd5b5090925090506101d9565b005b61011a6104b9565b60408051918252519081900360200190f35b6101106004803603606081101561014257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013591604090910135166104dd565b610177610605565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101bd600480360360208110156101b657600080fd5b5035610621565b604080519115158252519081900360200190f35b610177610647565b6101e285610621565b15610238576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061073c6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506102ec8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f0000000000000000000000000000000000000000000000000000000000000000925085915061066b9050565b610341576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806107646021913960400191505060405180910390fd5b61034a86610714565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103db57600080fd5b505af11580156103ef573d6000803e3d6000fd5b505050506040513d602081101561040557600080fd5b505161045c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806107856023913960400191505060405180910390fd5b6040805187815273ffffffffffffffffffffffffffffffffffffffff8716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60015473ffffffffffffffffffffffffffffffffffffffff16331461056357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21676f7665726e616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156105d457600080fd5b505af11580156105e8573d6000803e3d6000fd5b505050506040513d60208110156105fe57600080fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b7f000000000000000000000000000000000000000000000000000000000000000081565b600081815b855181101561070957600086828151811061068757fe5b602002602001015190508083116106ce5782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610700565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610670565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220d764fe5c0bad13c9d14e344e38e14abaa31ab7cdb45f6f0e0ebc15857c28179564736f6c634300060c00330000000000000000000000003479b0acf875405d7853f44142fe06470a40f6cc8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff12865
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c80635aa6e675116100505780635aa6e6751461016f5780639e34070f146101a0578063fc0c546a146101d157610072565b80632e7ba6ef146100775780632eb4a7ab1461011257806354575af41461012c575b600080fd5b6101106004803603608081101561008d57600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff60208201351691604082013591908101906080810160608201356401000000008111156100d157600080fd5b8201836020820111156100e357600080fd5b8035906020019184602083028401116401000000008311171561010557600080fd5b5090925090506101d9565b005b61011a6104b9565b60408051918252519081900360200190f35b6101106004803603606081101561014257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013591604090910135166104dd565b610177610605565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101bd600480360360208110156101b657600080fd5b5035610621565b604080519115158252519081900360200190f35b610177610647565b6101e285610621565b15610238576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061073c6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506102ec8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff12865925085915061066b9050565b610341576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806107646021913960400191505060405180910390fd5b61034a86610714565b7f0000000000000000000000003479b0acf875405d7853f44142fe06470a40f6cc73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103db57600080fd5b505af11580156103ef573d6000803e3d6000fd5b505050506040513d602081101561040557600080fd5b505161045c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806107856023913960400191505060405180910390fd5b6040805187815273ffffffffffffffffffffffffffffffffffffffff8716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff1286581565b60015473ffffffffffffffffffffffffffffffffffffffff16331461056357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f21676f7665726e616e6365000000000000000000000000000000000000000000604482015290519081900360640190fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb82846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156105d457600080fd5b505af11580156105e8573d6000803e3d6000fd5b505050506040513d60208110156105fe57600080fd5b5050505050565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b7f0000000000000000000000003479b0acf875405d7853f44142fe06470a40f6cc81565b600081815b855181101561070957600086828151811061068757fe5b602002602001015190508083116106ce5782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610700565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610670565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220d764fe5c0bad13c9d14e344e38e14abaa31ab7cdb45f6f0e0ebc15857c28179564736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003479b0acf875405d7853f44142fe06470a40f6cc8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff12865
-----Decoded View---------------
Arg [0] : token_ (address): 0x3479B0ACF875405D7853f44142FE06470a40f6CC
Arg [1] : merkleRoot_ (bytes32): 0x8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff12865
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000003479b0acf875405d7853f44142fe06470a40f6cc
Arg [1] : 8e25a6e94d50d15c9703403edb6389906ca4fd21e4f08cc7306a03304ff12865
Deployed Bytecode Sourcemap
5169:2389:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6249:767;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6249:767:0;;-1:-1:-1;6249:767:0;-1:-1:-1;6249:767:0;:::i;:::-;;5271:44;;;:::i;:::-;;;;;;;;;;;;;;;;7322:233;;;;;;;;;;;;;;;;-1:-1:-1;7322:233:0;;;;;;;;;;;;;;;;;;:::i;5426:25::-;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5626:331;;;;;;;;;;;;;;;;-1:-1:-1;5626:331:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5225:39;;;:::i;6249:767::-;6425:16;6435:5;6425:9;:16::i;:::-;6424:17;6416:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6536:12;6578:5;6585:7;6594:6;6561:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6551:51;;;;;;6536:66;;6635:49;6654:11;;6635:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6667:10:0;;-1:-1:-1;6679:4:0;;-1:-1:-1;6635:18:0;;-1:-1:-1;6635:49:0:i;:::-;6613:132;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6806:18;6818:5;6806:11;:18::i;:::-;6864:5;6857:22;;;6880:7;6889:6;6857:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6857:39:0;6835:124;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6977:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6249:767;;;;;;:::o;5271:44::-;;;:::o;7322:233::-;7481:10;;;;7467;:24;7459:48;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7518:6;:15;;;7534:3;7539:7;7518:29;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;7322:233:0:o;5426:25::-;;;;;;:::o;5626:331::-;5742:3;5734:11;;5690:4;5826:31;;;;;;;;;;;5884:1;5782:11;;;;5884:20;;;;5923:18;;;:26;;5626:331::o;5225:39::-;;;:::o;3337:910::-;3462:4;3502;3462;3519:605;3543:5;:12;3539:1;:16;3519:605;;;3577:20;3600:5;3606:1;3600:8;;;;;;;;;;;;;;3577:31;;3645:12;3629;:28;3625:488;;3821:12;3835;3804:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3772:95;;;;;;3757:110;;3625:488;;;4051:12;4065;4034:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4002:95;;;;;;3987:110;;3625:488;-1:-1:-1;3557:3:0;;3519:605;;;-1:-1:-1;4219:20:0;;;;3337:910;-1:-1:-1;;;3337:910:0:o;5965:276::-;6055:3;6047:11;;6020:24;6164:31;;;;;;;;;;;;6212:1;6095:11;;;;6212:20;;;;6164:69;;;6117:116;;5965:276::o
Swarm Source
ipfs://d764fe5c0bad13c9d14e344e38e14abaa31ab7cdb45f6f0e0ebc15857c281795
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.