ETH Price: $2,415.09 (-0.25%)

Contract

0x786fed81fC9602A647B11A02fCFD65AB081dEE34
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Claim112439772020-11-12 16:53:251402 days ago1605200005IN
0x786fed81...B081dEE34
0 ETH0.0004590314
Claim112361562020-11-11 11:53:291403 days ago1605095609IN
0x786fed81...B081dEE34
0 ETH0.0007810412
Claim112189792020-11-08 20:34:551406 days ago1604867695IN
0x786fed81...B081dEE34
0 ETH0.0004688614.3
Claim112149902020-11-08 5:53:131407 days ago1604814793IN
0x786fed81...B081dEE34
0 ETH0.0006007812
Claim111955582020-11-05 6:26:151410 days ago1604557575IN
0x786fed81...B081dEE34
0 ETH0.0005907912
Claim111937072020-11-04 23:30:321410 days ago1604532632IN
0x786fed81...B081dEE34
0 ETH0.0009443714.5
Claim111937072020-11-04 23:30:321410 days ago1604532632IN
0x786fed81...B081dEE34
0 ETH0.000911814
Claim111937072020-11-04 23:30:321410 days ago1604532632IN
0x786fed81...B081dEE34
0 ETH0.0007815412
Claim111863262020-11-03 20:22:451411 days ago1604434965IN
0x786fed81...B081dEE34
0 ETH0.0004916415
Claim111804272020-11-02 22:40:351412 days ago1604356835IN
0x786fed81...B081dEE34
0 ETH0.0006510213
Claim111790332020-11-02 17:27:301412 days ago1604338050IN
0x786fed81...B081dEE34
0 ETH0.0005045615.4
Claim111740462020-11-01 22:58:111413 days ago1604271491IN
0x786fed81...B081dEE34
0 ETH0.001001520
Claim111724602020-11-01 17:11:301413 days ago1604250690IN
0x786fed81...B081dEE34
0 ETH0.0005242216.00000145
Claim111724602020-11-01 17:11:301413 days ago1604250690IN
0x786fed81...B081dEE34
0 ETH0.0005242216
Claim111724602020-11-01 17:11:301413 days ago1604250690IN
0x786fed81...B081dEE34
0 ETH0.0005045615.4000016
Claim111723752020-11-01 16:53:201413 days ago1604249600IN
0x786fed81...B081dEE34
0 ETH0.0015368630.69
Claim111719442020-11-01 15:13:251413 days ago1604243605IN
0x786fed81...B081dEE34
0 ETH0.0008458113.00000145
Claim111714652020-11-01 13:27:321413 days ago1604237252IN
0x786fed81...B081dEE34
0 ETH0.0010520321.00000145
Claim111714652020-11-01 13:27:321413 days ago1604237252IN
0x786fed81...B081dEE34
0 ETH0.0010069420.1
Claim111714292020-11-01 13:19:461413 days ago1604236786IN
0x786fed81...B081dEE34
0 ETH0.00652197130
Claim111714162020-11-01 13:17:271413 days ago1604236647IN
0x786fed81...B081dEE34
0 ETH0.0011538823
Transfer111713492020-11-01 13:02:331413 days ago1604235753IN
0x786fed81...B081dEE34
0 ETH0.00039919
Claim111713282020-11-01 12:57:301413 days ago1604235450IN
0x786fed81...B081dEE34
0 ETH0.001075421.5
Claim111713042020-11-01 12:52:191413 days ago1604235139IN
0x786fed81...B081dEE34
0 ETH0.0012186624.3
Claim111712952020-11-01 12:50:361413 days ago1604235036IN
0x786fed81...B081dEE34
0 ETH0.0007016614
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.6.12+commit.27d51765

Optimization Enabled:
Yes with 999 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2020-10-31
*/

// File: @openzeppelin\contracts\token\ERC20\IERC20.sol

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

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

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

// File: contracts\MerkleDistributor.sol

