Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 119 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Fetch Unclaimed | 12546380 | 1336 days ago | IN | 0 ETH | 0.00061444 | ||||
Claim | 12531919 | 1338 days ago | IN | 0 ETH | 0.00140963 | ||||
Claim | 12529271 | 1338 days ago | IN | 0 ETH | 0.00131243 | ||||
Claim | 12520922 | 1340 days ago | IN | 0 ETH | 0.00171392 | ||||
Claim | 12516551 | 1340 days ago | IN | 0 ETH | 0.00270214 | ||||
Claim | 12510783 | 1341 days ago | IN | 0 ETH | 0.00366475 | ||||
Claim | 12504419 | 1342 days ago | IN | 0 ETH | 0.00463272 | ||||
Claim | 12501261 | 1343 days ago | IN | 0 ETH | 0.00232335 | ||||
Claim | 12501189 | 1343 days ago | IN | 0 ETH | 0.00232438 | ||||
Claim | 12500249 | 1343 days ago | IN | 0 ETH | 0.00282366 | ||||
Claim | 12488721 | 1345 days ago | IN | 0 ETH | 0.00091822 | ||||
Claim | 12488657 | 1345 days ago | IN | 0 ETH | 0.00270172 | ||||
Claim | 12484840 | 1345 days ago | IN | 0 ETH | 0.004632 | ||||
Claim | 12484306 | 1345 days ago | IN | 0 ETH | 0.00370569 | ||||
Claim | 12483151 | 1346 days ago | IN | 0 ETH | 0.00362905 | ||||
Claim | 12482058 | 1346 days ago | IN | 0 ETH | 0.0046302 | ||||
Claim | 12475942 | 1347 days ago | IN | 0 ETH | 0.00347238 | ||||
Claim | 12475934 | 1347 days ago | IN | 0 ETH | 0.00355129 | ||||
Claim | 12474971 | 1347 days ago | IN | 0 ETH | 0.00458698 | ||||
Claim | 12473997 | 1347 days ago | IN | 0 ETH | 0.00432387 | ||||
Claim | 12473521 | 1347 days ago | IN | 0 ETH | 0.00671744 | ||||
Claim | 12473274 | 1347 days ago | IN | 0 ETH | 0.0057122 | ||||
Claim | 12473201 | 1347 days ago | IN | 0 ETH | 0.00609911 | ||||
Claim | 12473162 | 1347 days ago | IN | 0 ETH | 0.00447678 | ||||
Claim | 12473080 | 1347 days ago | IN | 0 ETH | 0.00486208 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
MooncatDistributor
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2021-04-29 */ // SPDX-License-Identifier: NONE pragma solidity 0.6.12; // Part: OpenZeppelin/[email protected]/IERC20 /** * @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); } // Part: OpenZeppelin/[email protected]/MerkleProof /** * @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; } } // File: MooncatDistributor.sol contract MooncatDistributor { using MerkleProof for bytes32[]; IERC20 public token; bytes32 public merkleRoot; mapping(uint256 => uint256) public claimedBitMap; uint256 expiryDate; address owner; event Claimed(uint256 index, address account, uint256 amount); constructor(address _token, bytes32 _root, uint256 _expiry, address _owner) public { token = IERC20(_token); merkleRoot = _root; expiryDate = _expiry; owner = _owner; } function fetchUnclaimed() external { require(block.timestamp > expiryDate, "!date"); require(token.transfer(owner, token.balanceOf(address(this))), "Token transfer failed"); } function isClaimed(uint256 _index) public view returns(bool) { uint256 wordIndex = _index / 256; uint256 bitIndex = _index % 256; uint256 word = claimedBitMap[wordIndex]; uint256 bitMask = 1 << bitIndex; return word & bitMask == bitMask; } function _setClaimed(uint256 _index) internal { uint256 wordIndex = _index / 256; uint256 bitIndex = _index % 256; claimedBitMap[wordIndex] |= 1 << bitIndex; } function claim(uint256 _index, address _account, uint256 _amount, bytes32[] memory _proof) external { require(!isClaimed(_index), "Claimed already"); bytes32 node = keccak256(abi.encodePacked(_index, _account, _amount)); require(_proof.verify(merkleRoot, node), "Wrong proof"); _setClaimed(_index); require(token.transfer(_account, _amount), "Token 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":"_root","type":"bytes32"},{"internalType":"uint256","name":"_expiry","type":"uint256"},{"internalType":"address","name":"_owner","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":"_proof","type":"bytes32[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"claimedBitMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fetchUnclaimed","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":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b5060405161072b38038061072b8339818101604052608081101561003357600080fd5b50805160208201516040830151606090930151600080546001600160a01b039485166001600160a01b0319918216179091556001929092556003939093556004805492909316911617905561069e8061008d6000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c80632e7ba6ef146100675780632eb4a7ab146101285780639e34070f14610142578063ee25560b14610173578063ee5d69c614610190578063fc0c546a14610198575b600080fd5b6101266004803603608081101561007d57600080fd5b8135916001600160a01b0360208201351691604082013591908101906080810160608201356401000000008111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111640100000000831117156100e857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506101bc945050505050565b005b6101306103c0565b60408051918252519081900360200190f35b61015f6004803603602081101561015857600080fd5b50356103c6565b604080519115158252519081900360200190f35b6101306004803603602081101561018957600080fd5b50356103ec565b6101266103fe565b6101a0610589565b604080516001600160a01b039092168252519081900360200190f35b6101c5846103c6565b15610209576040805162461bcd60e51b815260206004820152600f60248201526e436c61696d656420616c726561647960881b604482015290519081900360640190fd5b6040805160208082018790526bffffffffffffffffffffffff19606087901b16828401526054808301869052835180840390910181526074909201909252805191012060015461025b90839083610598565b61029a576040805162461bcd60e51b815260206004820152600b60248201526a2bb937b73390383937b7b360a91b604482015290519081900360640190fd5b6102a385610641565b600080546040805163a9059cbb60e01b81526001600160a01b038881166004830152602482018890529151919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156102fc57600080fd5b505af1158015610310573d6000803e3d6000fd5b505050506040513d602081101561032657600080fd5b5051610371576040805162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b604080518681526001600160a01b038616602082015280820185905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a15050505050565b60015481565b6101008104600090815260026020526040902054600160ff9092169190911b9081161490565b60026020526000908152604090205481565b600354421161043c576040805162461bcd60e51b8152602060048201526005602482015264216461746560d81b604482015290519081900360640190fd5b60005460048054604080516370a0823160e01b81523093810193909352516001600160a01b039384169363a9059cbb9392169184916370a0823191602480820192602092909190829003018186803b15801561049757600080fd5b505afa1580156104ab573d6000803e3d6000fd5b505050506040513d60208110156104c157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561051257600080fd5b505af1158015610526573d6000803e3d6000fd5b505050506040513d602081101561053c57600080fd5b5051610587576040805162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b565b6000546001600160a01b031681565b600081815b85518110156106365760008682815181106105b457fe5b602002602001015190508083116105fb578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061062d565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161059d565b509092149392505050565b610100810460009081526002602052604090208054600160ff9093169290921b909117905556fea2646970667358221220026400403927c3a8ec2c980beb14478c5af7264db25c1e077778c5a02f756cab64736f6c634300060c003300000000000000000000000006141f60ee56c8ecc869f46568e2cb1e66baaf41c8c53d696028c218fcb2c5b799d345c87e82bb1efb3dc3d40a2a95da702a2e2400000000000000000000000000000000000000000000000000000000609ef2df000000000000000000000000795aff8df356872fa867fa77241bbf27efbd5eba
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100625760003560e01c80632e7ba6ef146100675780632eb4a7ab146101285780639e34070f14610142578063ee25560b14610173578063ee5d69c614610190578063fc0c546a14610198575b600080fd5b6101266004803603608081101561007d57600080fd5b8135916001600160a01b0360208201351691604082013591908101906080810160608201356401000000008111156100b457600080fd5b8201836020820111156100c657600080fd5b803590602001918460208302840111640100000000831117156100e857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506101bc945050505050565b005b6101306103c0565b60408051918252519081900360200190f35b61015f6004803603602081101561015857600080fd5b50356103c6565b604080519115158252519081900360200190f35b6101306004803603602081101561018957600080fd5b50356103ec565b6101266103fe565b6101a0610589565b604080516001600160a01b039092168252519081900360200190f35b6101c5846103c6565b15610209576040805162461bcd60e51b815260206004820152600f60248201526e436c61696d656420616c726561647960881b604482015290519081900360640190fd5b6040805160208082018790526bffffffffffffffffffffffff19606087901b16828401526054808301869052835180840390910181526074909201909252805191012060015461025b90839083610598565b61029a576040805162461bcd60e51b815260206004820152600b60248201526a2bb937b73390383937b7b360a91b604482015290519081900360640190fd5b6102a385610641565b600080546040805163a9059cbb60e01b81526001600160a01b038881166004830152602482018890529151919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156102fc57600080fd5b505af1158015610310573d6000803e3d6000fd5b505050506040513d602081101561032657600080fd5b5051610371576040805162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b604080518681526001600160a01b038616602082015280820185905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a15050505050565b60015481565b6101008104600090815260026020526040902054600160ff9092169190911b9081161490565b60026020526000908152604090205481565b600354421161043c576040805162461bcd60e51b8152602060048201526005602482015264216461746560d81b604482015290519081900360640190fd5b60005460048054604080516370a0823160e01b81523093810193909352516001600160a01b039384169363a9059cbb9392169184916370a0823191602480820192602092909190829003018186803b15801561049757600080fd5b505afa1580156104ab573d6000803e3d6000fd5b505050506040513d60208110156104c157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561051257600080fd5b505af1158015610526573d6000803e3d6000fd5b505050506040513d602081101561053c57600080fd5b5051610587576040805162461bcd60e51b8152602060048201526015602482015274151bdad95b881d1c985b9cd9995c8819985a5b1959605a1b604482015290519081900360640190fd5b565b6000546001600160a01b031681565b600081815b85518110156106365760008682815181106105b457fe5b602002602001015190508083116105fb578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061062d565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161059d565b509092149392505050565b610100810460009081526002602052604090208054600160ff9093169290921b909117905556fea2646970667358221220026400403927c3a8ec2c980beb14478c5af7264db25c1e077778c5a02f756cab64736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000006141f60ee56c8ecc869f46568e2cb1e66baaf41c8c53d696028c218fcb2c5b799d345c87e82bb1efb3dc3d40a2a95da702a2e2400000000000000000000000000000000000000000000000000000000609ef2df000000000000000000000000795aff8df356872fa867fa77241bbf27efbd5eba
-----Decoded View---------------
Arg [0] : _token (address): 0x06141F60eE56c8ECc869f46568E2cb1e66BAaf41
Arg [1] : _root (bytes32): 0xc8c53d696028c218fcb2c5b799d345c87e82bb1efb3dc3d40a2a95da702a2e24
Arg [2] : _expiry (uint256): 1621029599
Arg [3] : _owner (address): 0x795afF8df356872FA867fA77241bBF27EFBD5EbA
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000006141f60ee56c8ecc869f46568e2cb1e66baaf41
Arg [1] : c8c53d696028c218fcb2c5b799d345c87e82bb1efb3dc3d40a2a95da702a2e24
Arg [2] : 00000000000000000000000000000000000000000000000000000000609ef2df
Arg [3] : 000000000000000000000000795aff8df356872fa867fa77241bbf27efbd5eba
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.