Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Multichain Info
Latest 25 from a total of 779 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 15282835 | 760 days ago | IN | 0 ETH | 0.00422153 | ||||
Claim | 14907877 | 821 days ago | IN | 0 ETH | 0.00189161 | ||||
Claim | 14815160 | 836 days ago | IN | 0 ETH | 0.00153567 | ||||
Claim | 14576060 | 874 days ago | IN | 0 ETH | 0.00430131 | ||||
Claim | 14518691 | 883 days ago | IN | 0 ETH | 0.00528186 | ||||
Claim | 14488001 | 888 days ago | IN | 0 ETH | 0.00909366 | ||||
Claim | 14436442 | 896 days ago | IN | 0 ETH | 0.00423514 | ||||
Claim | 14383031 | 904 days ago | IN | 0 ETH | 0.00168927 | ||||
Claim | 14378971 | 905 days ago | IN | 0 ETH | 0.0026435 | ||||
Claim | 14367089 | 907 days ago | IN | 0 ETH | 0.00327734 | ||||
Claim | 14301712 | 917 days ago | IN | 0 ETH | 0.00794892 | ||||
Claim | 14295720 | 918 days ago | IN | 0 ETH | 0.00819593 | ||||
Claim | 14294847 | 918 days ago | IN | 0 ETH | 0.00442103 | ||||
Claim | 14145441 | 941 days ago | IN | 0 ETH | 0.00118747 | ||||
Claim | 14138540 | 942 days ago | IN | 0 ETH | 0.00140377 | ||||
Claim | 14093631 | 949 days ago | IN | 0 ETH | 0.00976309 | ||||
Claim | 14043054 | 957 days ago | IN | 0 ETH | 0.00674337 | ||||
Claim | 13945473 | 972 days ago | IN | 0 ETH | 0.00982256 | ||||
Claim | 13937985 | 973 days ago | IN | 0 ETH | 0.00237214 | ||||
Claim | 13937843 | 973 days ago | IN | 0 ETH | 0.00925088 | ||||
Claim | 13926461 | 975 days ago | IN | 0 ETH | 0.00840099 | ||||
Claim | 13916851 | 976 days ago | IN | 0 ETH | 0.00850996 | ||||
Claim | 13796363 | 995 days ago | IN | 0 ETH | 0.00339332 | ||||
Claim | 13789962 | 996 days ago | IN | 0 ETH | 0.003382 | ||||
Claim | 13784148 | 997 days ago | IN | 0 ETH | 0.00492813 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MerkleDistributor
Compiler Version
v0.6.11+commit.5ef660b1
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-11-10 */ /** *Submitted for verification at Etherscan.io on 2021-11-10 */ // Dependency file: @openzeppelin/contracts/token/ERC20/IERC20.sol // SPDX-License-Identifier: MIT pragma solidity =0.6.11; /** * @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); } // Dependency file: @openzeppelin/contracts/cryptography/MerkleProof.sol // pragma solidity ^0.6.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; } } // Dependency file: contracts/interfaces/IMerkleDistributor.sol // 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); } // Root file: contracts/MerkleDistributor.sol // import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; // import "@openzeppelin/contracts/cryptography/MerkleProof.sol"; // import "contracts/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; constructor(address token_, bytes32 merkleRoot_) public { token = token_; merkleRoot = merkleRoot_; } 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); } }
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":[{"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
60c060405234801561001057600080fd5b506040516107f73803806107f78339818101604052604081101561003357600080fd5b8101908080519060200190929190805190602001909291905050508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508060a08181525050505060805160601c60a0516107386100bf600039806102bc52806104f3525080610341528061056852506107386000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100fe5780639e34070f1461011c578063fc0c546a14610162575b600080fd5b6100fc6004803603608081101561006757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b90919293919293905050506101ac565b005b6101066104f1565b6040518082815260200191505060405180910390f35b6101486004803603602081101561013257600080fd5b8101908080359060200190929190505050610515565b604051808215151515815260200191505060405180910390f35b61016a610566565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b585610515565b1561020b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806106976028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506102e1838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f00000000000000000000000000000000000000000000000000000000000000008361058a565b610336576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806106bf6021913960400191505060405180910390fd5b61033f86610642565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103e657600080fd5b505af11580156103fa573d6000803e3d6000fd5b505050506040513d602081101561041057600080fd5b8101908080519060200190929190505050610476576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806106e06023913960400191505060405180910390fd5b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080610100838161052357fe5b0490506000610100848161053357fe5b06905060008060008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008082905060008090505b85518110156106345760008682815181106105ad57fe5b602002602001015190508083116105f45782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610626565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b508080600101915050610596565b508381149150509392505050565b6000610100828161064f57fe5b0490506000610100838161065f57fe5b069050806001901b60008084815260200190815260200160002054176000808481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220e7564b019c42e0f8a3ad59bdcd9329a6545eb125a90229ef06c792707021aee264736f6c634300060b0033000000000000000000000000c4436fbae6eba5d95bf7d53ae515f8a707bd402a4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc07
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100fe5780639e34070f1461011c578063fc0c546a14610162575b600080fd5b6100fc6004803603608081101561006757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b90919293919293905050506101ac565b005b6101066104f1565b6040518082815260200191505060405180910390f35b6101486004803603602081101561013257600080fd5b8101908080359060200190929190505050610515565b604051808215151515815260200191505060405180910390f35b61016a610566565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101b585610515565b1561020b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806106976028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b815260140182815260200193505050506040516020818303038152906040528051906020012090506102e1838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc078361058a565b610336576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806106bf6021913960400191505060405180910390fd5b61033f86610642565b7f000000000000000000000000c4436fbae6eba5d95bf7d53ae515f8a707bd402a73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156103e657600080fd5b505af11580156103fa573d6000803e3d6000fd5b505050506040513d602081101561041057600080fd5b8101908080519060200190929190505050610476576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806106e06023913960400191505060405180910390fd5b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc0781565b600080610100838161052357fe5b0490506000610100848161053357fe5b06905060008060008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b7f000000000000000000000000c4436fbae6eba5d95bf7d53ae515f8a707bd402a81565b60008082905060008090505b85518110156106345760008682815181106105ad57fe5b602002602001015190508083116105f45782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610626565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b508080600101915050610596565b508381149150509392505050565b6000610100828161064f57fe5b0490506000610100838161065f57fe5b069050806001901b60008084815260200190815260200160002054176000808481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220e7564b019c42e0f8a3ad59bdcd9329a6545eb125a90229ef06c792707021aee264736f6c634300060b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c4436fbae6eba5d95bf7d53ae515f8a707bd402a4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc07
-----Decoded View---------------
Arg [0] : token_ (address): 0xc4436fBAE6eBa5d95bf7d53Ae515F8A707Bd402A
Arg [1] : merkleRoot_ (bytes32): 0x4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc07
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c4436fbae6eba5d95bf7d53ae515f8a707bd402a
Arg [1] : 4a4218712f160321b2a4198b96d68394819d042ecf37254f138c11960e00cc07
Deployed Bytecode Sourcemap
5479:1639:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6465:650;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5581:44;;;:::i;:::-;;;;;;;;;;;;;;;;;;;5868:331;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;5535:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;6465:650;6598:16;6608:5;6598:9;:16::i;:::-;6597:17;6589:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6709:12;6751:5;6758:7;6767:6;6734:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6724:51;;;;;;6709:66;;6794:49;6813:11;;6794:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6826:10;6838:4;6794:18;:49::i;:::-;6786:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6942:18;6954:5;6942:11;:18::i;:::-;6986:5;6979:22;;;7002:7;7011:6;6979:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6971:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7076:31;7084:5;7091:7;7100:6;7076:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6465:650;;;;;;:::o;5581:44::-;;;:::o;5868:331::-;5932:4;5949:24;5984:3;5976:5;:11;;;;;;5949:38;;5998:23;6032:3;6024:5;:11;;;;;;5998:37;;6046:19;6068:13;:31;6082:16;6068:31;;;;;;;;;;;;6046:53;;6110:12;6131:15;6126:1;:20;;6110:37;;6187:4;6179;6165:11;:18;:26;6158:33;;;;;;5868:331;;;:::o;5535:39::-;;;:::o;3475:796::-;3566:4;3583:20;3606:4;3583:27;;3628:9;3640:1;3628:13;;3623:525;3647:5;:12;3643:1;:16;3623:525;;;3681:20;3704:5;3710:1;3704:8;;;;;;;;;;;;;;3681:31;;3749:12;3733;:28;3729:408;;3903:12;3917;3886:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3876:55;;;;;;3861:70;;3729:408;;;4093:12;4107;4076:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4066:55;;;;;;4051:70;;3729:408;3623:525;3661:3;;;;;;;3623:525;;;;4259:4;4243:12;:20;4236:27;;;3475:796;;;;;:::o;6207:250::-;6262:24;6297:3;6289:5;:11;;;;;;6262:38;;6311:23;6345:3;6337:5;:11;;;;;;6311:37;;6433:15;6428:1;:20;;6393:13;:31;6407:16;6393:31;;;;;;;;;;;;:56;6359:13;:31;6373:16;6359:31;;;;;;;;;;;:90;;;;6207:250;;;:::o
Swarm Source
ipfs://e7564b019c42e0f8a3ad59bdcd9329a6545eb125a90229ef06c792707021aee2
Loading...
Loading
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.