Overview
ETH Balance
0 ETH
Eth Value
$0.00Token Holdings
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,495 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.0001385 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013857 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013848 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.0001385 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013858 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013854 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013856 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013857 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013856 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013848 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013854 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.0001385 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013854 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013852 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013852 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013848 | ||||
Claim | 20726319 | 7 days ago | IN | 0 ETH | 0.00013856 | ||||
Claim | 18162349 | 366 days ago | IN | 0 ETH | 0.00095953 | ||||
Claim | 18002554 | 388 days ago | IN | 0 ETH | 0.00080502 | ||||
Claim | 17889674 | 404 days ago | IN | 0 ETH | 0.00118711 | ||||
Claim | 17691858 | 432 days ago | IN | 0 ETH | 0.00156825 | ||||
Claim | 17582976 | 447 days ago | IN | 0 ETH | 0.00101655 | ||||
Claim | 17579296 | 448 days ago | IN | 0 ETH | 0.00151465 | ||||
Claim | 17579240 | 448 days ago | IN | 0 ETH | 0.00171151 | ||||
Claim | 17462474 | 464 days ago | IN | 0 ETH | 0.00138018 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MerkleDistributor
Compiler Version
v0.8.4+commit.c7e474f2
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.8.4; import "./IMerkleDistributor.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol"; contract MerkleDistributor is IMerkleDistributor { address public immutable override token; address public immutable treasury; bytes32 public immutable override merkleRoot; // This is a packed array of booleans. mapping(uint256 => uint256) private claimedBitMap; constructor( address token_, bytes32 merkleRoot_, address treasury_ ) { token = token_; merkleRoot = merkleRoot_; treasury = 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); } function endAirdrop() public { require( msg.sender == treasury, "MerkleDistributor: Not initiated by treasury." ); IERC20(token).transfer(treasury, IERC20(token).balanceOf(address(this))); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.4; // 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); }
// SPDX-License-Identifier: MIT 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 `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.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) { 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; } }
{ "optimizer": { "enabled": true, "runs": 10000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "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":"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"},{"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":"endAirdrop","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"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60e060405234801561001057600080fd5b50604051610b9a380380610b9a83398101604081905261002f91610070565b6001600160601b0319606093841b811660805260c09290925290911b1660a0526100ab565b80516001600160a01b038116811461006b57600080fd5b919050565b600080600060608486031215610084578283fd5b61008d84610054565b9250602084015191506100a260408501610054565b90509250925092565b60805160601c60a05160601c60c051610a99610101600039600081816091015261029201526000818160cb0152818161051c01526106350152600081816101420152818161039e01526105f70152610a996000f3fe608060405234801561001057600080fd5b50600436106100725760003560e01c8063726b5bad11610050578063726b5bad146101125780639e34070f1461011a578063fc0c546a1461013d57600080fd5b80632e7ba6ef146100775780632eb4a7ab1461008c57806361d027b3146100c6575b600080fd5b61008a610085366004610902565b610164565b005b6100b37f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100ed7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100bd565b61008a610504565b61012d6101283660046108d2565b610756565b60405190151581526020016100bd565b6100ed7f000000000000000000000000000000000000000000000000000000000000000081565b61016d85610756565b156101ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060448201527f636c61696d65642e00000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60408051602081018790527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1691810191909152605481018490526000906074016040516020818303038152906040528051906020012090506102bd8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f000000000000000000000000000000000000000000000000000000000000000092508591506107979050565b610349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f6660448201527f2e0000000000000000000000000000000000000000000000000000000000000060648201526084016101f6565b6103528661086d565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156103e257600080fd5b505af11580156103f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041a91906108ab565b6104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4d65726b6c654469737472696275746f723a205472616e73666572206661696c60448201527f65642e000000000000000000000000000000000000000000000000000000000060648201526084016101f6565b6040805187815273ffffffffffffffffffffffffffffffffffffffff871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146105c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4d65726b6c654469737472696275746f723a204e6f7420696e6974696174656460448201527f2062792074726561737572792e0000000000000000000000000000000000000060648201526084016101f6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063a9059cbb907f00000000000000000000000000000000000000000000000000000000000000009083906370a082319060240160206040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b091906108ea565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381600087803b15801561071b57600080fd5b505af115801561072f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075391906108ab565b50565b600080610765610100846109ae565b9050600061077561010085610a20565b60009283526020839052604090922054600190921b9182169091149392505050565b600081815b85518110156108625760008682815181106107e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905080831161082257604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061084f565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061085a816109c2565b91505061079c565b509092149392505050565b600061087b610100836109ae565b9050600061088b61010084610a20565b6000928352602083905260409092208054600190931b9092179091555050565b6000602082840312156108bc578081fd5b815180151581146108cb578182fd5b9392505050565b6000602082840312156108e3578081fd5b5035919050565b6000602082840312156108fb578081fd5b5051919050565b600080600080600060808688031215610919578081fd5b85359450602086013573ffffffffffffffffffffffffffffffffffffffff81168114610943578182fd5b935060408601359250606086013567ffffffffffffffff80821115610966578283fd5b818801915088601f830112610979578283fd5b813581811115610987578384fd5b8960208260051b850101111561099b578384fd5b9699959850939650602001949392505050565b6000826109bd576109bd610a34565b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610a19577f4e487b710000000000000000000000000000000000000000000000000000000081526011600452602481fd5b5060010190565b600082610a2f57610a2f610a34565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122093cd7524f9e7baad82a998d57982498c49f7445f6a5d2357b6efdfc2afcd7f4964736f6c634300080400330000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b5000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b6
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100725760003560e01c8063726b5bad11610050578063726b5bad146101125780639e34070f1461011a578063fc0c546a1461013d57600080fd5b80632e7ba6ef146100775780632eb4a7ab1461008c57806361d027b3146100c6575b600080fd5b61008a610085366004610902565b610164565b005b6100b37f855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b581565b6040519081526020015b60405180910390f35b6100ed7f000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100bd565b61008a610504565b61012d6101283660046108d2565b610756565b60405190151581526020016100bd565b6100ed7f0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f5481565b61016d85610756565b156101ff576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060448201527f636c61696d65642e00000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60408051602081018790527fffffffffffffffffffffffffffffffffffffffff000000000000000000000000606087901b1691810191909152605481018490526000906074016040516020818303038152906040528051906020012090506102bd8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b592508591506107979050565b610349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f6660448201527f2e0000000000000000000000000000000000000000000000000000000000000060648201526084016101f6565b6103528661086d565b6040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152602482018690527f0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54169063a9059cbb90604401602060405180830381600087803b1580156103e257600080fd5b505af11580156103f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041a91906108ab565b6104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f4d65726b6c654469737472696275746f723a205472616e73666572206661696c60448201527f65642e000000000000000000000000000000000000000000000000000000000060648201526084016101f6565b6040805187815273ffffffffffffffffffffffffffffffffffffffff871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b616146105c9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602d60248201527f4d65726b6c654469737472696275746f723a204e6f7420696e6974696174656460448201527f2062792074726561737572792e0000000000000000000000000000000000000060648201526084016101f6565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201527f0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f5473ffffffffffffffffffffffffffffffffffffffff169063a9059cbb907f000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b69083906370a082319060240160206040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106b091906108ea565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b16815273ffffffffffffffffffffffffffffffffffffffff90921660048301526024820152604401602060405180830381600087803b15801561071b57600080fd5b505af115801561072f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075391906108ab565b50565b600080610765610100846109ae565b9050600061077561010085610a20565b60009283526020839052604090922054600190921b9182169091149392505050565b600081815b85518110156108625760008682815181106107e0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151905080831161082257604080516020810185905290810182905260600160405160208183030381529060405280519060200120925061084f565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b508061085a816109c2565b91505061079c565b509092149392505050565b600061087b610100836109ae565b9050600061088b61010084610a20565b6000928352602083905260409092208054600190931b9092179091555050565b6000602082840312156108bc578081fd5b815180151581146108cb578182fd5b9392505050565b6000602082840312156108e3578081fd5b5035919050565b6000602082840312156108fb578081fd5b5051919050565b600080600080600060808688031215610919578081fd5b85359450602086013573ffffffffffffffffffffffffffffffffffffffff81168114610943578182fd5b935060408601359250606086013567ffffffffffffffff80821115610966578283fd5b818801915088601f830112610979578283fd5b813581811115610987578384fd5b8960208260051b850101111561099b578384fd5b9699959850939650602001949392505050565b6000826109bd576109bd610a34565b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610a19577f4e487b710000000000000000000000000000000000000000000000000000000081526011600452602481fd5b5060010190565b600082610a2f57610a2f610a34565b500690565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122093cd7524f9e7baad82a998d57982498c49f7445f6a5d2357b6efdfc2afcd7f4964736f6c63430008040033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b5000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b6
-----Decoded View---------------
Arg [0] : token_ (address): 0x9D65fF81a3c488d585bBfb0Bfe3c7707c7917f54
Arg [1] : merkleRoot_ (bytes32): 0x855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b5
Arg [2] : treasury_ (address): 0xb35096b074fdb9bBac63E3AdaE0Bbde512B2E6b6
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000009d65ff81a3c488d585bbfb0bfe3c7707c7917f54
Arg [1] : 855f15a94c3438196c4aebe82046bd119fc804d086154a09324d73e0773652b5
Arg [2] : 000000000000000000000000b35096b074fdb9bbac63e3adae0bbde512b2e6b6
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $21.34 | 11,956.3264 | $255,148 |
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.