More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 125 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Claim | 12159311 | 1314 days ago | IN | 0 ETH | 0.01032796 | ||||
Claim | 12111687 | 1321 days ago | IN | 0 ETH | 0.0088575 | ||||
Claim | 12063698 | 1328 days ago | IN | 0 ETH | 0.01870387 | ||||
Claim | 12038666 | 1332 days ago | IN | 0 ETH | 0.00999126 | ||||
Claim | 12035925 | 1333 days ago | IN | 0 ETH | 0.00828945 | ||||
Claim | 12035850 | 1333 days ago | IN | 0 ETH | 0.00825834 | ||||
Claim | 12031472 | 1333 days ago | IN | 0 ETH | 0.01204416 | ||||
Claim | 12025599 | 1334 days ago | IN | 0 ETH | 0.01321013 | ||||
Claim | 12007418 | 1337 days ago | IN | 0 ETH | 0.00980392 | ||||
Claim | 11979538 | 1341 days ago | IN | 0 ETH | 0.01012023 | ||||
Claim | 11968092 | 1343 days ago | IN | 0 ETH | 0.00691908 | ||||
Claim | 11963987 | 1344 days ago | IN | 0 ETH | 0.00665152 | ||||
Claim | 11960777 | 1344 days ago | IN | 0 ETH | 0.00850056 | ||||
Claim | 11959277 | 1345 days ago | IN | 0 ETH | 0.00757945 | ||||
Claim | 11958590 | 1345 days ago | IN | 0 ETH | 0.00493626 | ||||
Claim | 11956891 | 1345 days ago | IN | 0 ETH | 0.00722527 | ||||
Claim | 11954935 | 1345 days ago | IN | 0 ETH | 0.0070008 | ||||
Claim | 11954675 | 1345 days ago | IN | 0 ETH | 0.00839712 | ||||
Claim | 11947553 | 1346 days ago | IN | 0 ETH | 0.00509976 | ||||
Claim | 11945186 | 1347 days ago | IN | 0 ETH | 0.00651709 | ||||
Claim | 11933199 | 1349 days ago | IN | 0 ETH | 0.00750988 | ||||
Claim | 11933144 | 1349 days ago | IN | 0 ETH | 0.00786279 | ||||
Claim | 11933135 | 1349 days ago | IN | 0 ETH | 0.00786412 | ||||
Claim | 11928182 | 1349 days ago | IN | 0 ETH | 0.01112313 | ||||
Claim | 11927497 | 1349 days ago | IN | 0 ETH | 0.01218792 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
MerkleDistributor
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-02-15 */ // SPDX-License-Identifier: UNLICENSED 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; } } /// @dev Interface of the ERC20 standard with only the funcions we need interface I_ERC20 { function transfer(address recipient, uint256 amount) external returns (bool); } /// @dev Allows anyone to claim a token if they exist in a merkle root. interface I_MerkleDistributor { /// @dev Returns the address of the token distributed by this contract. function token() external view returns (address); /// @dev Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); /// @dev Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); /// @dev 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; /// @dev This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); } contract MerkleDistributor is I_MerkleDistributor { 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(msg.sender == account, 'claim: Only account may withdraw'); // self-request only 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.'); require(I_ERC20(token).transfer(account, amount), 'MerkleDistributor: Transfer failed.'); // Mark it claimed and send the token. _setClaimed(index); 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
60c060405234801561001057600080fd5b5060405161083b38038061083b8339818101604052604081101561003357600080fd5b8101908080519060200190929190805190602001909291905050508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508060a08181525050505060805160601c60a05161077c6100bf6000398061032f528061053a5250806103ab52806105af525061077c6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100fe5780639e34070f1461011c578063fc0c546a14610160575b600080fd5b6100fc6004803603608081101561006757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b9091929391929390505050610194565b005b610106610538565b6040518082815260200191505060405180910390f35b6101486004803603602081101561013257600080fd5b810190808035906020019092919050505061055c565b60405180821515815260200191505060405180910390f35b6101686105ad565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610235576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f636c61696d3a204f6e6c79206163636f756e74206d617920776974686472617781525060200191505060405180910390fd5b61023e8561055c565b15610294576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806106db6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019350505050604051602081830303815290604052805190602001209050610354838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f0000000000000000000000000000000000000000000000000000000000000000836105d1565b6103a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806107036021913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050506040513d602081101561046457600080fd5b81019080805190602001909291905050506104ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806107246023913960400191505060405180910390fd5b6104d386610686565b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b600080610100838161056a57fe5b0490506000610100848161057a57fe5b06905060008060008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008082905060005b85518110156106785760008682815181106105f157fe5b60200260200101519050808311610638578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061066a565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5080806001019150506105da565b508381149150509392505050565b6000610100828161069357fe5b049050600061010083816106a357fe5b069050806001901b60008084815260200190815260200160002054176000808481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220cce9202b1982dc1e5be36a5bab9b713cd4d33605509198e61f34b0f123f3d23364736f6c634300060c0033000000000000000000000000f157b7ba35089c9b0f02c24bbe1e03855dbe5c1f2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc89
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100fe5780639e34070f1461011c578063fc0c546a14610160575b600080fd5b6100fc6004803603608081101561006757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100b857600080fd5b8201836020820111156100ca57600080fd5b803590602001918460208302840111640100000000831117156100ec57600080fd5b9091929391929390505050610194565b005b610106610538565b6040518082815260200191505060405180910390f35b6101486004803603602081101561013257600080fd5b810190808035906020019092919050505061055c565b60405180821515815260200191505060405180910390f35b6101686105ad565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610235576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f636c61696d3a204f6e6c79206163636f756e74206d617920776974686472617781525060200191505060405180910390fd5b61023e8561055c565b15610294576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806106db6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019350505050604051602081830303815290604052805190602001209050610354838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc89836105d1565b6103a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806107036021913960400191505060405180910390fd5b7f000000000000000000000000f157b7ba35089c9b0f02c24bbe1e03855dbe5c1f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561043a57600080fd5b505af115801561044e573d6000803e3d6000fd5b505050506040513d602081101561046457600080fd5b81019080805190602001909291905050506104ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806107246023913960400191505060405180910390fd5b6104d386610686565b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc8981565b600080610100838161056a57fe5b0490506000610100848161057a57fe5b06905060008060008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b7f000000000000000000000000f157b7ba35089c9b0f02c24bbe1e03855dbe5c1f81565b60008082905060005b85518110156106785760008682815181106105f157fe5b60200260200101519050808311610638578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061066a565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5080806001019150506105da565b508381149150509392505050565b6000610100828161069357fe5b049050600061010083816106a357fe5b069050806001901b60008084815260200190815260200160002054176000808481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea2646970667358221220cce9202b1982dc1e5be36a5bab9b713cd4d33605509198e61f34b0f123f3d23364736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f157b7ba35089c9b0f02c24bbe1e03855dbe5c1f2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc89
-----Decoded View---------------
Arg [0] : _token (address): 0xF157b7Ba35089c9b0F02C24BBE1E03855dBE5c1F
Arg [1] : _merkleRoot (bytes32): 0x2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc89
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f157b7ba35089c9b0f02c24bbe1e03855dbe5c1f
Arg [1] : 2490acba7a30fda9317f6f7f837f39d52d6624ff189a9a24094ada49527ecc89
Deployed Bytecode Sourcemap
2403:1749:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3390:759;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2506:44;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2793:331;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;2460:39;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;3390:759;3536:7;3522:21;;:10;:21;;;3514:66;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3621:16;3631:5;3621:9;:16::i;:::-;3620:17;3612:70;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3732:12;3774:5;3781:7;3790:6;3757:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3747:51;;;;;;3732:66;;3817:49;3836:11;;3817:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3849:10;3861:4;3817:18;:49::i;:::-;3809:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3933:5;3925:23;;;3949:7;3958:6;3925:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3917:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4066:18;4078:5;4066:11;:18::i;:::-;4110:31;4118:5;4125:7;4134:6;4110:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3390:759;;;;;;:::o;2506:44::-;;;:::o;2793:331::-;2857:4;2874:24;2909:3;2901:5;:11;;;;;;2874:38;;2923:23;2957:3;2949:5;:11;;;;;;2923:37;;2971:19;2993:13;:31;3007:16;2993:31;;;;;;;;;;;;2971:53;;3035:12;3056:15;3051:1;:20;;3035:37;;3112:4;3104;3090:11;:18;:26;3083:33;;;;;;2793:331;;;:::o;2460:39::-;;;:::o;507:796::-;598:4;615:20;638:4;615:27;;660:9;655:525;679:5;:12;675:1;:16;655:525;;;713:20;736:5;742:1;736:8;;;;;;;;;;;;;;713:31;;781:12;765;:28;761:408;;935:12;949;918:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;908:55;;;;;;893:70;;761:408;;;1125:12;1139;1108:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1098:55;;;;;;1083:70;;761:408;655:525;693:3;;;;;;;655:525;;;;1291:4;1275:12;:20;1268:27;;;507:796;;;;;:::o;3132:250::-;3187:24;3222:3;3214:5;:11;;;;;;3187:38;;3236:23;3270:3;3262:5;:11;;;;;;3236:37;;3358:15;3353:1;:20;;3318:13;:31;3332:16;3318:31;;;;;;;;;;;;:56;3284:13;:31;3298:16;3284:31;;;;;;;;;;;:90;;;;3132:250;;;:::o
Swarm Source
ipfs://cce9202b1982dc1e5be36a5bab9b713cd4d33605509198e61f34b0f123f3d233
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.