ETH Price: $1,585.27 (-0.30%)
Gas: 21 Gwei
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Token Holdings

Sponsored

Transaction Hash
Method
Block
From
To
Value
Claim131301612021-08-31 0:39:35755 days 20 hrs ago1630370375IN
0x363c42...6bE350E4
0 ETH0.0046334663
Claim130127262021-08-12 21:10:37774 days 1 min ago1628802637IN
0x363c42...6bE350E4
0 ETH0.0033101545
Claim130127152021-08-12 21:08:57774 days 3 mins ago1628802537IN
0x363c42...6bE350E4
0 ETH0.003309745
Claim129935432021-08-09 22:01:23776 days 23 hrs ago1628546483IN
0x363c42...6bE350E4
0 ETH0.003793351.57526497
Claim128682622021-07-21 6:40:42796 days 14 hrs ago1626849642IN
0x363c42...6bE350E4
0 ETH0.0008720112.00000145
Claim128681562021-07-21 6:19:29796 days 14 hrs ago1626848369IN
0x363c42...6bE350E4
0 ETH0.0009389512.765
Claim128300222021-07-15 6:47:29802 days 14 hrs ago1626331649IN
0x363c42...6bE350E4
0 ETH0.0013904118.9
Claim128300222021-07-15 6:47:29802 days 14 hrs ago1626331649IN
0x363c42...6bE350E4
0 ETH0.0013902218.9
Claim128296772021-07-15 5:31:37802 days 15 hrs ago1626327097IN
0x363c42...6bE350E4
0 ETH0.0016921323
Claim127641372021-07-04 23:53:16812 days 21 hrs ago1625442796IN
0x363c42...6bE350E4
0 ETH0.000607858
Claim127622372021-07-04 16:55:22813 days 4 hrs ago1625417722IN
0x363c42...6bE350E4
0 ETH0.0012916917
Claim127617142021-07-04 15:00:38813 days 6 hrs ago1625410838IN
0x363c42...6bE350E4
0 ETH0.0012164416
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000515476.78374999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000515536.78374999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000515456.78374999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000534537.03499999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000534427.03499999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000534497.03499999
Claim127009852021-06-25 3:49:54822 days 17 hrs ago1624592994IN
0x363c42...6bE350E4
0 ETH0.000534687.03499999
Claim127009582021-06-25 3:42:22822 days 17 hrs ago1624592542IN
0x363c42...6bE350E4
0 ETH0.000754910.04999999
Claim126982462021-06-24 17:47:31823 days 3 hrs ago1624556851IN
0x363c42...6bE350E4
0 ETH0.000916712.05999999
Claim126783822021-06-21 15:16:53826 days 5 hrs ago1624288613IN
0x363c42...6bE350E4
0 ETH0.0029373339.6
Claim126730542021-06-20 19:16:34827 days 1 hr ago1624216594IN
0x363c42...6bE350E4
0 ETH0.0024435832.15999999
Claim126729042021-06-20 18:49:22827 days 2 hrs ago1624214962IN
0x363c42...6bE350E4
0 ETH0.000534777.03499999
Claim126727922021-06-20 18:25:46827 days 2 hrs ago1624213546IN
0x363c42...6bE350E4
0 ETH0.000458266.02999999
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MerkleDistributor

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 800 runs

Other Settings:
default evmVersion
File 1 of 3 : MerkleDistributor.sol
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/cryptography/MerkleProof.sol";

contract MerkleDistributor {

    event Claimed(uint256 index, address account, uint256 amount);

    address public immutable token;
    bytes32 public immutable merkleRoot;

    // This is a packed array of booleans.
    mapping(uint256 => uint256) private claimedBitMap;

    constructor(address token_, bytes32 merkleRoot_) {
        token = token_;
        merkleRoot = merkleRoot_;
    }

    // Returns true if the index has been marked claimed.
    function isClaimed(uint256 index) public view 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);
    }

    // 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 {
        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);
    }
}

File 2 of 3 : IERC20.sol
// 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);
}

File 3 of 3 : MerkleProof.sol
// 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;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 800
  },
  "metadata": {
    "bytecodeHash": "none"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"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"}]

