Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 579 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Fold | 16974546 | 1059 days ago | IN | 0 ETH | 0.00126075 | ||||
| Claim | 16576660 | 1114 days ago | IN | 0 ETH | 0.00142594 | ||||
| Claim | 15539217 | 1259 days ago | IN | 0 ETH | 0.00062451 | ||||
| Claim | 15522469 | 1262 days ago | IN | 0 ETH | 0.00040787 | ||||
| Claim | 15188085 | 1315 days ago | IN | 0 ETH | 0.00203839 | ||||
| Claim | 15032976 | 1340 days ago | IN | 0 ETH | 0.0009399 | ||||
| Claim | 15032967 | 1340 days ago | IN | 0 ETH | 0.00114535 | ||||
| Claim | 15012710 | 1343 days ago | IN | 0 ETH | 0.00083944 | ||||
| Claim | 15000771 | 1346 days ago | IN | 0 ETH | 0.00133388 | ||||
| Claim | 14998455 | 1346 days ago | IN | 0 ETH | 0.00112981 | ||||
| Claim | 14972482 | 1351 days ago | IN | 0 ETH | 0.00257656 | ||||
| Claim | 14779171 | 1383 days ago | IN | 0 ETH | 0.00132066 | ||||
| Claim | 14597013 | 1411 days ago | IN | 0 ETH | 0.00170501 | ||||
| Claim | 14587488 | 1413 days ago | IN | 0 ETH | 0.00191066 | ||||
| Claim | 14569949 | 1416 days ago | IN | 0 ETH | 0.00148692 | ||||
| Claim | 14512849 | 1424 days ago | IN | 0 ETH | 0.00268355 | ||||
| Claim | 14507057 | 1425 days ago | IN | 0 ETH | 0.00290564 | ||||
| Claim | 14452856 | 1434 days ago | IN | 0 ETH | 0.00262141 | ||||
| Claim | 14452841 | 1434 days ago | IN | 0 ETH | 0.0025206 | ||||
| Claim | 14452826 | 1434 days ago | IN | 0 ETH | 0.00295966 | ||||
| Claim | 14450523 | 1434 days ago | IN | 0 ETH | 0.00273299 | ||||
| Claim | 14450523 | 1434 days ago | IN | 0 ETH | 0.00510362 | ||||
| Claim | 14438948 | 1436 days ago | IN | 0 ETH | 0.00179466 | ||||
| Claim | 14353208 | 1449 days ago | IN | 0 ETH | 0.00201991 | ||||
| Claim | 14332843 | 1452 days ago | IN | 0 ETH | 0.00121353 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MerkleDistributor
Compiler Version
v0.6.11+commit.5ef660b1
Optimization Enabled:
No with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED
pragma solidity =0.6.11;
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;
address public owner;
uint public unlock;
// This is a packed array of booleans.
mapping(uint256 => uint256) private claimedBitMap;
constructor(address token_, bytes32 merkleRoot_) public {
token = token_;
merkleRoot = merkleRoot_;
owner = msg.sender;
unlock = block.timestamp + 365 days;
}
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 fold() public {
require(block.timestamp >= unlock, 'MerkleDistributor: Claim period has not passed.');
uint amount = IERC20(token).balanceOf(address(this));
require(IERC20(token).transfer(owner, amount));
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.6.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;
/**
* @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": false,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"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":[],"name":"fold","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":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c060405234801561001057600080fd5b50604051610b94380380610b948339818101604052604081101561003357600080fd5b8101908080519060200190929190805190602001909291905050508173ffffffffffffffffffffffffffffffffffffffff1660808173ffffffffffffffffffffffffffffffffffffffff1660601b815250508060a08181525050336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506301e133804201600181905550505060805160601c60a051610a7e6101166000398061035f52806105965250806103e45280610694528061076e528061087d5250610a7e6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c80639e34070f1161005b5780639e34070f14610197578063a69df4b5146101dd578063e684f46a146101fb578063fc0c546a146102055761007d565b80632e7ba6ef146100825780632eb4a7ab1461012f5780638da5cb5b1461014d575b600080fd5b61012d6004803603608081101561009857600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100e957600080fd5b8201836020820111156100fb57600080fd5b8035906020019184602083028401116401000000008311171561011d57600080fd5b909192939192939050505061024f565b005b610137610594565b6040518082815260200191505060405180910390f35b6101556105b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c3600480360360208110156101ad57600080fd5b81019080803590602001909291905050506105dd565b604051808215151515815260200191505060405180910390f35b6101e561062f565b6040518082815260200191505060405180910390f35b610203610635565b005b61020d61087b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610258856105dd565b156102ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806109ae6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019350505050604051602081830303815290604052805190602001209050610384838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f00000000000000000000000000000000000000000000000000000000000000008361089f565b6103d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806109d66021913960400191505060405180910390fd5b6103e286610957565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561048957600080fd5b505af115801561049d573d6000803e3d6000fd5b505050506040513d60208110156104b357600080fd5b8101908080519060200190929190505050610519576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806109f76023913960400191505060405180910390fd5b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008061010083816105eb57fe5b049050600061010084816105fb57fe5b0690506000600260008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b60015481565b600154421015610690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610a1a602f913960400191505060405180910390fd5b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561072f57600080fd5b505afa158015610743573d6000803e3d6000fd5b505050506040513d602081101561075957600080fd5b810190808051906020019092919050505090507f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561083457600080fd5b505af1158015610848573d6000803e3d6000fd5b505050506040513d602081101561085e57600080fd5b810190808051906020019092919050505061087857600080fd5b50565b7f000000000000000000000000000000000000000000000000000000000000000081565b60008082905060008090505b85518110156109495760008682815181106108c257fe5b60200260200101519050808311610909578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061093b565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5080806001019150506108ab565b508381149150509392505050565b6000610100828161096457fe5b0490506000610100838161097457fe5b069050806001901b600260008481526020019081526020016000205417600260008481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642e4d65726b6c654469737472696275746f723a20436c61696d20706572696f6420686173206e6f74207061737365642ea264697066735822122026477ea171f55b780499ce2ae9bca7132ac8bb52ecff9e5caf6f73bbc30ddba464736f6c634300060b0033000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de972045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d46
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80639e34070f1161005b5780639e34070f14610197578063a69df4b5146101dd578063e684f46a146101fb578063fc0c546a146102055761007d565b80632e7ba6ef146100825780632eb4a7ab1461012f5780638da5cb5b1461014d575b600080fd5b61012d6004803603608081101561009857600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156100e957600080fd5b8201836020820111156100fb57600080fd5b8035906020019184602083028401116401000000008311171561011d57600080fd5b909192939192939050505061024f565b005b610137610594565b6040518082815260200191505060405180910390f35b6101556105b8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101c3600480360360208110156101ad57600080fd5b81019080803590602001909291905050506105dd565b604051808215151515815260200191505060405180910390f35b6101e561062f565b6040518082815260200191505060405180910390f35b610203610635565b005b61020d61087b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610258856105dd565b156102ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260288152602001806109ae6028913960400191505060405180910390fd5b6000858585604051602001808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660601b81526014018281526020019350505050604051602081830303815290604052805190602001209050610384838380806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050507f72045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d468361089f565b6103d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806109d66021913960400191505060405180910390fd5b6103e286610957565b7f000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86866040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561048957600080fd5b505af115801561049d573d6000803e3d6000fd5b505050506040513d60208110156104b357600080fd5b8101908080519060200190929190505050610519576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806109f76023913960400191505060405180910390fd5b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed026868686604051808481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050505050565b7f72045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d4681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008061010083816105eb57fe5b049050600061010084816105fb57fe5b0690506000600260008481526020019081526020016000205490506000826001901b90508081831614945050505050919050565b60015481565b600154421015610690576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610a1a602f913960400191505060405180910390fd5b60007f000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561072f57600080fd5b505afa158015610743573d6000803e3d6000fd5b505050506040513d602081101561075957600080fd5b810190808051906020019092919050505090507f000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de973ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561083457600080fd5b505af1158015610848573d6000803e3d6000fd5b505050506040513d602081101561085e57600080fd5b810190808051906020019092919050505061087857600080fd5b50565b7f000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de981565b60008082905060008090505b85518110156109495760008682815181106108c257fe5b60200260200101519050808311610909578281604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120925061093b565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5080806001019150506108ab565b508381149150509392505050565b6000610100828161096457fe5b0490506000610100838161097457fe5b069050806001901b600260008481526020019081526020016000205417600260008481526020019081526020016000208190555050505056fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642e4d65726b6c654469737472696275746f723a20436c61696d20706572696f6420686173206e6f74207061737365642ea264697066735822122026477ea171f55b780499ce2ae9bca7132ac8bb52ecff9e5caf6f73bbc30ddba464736f6c634300060b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de972045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d46
-----Decoded View---------------
Arg [0] : token_ (address): 0xC477D038d5420C6A9e0b031712f61c5120090de9
Arg [1] : merkleRoot_ (bytes32): 0x72045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d46
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000c477d038d5420c6a9e0b031712f61c5120090de9
Arg [1] : 72045dcba594847f85f2981d35ebd069a3ce151b5e4cd3225a1a6a233fde8d46
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
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.