pragma solidity 0.6.12;

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

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

60c060405234801561001057600080fd5b506040516106123803806106128339818101604052604081101561003357600080fd5b508051602090910151606082901b6001600160601b03191660805260a08190526001600160a01b039091169061058c6100866000398061020f52806103ae52508061028052806103f8525061058c6000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100df5780639e34070f146100f9578063fc0c546a1461012a575b600080fd5b6100dd6004803603608081101561006757600080fd5b8135916001600160a01b03602082013516916040820135919081019060808101606082013564010000000081111561009e57600080fd5b8201836020820111156100b057600080fd5b803590602001918460208302840111640100000000831117156100d257600080fd5b50909250905061014e565b005b6100e76103ac565b60408051918252519081900360200190f35b6101166004803603602081101561010f57600080fd5b50356103d0565b604080519115158252519081900360200190f35b6101326103f6565b604080516001600160a01b039092168252519081900360200190f35b610157856103d0565b156101935760405162461bcd60e51b81526004018080602001828103825260288152602001806104eb6028913960400191505060405180910390fd5b600085858560405160200180848152602001836001600160a01b031660601b8152601401828152602001935050505060405160208183030381529060405280519060200120905061023a8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f0000000000000000000000000000000000000000000000000000000000000000925085915061041a9050565b6102755760405162461bcd60e51b81526004018080602001828103825260218152602001806105136021913960400191505060405180910390fd5b61027e866104c3565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb86866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156102f557600080fd5b505af1158015610309573d6000803e3d6000fd5b505050506040513d602081101561031f57600080fd5b505161035c5760405162461bcd60e51b81526004018080602001828103825260238152602001806105346023913960400191505060405180910390fd5b604080518781526001600160a01b038716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b7f000000000000000000000000000000000000000000000000000000000000000081565b600081815b85518110156104b857600086828151811061043657fe5b6020026020010151905080831161047d57828160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092506104af565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161041f565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea26469706673582212200bc22750f8b8e20cb35b84efec14b92b750788a28849da6ffa78648c97fa223d64736f6c634300060c0033000000000000000000000000b78b3320493a4efaa1028130c5ba26f0b6085ef873b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc90

Deployed Bytecode

0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80632e7ba6ef146100515780632eb4a7ab146100df5780639e34070f146100f9578063fc0c546a1461012a575b600080fd5b6100dd6004803603608081101561006757600080fd5b8135916001600160a01b03602082013516916040820135919081019060808101606082013564010000000081111561009e57600080fd5b8201836020820111156100b057600080fd5b803590602001918460208302840111640100000000831117156100d257600080fd5b50909250905061014e565b005b6100e76103ac565b60408051918252519081900360200190f35b6101166004803603602081101561010f57600080fd5b50356103d0565b604080519115158252519081900360200190f35b6101326103f6565b604080516001600160a01b039092168252519081900360200190f35b610157856103d0565b156101935760405162461bcd60e51b81526004018080602001828103825260288152602001806104eb6028913960400191505060405180910390fd5b600085858560405160200180848152602001836001600160a01b031660601b8152601401828152602001935050505060405160208183030381529060405280519060200120905061023a8383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f73b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc90925085915061041a9050565b6102755760405162461bcd60e51b81526004018080602001828103825260218152602001806105136021913960400191505060405180910390fd5b61027e866104c3565b7f000000000000000000000000b78b3320493a4efaa1028130c5ba26f0b6085ef86001600160a01b031663a9059cbb86866040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156102f557600080fd5b505af1158015610309573d6000803e3d6000fd5b505050506040513d602081101561031f57600080fd5b505161035c5760405162461bcd60e51b81526004018080602001828103825260238152602001806105346023913960400191505060405180910390fd5b604080518781526001600160a01b038716602082015280820186905290517f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed0269181900360600190a1505050505050565b7f73b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc9081565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b7f000000000000000000000000b78b3320493a4efaa1028130c5ba26f0b6085ef881565b600081815b85518110156104b857600086828151811061043657fe5b6020026020010151905080831161047d57828160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092506104af565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b5060010161041f565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fe4d65726b6c654469737472696275746f723a2044726f7020616c726561647920636c61696d65642e4d65726b6c654469737472696275746f723a20496e76616c69642070726f6f662e4d65726b6c654469737472696275746f723a205472616e73666572206661696c65642ea26469706673582212200bc22750f8b8e20cb35b84efec14b92b750788a28849da6ffa78648c97fa223d64736f6c634300060c0033

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