60c060405234801561001057600080fd5b5060405161071a38038061071a83398101604081905261002f9161004a565b60609190911b6001600160601b03191660805260a052610082565b6000806040838503121561005c578182fd5b82516001600160a01b0381168114610072578283fd5b6020939093015192949293505050565b60805160601c60a0516106646100b660003960008181606b015261020301526000818160c801526102b301526106646000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100665780639e34070f146100a0578063fc0c546a146100c3575b600080fd5b61006461005f366004610553565b610102565b005b61008d7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b6100b36100ae36600461053b565b6103d8565b6040519015158152602001610097565b6100ea7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610097565b61010b856103d8565b156101835760405162461bcd60e51b815260206004820152602860248201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060448201527f636c61696d65642e00000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60408051602081018790526bffffffffffffffffffffffff19606087901b16918101919091526054810184905260009060740160405160208183030381529060405280519060200120905061022e8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f000000000000000000000000000000000000000000000000000000000000000092508591506104199050565b6102845760405162461bcd60e51b815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f666044820152601760f91b606482015260840161017a565b61028d866104d6565b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018690527f0000000000000000000000000000000000000000000000000000000000000000169063a9059cbb90604401602060405180830381600087803b1580156102f757600080fd5b505af115801561030b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032f9190610514565b6103875760405162461bcd60e51b815260206004820152602360248201527f4d65726b6c654469737472696275746f723a205472616e73666572206661696c60448201526232b21760e91b606482015260840161017a565b604080518781526001600160a01b03871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b6000806103e7610100846105f2565b905060006103f76101008561062d565b60009283526020839052604090922054600190921b9182169091149392505050565b600081815b85518110156104cb57600086828151811061044957634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161048b5760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506104b8565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806104c381610606565b91505061041e565b509092149392505050565b60006104e4610100836105f2565b905060006104f46101008461062d565b6000928352602083905260409092208054600190931b9092179091555050565b600060208284031215610525578081fd5b81518015158114610534578182fd5b9392505050565b60006020828403121561054c578081fd5b5035919050565b60008060008060006080868803121561056a578081fd5b8535945060208601356001600160a01b0381168114610587578182fd5b935060408601359250606086013567ffffffffffffffff808211156105aa578283fd5b818801915088601f8301126105bd578283fd5b8135818111156105cb578384fd5b8960208260051b85010111156105df578384fd5b9699959850939650602001949392505050565b60008261060157610601610641565b500490565b600060001982141561062657634e487b7160e01b81526011600452602481fd5b5060010190565b60008261063c5761063c610641565b500690565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000804000a000000000000000000000000a10ee8a7bfa188e762a7bc7169512222a621fab4d63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100665780639e34070f146100a0578063fc0c546a146100c3575b600080fd5b61006461005f366004610553565b610102565b005b61008d7fd63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b81565b6040519081526020015b60405180910390f35b6100b36100ae36600461053b565b6103d8565b6040519015158152602001610097565b6100ea7f000000000000000000000000a10ee8a7bfa188e762a7bc7169512222a621fab481565b6040516001600160a01b039091168152602001610097565b61010b856103d8565b156101835760405162461bcd60e51b815260206004820152602860248201527f4d65726b6c654469737472696275746f723a2044726f7020616c72656164792060448201527f636c61696d65642e00000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b60408051602081018790526bffffffffffffffffffffffff19606087901b16918101919091526054810184905260009060740160405160208183030381529060405280519060200120905061022e8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507fd63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b92508591506104199050565b6102845760405162461bcd60e51b815260206004820152602160248201527f4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f666044820152601760f91b606482015260840161017a565b61028d866104d6565b60405163a9059cbb60e01b81526001600160a01b038681166004830152602482018690527f000000000000000000000000a10ee8a7bfa188e762a7bc7169512222a621fab4169063a9059cbb90604401602060405180830381600087803b1580156102f757600080fd5b505af115801561030b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032f9190610514565b6103875760405162461bcd60e51b815260206004820152602360248201527f4d65726b6c654469737472696275746f723a205472616e73666572206661696c60448201526232b21760e91b606482015260840161017a565b604080518781526001600160a01b03871660208201529081018590527f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269060600160405180910390a1505050505050565b6000806103e7610100846105f2565b905060006103f76101008561062d565b60009283526020839052604090922054600190921b9182169091149392505050565b600081815b85518110156104cb57600086828151811061044957634e487b7160e01b600052603260045260246000fd5b6020026020010151905080831161048b5760408051602081018590529081018290526060016040516020818303038152906040528051906020012092506104b8565b60408051602081018390529081018490526060016040516020818303038152906040528051906020012092505b50806104c381610606565b91505061041e565b509092149392505050565b60006104e4610100836105f2565b905060006104f46101008461062d565b6000928352602083905260409092208054600190931b9092179091555050565b600060208284031215610525578081fd5b81518015158114610534578182fd5b9392505050565b60006020828403121561054c578081fd5b5035919050565b60008060008060006080868803121561056a578081fd5b8535945060208601356001600160a01b0381168114610587578182fd5b935060408601359250606086013567ffffffffffffffff808211156105aa578283fd5b818801915088601f8301126105bd578283fd5b8135818111156105cb578384fd5b8960208260051b85010111156105df578384fd5b9699959850939650602001949392505050565b60008261060157610601610641565b500490565b600060001982141561062657634e487b7160e01b81526011600452602481fd5b5060010190565b60008261063c5761063c610641565b500690565b634e487b7160e01b600052601260045260246000fdfea164736f6c6343000804000a

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a10ee8a7bfa188e762a7bc7169512222a621fab4d63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b

-----Decoded View---------------
Arg [0] : token_ (address): 0xa10Ee8A7bFA188E762a7bc7169512222a621Fab4
Arg [1] : merkleRoot_ (bytes32): 0xd63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000a10ee8a7bfa188e762a7bc7169512222a621fab4
Arg [1] : d63388cb1525fedac38743e5ff456904a94a1f43e28da6c9cfdb364e786b934b


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

Validator Index Block Amount
View All Withdrawals

Txn Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.