Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 65 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Collect Unclaime... | 13360573 | 1096 days ago | IN | 0 ETH | 0.00533588 | ||||
Claim | 13345510 | 1098 days ago | IN | 0 ETH | 0.00387604 | ||||
Claim | 13344286 | 1098 days ago | IN | 0 ETH | 0.00482574 | ||||
Claim | 13341777 | 1099 days ago | IN | 0 ETH | 0.00506716 | ||||
Claim | 13340395 | 1099 days ago | IN | 0 ETH | 0.00679202 | ||||
Claim | 13338918 | 1099 days ago | IN | 0 ETH | 0.00354847 | ||||
Claim | 13336951 | 1100 days ago | IN | 0 ETH | 0.00723948 | ||||
Claim | 13335518 | 1100 days ago | IN | 0 ETH | 0.01032194 | ||||
Claim | 13334784 | 1100 days ago | IN | 0 ETH | 0.00911178 | ||||
Claim | 13334706 | 1100 days ago | IN | 0 ETH | 0.01064895 | ||||
Claim | 13332548 | 1100 days ago | IN | 0 ETH | 0.0065125 | ||||
Claim | 13332507 | 1100 days ago | IN | 0 ETH | 0.00632873 | ||||
Claim | 13332163 | 1100 days ago | IN | 0 ETH | 0.00602138 | ||||
Claim | 13332158 | 1100 days ago | IN | 0 ETH | 0.00710129 | ||||
Claim | 13331999 | 1100 days ago | IN | 0 ETH | 0.00611499 | ||||
Claim | 13331910 | 1100 days ago | IN | 0 ETH | 0.00770156 | ||||
Claim | 13331871 | 1100 days ago | IN | 0 ETH | 0.00385531 | ||||
Claim | 13331854 | 1100 days ago | IN | 0 ETH | 0.00567078 | ||||
Claim | 13331650 | 1100 days ago | IN | 0 ETH | 0.0056697 | ||||
Claim | 13331266 | 1100 days ago | IN | 0 ETH | 0.00618475 | ||||
Claim | 13330242 | 1101 days ago | IN | 0 ETH | 0.00772774 | ||||
Claim | 13329850 | 1101 days ago | IN | 0 ETH | 0.00781865 | ||||
Claim | 13329401 | 1101 days ago | IN | 0 ETH | 0.0163521 | ||||
Claim | 13329274 | 1101 days ago | IN | 0 ETH | 0.00717005 | ||||
Claim | 13329268 | 1101 days ago | IN | 0 ETH | 0.00910523 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MerkleDistributor
Compiler Version
v0.7.6+commit.7338295f
Optimization Enabled:
Yes with 10000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity =0.7.6; import '@openzeppelin/contracts/token/ERC20/IERC20.sol'; import '@openzeppelin/contracts/cryptography/MerkleProof.sol'; import './interfaces/IMerkleDistributor.sol'; 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 internal immutable _deployer; address internal immutable _beneficiary; constructor( address token_, bytes32 merkleRoot_, address beneficiary_ ) { token = token_; merkleRoot = merkleRoot_; _deployer = msg.sender; _beneficiary = beneficiary_; } 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); } function collectUnclaimed() external { require(msg.sender == _deployer, 'MerkleDistributor: not deployer'); uint256 balance = IERC20(token).balanceOf(address(this)); require(IERC20(token).transfer(_beneficiary, balance), 'MerkleDistributor: collectUnclaimed failed.'); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 `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); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @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; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity >=0.5.0; // 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": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"token_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"},{"internalType":"address","name":"beneficiary_","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"},{"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":"collectUnclaimed","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
61010060405234801561001157600080fd5b506040516109c73803806109c78339818101604052606081101561003457600080fd5b5080516020820151604090920151606082811b6001600160601b031990811660805260a08590523380831b60c0529183901b1660e0526001600160a01b0392831693929091166109106100b76000398061064c5250806104cd525080610273528061046d5250806102fe528061055d5280610680528061075152506109106000f3fe608060405234801561001057600080fd5b50600436106100675760003560e01c80639e34070f116100505780639e34070f14610121578063da8d4c7714610152578063fc0c546a1461015a57610067565b80632e7ba6ef1461006c5780632eb4a7ab14610107575b600080fd5b6101056004803603608081101561008257600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff60208201351691604082013591908101906080810160608201356401000000008111156100c657600080fd5b8201836020820111156100d857600080fd5b803590602001918460208302840111640100000000831117156100fa57600080fd5b50909250905061018b565b005b61010f61046b565b60408051918252519081900360200190f35b61013e6004803603602081101561013757600080fd5b503561048f565b604080519115158252519081900360200190f35b6101056104b5565b61016261074f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101948561048f565b156101ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806108446028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001935050505060405160208183030381529060405280519060200120905061029e8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f000000000000000000000000000000000000000000000000000000000000000092508591506107739050565b6102f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061086c6021913960400191505060405180910390fd5b6102fc8661081c565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561038d57600080fd5b505af11580156103a1573d6000803e3d6000fd5b505050506040513d60208110156103b757600080fd5b505161040e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061088d6023913960400191505060405180910390fd5b6040805187815273ffffffffffffffffffffffffffffffffffffffff8716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b3373ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000161461055957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d65726b6c654469737472696275746f723a206e6f74206465706c6f79657200604482015290519081900360640190fd5b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105e257600080fd5b505afa1580156105f6573d6000803e3d6000fd5b505050506040513d602081101561060c57600080fd5b5051604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000811660048301526024820184905291519293507f00000000000000000000000000000000000000000000000000000000000000009091169163a9059cbb916044808201926020929091908290030181600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506040513d60208110156106f557600080fd5b505161074c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806108b0602b913960400191505060405180910390fd5b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b600081815b855181101561081157600086828151811061078f57fe5b602002602001015190508083116107d65782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610808565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610778565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642e4d65726b6c654469737472696275746f723a20636f6c6c656374556e636c61696d6564206661696c65642ea264697066735822122010b7047f7ce0f33e73e7acef97bf6084a04fdbc391e4e6d3bef46b786fe7113064736f6c634300070600330000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c29638088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a94000000000000000000000000d06ae6fb7eade890f3e295d69a6679380c9456c1
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100675760003560e01c80639e34070f116100505780639e34070f14610121578063da8d4c7714610152578063fc0c546a1461015a57610067565b80632e7ba6ef1461006c5780632eb4a7ab14610107575b600080fd5b6101056004803603608081101561008257600080fd5b81359173ffffffffffffffffffffffffffffffffffffffff60208201351691604082013591908101906080810160608201356401000000008111156100c657600080fd5b8201836020820111156100d857600080fd5b803590602001918460208302840111640100000000831117156100fa57600080fd5b50909250905061018b565b005b61010f61046b565b60408051918252519081900360200190f35b61013e6004803603602081101561013757600080fd5b503561048f565b604080519115158252519081900360200190f35b6101056104b5565b61016261074f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101948561048f565b156101ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806108446028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001935050505060405160208183030381529060405280519060200120905061029e8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a9492508591506107739050565b6102f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061086c6021913960400191505060405180910390fd5b6102fc8661081c565b7f0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c2963873ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561038d57600080fd5b505af11580156103a1573d6000803e3d6000fd5b505050506040513d60208110156103b757600080fd5b505161040e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061088d6023913960400191505060405180910390fd5b6040805187815273ffffffffffffffffffffffffffffffffffffffff8716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a9481565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b3373ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000087e1237074760f57b424121edca06f082700dbc2161461055957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f4d65726b6c654469737472696275746f723a206e6f74206465706c6f79657200604482015290519081900360640190fd5b60007f0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c2963873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156105e257600080fd5b505afa1580156105f6573d6000803e3d6000fd5b505050506040513d602081101561060c57600080fd5b5051604080517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000d06ae6fb7eade890f3e295d69a6679380c9456c1811660048301526024820184905291519293507f0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c296389091169163a9059cbb916044808201926020929091908290030181600087803b1580156106cb57600080fd5b505af11580156106df573d6000803e3d6000fd5b505050506040513d60208110156106f557600080fd5b505161074c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b8152602001806108b0602b913960400191505060405180910390fd5b50565b7f0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c2963881565b600081815b855181101561081157600086828151811061078f57fe5b602002602001015190508083116107d65782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610808565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610778565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642e4d65726b6c654469737472696275746f723a20636f6c6c656374556e636c61696d6564206661696c65642ea264697066735822122010b7047f7ce0f33e73e7acef97bf6084a04fdbc391e4e6d3bef46b786fe7113064736f6c63430007060033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c29638088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a94000000000000000000000000d06ae6fb7eade890f3e295d69a6679380c9456c1
-----Decoded View---------------
Arg [0] : token_ (address): 0x3c8D2FCE49906e11e71cB16Fa0fFeB2B16C29638
Arg [1] : merkleRoot_ (bytes32): 0x088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a94
Arg [2] : beneficiary_ (address): 0xd06Ae6fB7EaDe890f3e295D69A6679380C9456c1
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000003c8d2fce49906e11e71cb16fa0ffeb2b16c29638
Arg [1] : 088088f0c890d9598934cc9105979bfbaac6f3ea7bf9754b596b32f642664a94
Arg [2] : 000000000000000000000000d06ae6fb7eade890f3e295d69a6679380c9456c1
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.