000000000000000000000000b78b3320493a4efaa1028130c5ba26f0b6085ef873b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc90

-----Decoded View---------------
Arg [0] : token_ (address): 0xb78B3320493a4EFaa1028130C5Ba26f0B6085Ef8
Arg [1] : merkleRoot_ (bytes32): 0x73b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc90

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000b78b3320493a4efaa1028130c5ba26f0b6085ef8
Arg [1] : 73b5e29ac01a492cc4b4ac2729b2105571cf30a30009886ed366733264d9fc90


Deployed Bytecode Sourcemap

5199:1639:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6185:650;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;6185:650:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6185:650:0;;-1:-1:-1;6185:650:0;-1:-1:-1;6185:650:0;:::i;:::-;;5301:44;;;:::i;:::-;;;;;;;;;;;;;;;;5588:331;;;;;;;;;;;;;;;;-1:-1:-1;5588:331:0;;:::i;:::-;;;;;;;;;;;;;;;;;;5255:39;;;:::i;:::-;;;;-1:-1:-1;;;;;5255:39:0;;;;;;;;;;;;;;6185:650;6318:16;6328:5;6318:9;:16::i;:::-;6317:17;6309:70;;;;-1:-1:-1;;;6309:70:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6429:12;6471:5;6478:7;6487:6;6454:40;;;;;;;;;;;-1:-1:-1;;;;;6454:40:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6444:51;;;;;;6429:66;;6514:49;6533:11;;6514:49;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6546:10:0;;-1:-1:-1;6558:4:0;;-1:-1:-1;6514:18:0;;-1:-1:-1;6514:49:0:i;:::-;6506:95;;;;-1:-1:-1;;;6506:95:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6662:18;6674:5;6662:11;:18::i;:::-;6706:5;-1:-1:-1;;;;;6699:22:0;;6722:7;6731:6;6699:39;;;;;;;;;;;;;-1:-1:-1;;;;;6699:39:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6699:39:0;6691:87;;;;-1:-1:-1;;;6691:87:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6796:31;;;;;;-1:-1:-1;;;;;6796:31:0;;;;;;;;;;;;;;;;;;;;;;;6185:650;;;;;;:::o;5301:44::-;;;:::o;5588:331::-;5704:3;5696:11;;5652:4;5788:31;;;;;;;;;;;5846:1;5744:11;;;;5846:20;;;;5885:18;;;:26;;5588:331::o;5255:39::-;;;:::o;3375:796::-;3466:4;3506;3466;3523:525;3547:5;:12;3543:1;:16;3523:525;;;3581:20;3604:5;3610:1;3604:8;;;;;;;;;;;;;;3581:31;;3649:12;3633;:28;3629:408;;3803:12;3817;3786:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3776:55;;;;;;3761:70;;3629:408;;;3993:12;4007;3976:44;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3966:55;;;;;;3951:70;;3629:408;-1:-1:-1;3561:3:0;;3523:525;;;-1:-1:-1;4143:20:0;;;;3375:796;-1:-1:-1;;;3375:796:0:o;5927:250::-;6017:3;6009:11;;5982:24;6113:31;;;;;;;;;;;;6148:1;6057:11;;;;6148:20;;;;6113:56;;;6079:90;;5927:250::o

Swarm Source

ipfs://0bc22750f8b8e20cb35b84efec14b92b750788a28849da6ffa78648c97fa223d

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

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