Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,147 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Accept Grant | 19530502 | 15 hrs ago | IN | 0 ETH | 0.00603306 | ||||
Accept Grant | 19530494 | 15 hrs ago | IN | 0 ETH | 0.00600529 | ||||
Accept Grant | 19530484 | 15 hrs ago | IN | 0 ETH | 0.00560306 | ||||
Accept Grant | 19529434 | 19 hrs ago | IN | 0 ETH | 0.00797363 | ||||
Accept Grant | 19527891 | 24 hrs ago | IN | 0 ETH | 0.01245536 | ||||
Accept Grant | 19527026 | 27 hrs ago | IN | 0 ETH | 0.01528627 | ||||
Accept Grant | 19525775 | 32 hrs ago | IN | 0 ETH | 0.00964394 | ||||
Accept Grant | 19525324 | 33 hrs ago | IN | 0 ETH | 0.00831742 | ||||
Accept Grant | 19524405 | 36 hrs ago | IN | 0 ETH | 0.00794803 | ||||
Accept Grant | 19524343 | 37 hrs ago | IN | 0 ETH | 0.00837965 | ||||
Accept Grant | 19524156 | 37 hrs ago | IN | 0 ETH | 0.00713017 | ||||
Accept Grant | 19524088 | 38 hrs ago | IN | 0 ETH | 0.00722789 | ||||
Accept Grant | 19524002 | 38 hrs ago | IN | 0 ETH | 0.00692408 | ||||
Accept Grant | 19523991 | 38 hrs ago | IN | 0 ETH | 0.00668773 | ||||
Accept Grant | 19523495 | 40 hrs ago | IN | 0 ETH | 0.00572178 | ||||
Accept Grant | 19523356 | 40 hrs ago | IN | 0 ETH | 0.00602028 | ||||
Accept Grant | 19523010 | 41 hrs ago | IN | 0 ETH | 0.00665665 | ||||
Accept Grant | 19522988 | 41 hrs ago | IN | 0 ETH | 0.00682626 | ||||
Accept Grant | 19522978 | 41 hrs ago | IN | 0 ETH | 0.00648593 | ||||
Accept Grant | 19521129 | 2 days ago | IN | 0 ETH | 0.01249456 | ||||
Accept Grant | 19516397 | 2 days ago | IN | 0 ETH | 0.0051627 | ||||
Accept Grant | 19516345 | 2 days ago | IN | 0 ETH | 0.00488954 | ||||
Accept Grant | 19511753 | 3 days ago | IN | 0 ETH | 0.00651021 | ||||
Accept Grant | 19511408 | 3 days ago | IN | 0 ETH | 0.00551355 | ||||
Accept Grant | 19510998 | 3 days ago | IN | 0 ETH | 0.00527958 |
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 Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-only // solhint-disable-next-line max-line-length // Adapted from https://github.com/Uniswap/merkle-distributor/blob/c3255bfa2b684594ecd562cacd7664b0f18330bf/contracts/MerkleDistributor.sol. pragma solidity 0.6.12; import "@openzeppelin/contracts/cryptography/MerkleProof.sol"; import "../interfaces/ICommunityRewards.sol"; import "../interfaces/IMerkleDistributor.sol"; contract MerkleDistributor is IMerkleDistributor { address public immutable override communityRewards; bytes32 public immutable override merkleRoot; // @dev This is a packed array of booleans. mapping(uint256 => uint256) private acceptedBitMap; constructor(address communityRewards_, bytes32 merkleRoot_) public { require(communityRewards_ != address(0), "Cannot use the null address"); require(merkleRoot_ != 0, "Invalid merkle root provided"); communityRewards = communityRewards_; merkleRoot = merkleRoot_; } function isGrantAccepted(uint256 index) public view override returns (bool) { uint256 acceptedWordIndex = index / 256; uint256 acceptedBitIndex = index % 256; uint256 acceptedWord = acceptedBitMap[acceptedWordIndex]; uint256 mask = (1 << acceptedBitIndex); return acceptedWord & mask == mask; } function _setGrantAccepted(uint256 index) private { uint256 acceptedWordIndex = index / 256; uint256 acceptedBitIndex = index % 256; acceptedBitMap[acceptedWordIndex] = acceptedBitMap[acceptedWordIndex] | (1 << acceptedBitIndex); } function acceptGrant( uint256 index, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval, bytes32[] calldata merkleProof ) external override { require(!isGrantAccepted(index), "Grant already accepted"); // Verify the merkle proof. // /// @dev Per the Warning in /// https://github.com/ethereum/solidity/blob/v0.6.12/docs/abi-spec.rst#non-standard-packed-mode, /// it is important that no more than one of the arguments to `abi.encodePacked()` here be a /// dynamic type (see definition in /// https://github.com/ethereum/solidity/blob/v0.6.12/docs/abi-spec.rst#formal-specification-of-the-encoding). bytes32 node = keccak256(abi.encodePacked(index, msg.sender, amount, vestingLength, cliffLength, vestingInterval)); require(MerkleProof.verify(merkleProof, merkleRoot, node), "Invalid proof"); // Mark it accepted and perform the granting. _setGrantAccepted(index); uint256 tokenId = ICommunityRewards(communityRewards).grant( msg.sender, amount, vestingLength, cliffLength, vestingInterval ); emit GrantAccepted(tokenId, index, msg.sender, amount, vestingLength, cliffLength, vestingInterval); } }
pragma solidity ^0.6.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
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); }
pragma solidity ^0.6.2; import "../../introspection/IERC165.sol"; /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of NFTs in ``owner``'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * Requirements: * - If the caller is not `from`, it must be approved to move this NFT by * either {approve} or {setApprovalForAll}. */ function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.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: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC721/IERC721.sol"; import "../interfaces/IERC20withDec.sol"; interface ICommunityRewards is IERC721 { function rewardsToken() external view returns (IERC20withDec); function claimableRewards(uint256 tokenId) external view returns (uint256 rewards); function totalVestedAt( uint256 start, uint256 end, uint256 granted, uint256 cliffLength, uint256 vestingInterval, uint256 revokedAt, uint256 time ) external pure returns (uint256 rewards); function grant( address recipient, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval ) external returns (uint256 tokenId); function loadRewards(uint256 rewards) external; function revokeGrant(uint256 tokenId) external; function getReward(uint256 tokenId) external; event RewardAdded(uint256 reward); event Granted( address indexed user, uint256 indexed tokenId, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval ); event GrantRevoked(uint256 indexed tokenId, uint256 totalUnvested); event RewardPaid(address indexed user, uint256 indexed tokenId, uint256 reward); }
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-ethereum-package/contracts/token/ERC20/IERC20.sol"; /* Only addition is the `decimals` function, which we need, and which both our Fidu and USDC use, along with most ERC20's. */ /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20withDec is IERC20 { /** * @dev Returns the number of decimals used for the token */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: GPL-3.0-only // solhint-disable-next-line max-line-length // Adapted from https://github.com/Uniswap/merkle-distributor/blob/c3255bfa2b684594ecd562cacd7664b0f18330bf/contracts/interfaces/IMerkleDistributor.sol. pragma solidity 0.6.12; /// @notice Enables the granting of a CommunityRewards grant, if the grant details exist in this /// contract's Merkle root. interface IMerkleDistributor { /// @notice Returns the address of the CommunityRewards contract whose grants are distributed by this contract. function communityRewards() external view returns (address); /// @notice Returns the merkle root of the merkle tree containing grant details available to accept. function merkleRoot() external view returns (bytes32); /// @notice Returns true if the index has been marked accepted. function isGrantAccepted(uint256 index) external view returns (bool); /// @notice Causes the sender to accept the grant consisting of the given details. Reverts if /// the inputs (which includes who the sender is) are invalid. function acceptGrant( uint256 index, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval, bytes32[] calldata merkleProof ) external; /// @notice This event is triggered whenever a call to #acceptGrant succeeds. event GrantAccepted( uint256 indexed tokenId, uint256 indexed index, address indexed account, uint256 amount, uint256 vestingLength, uint256 cliffLength, uint256 vestingInterval ); }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 100 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"communityRewards_","type":"address"},{"internalType":"bytes32","name":"merkleRoot_","type":"bytes32"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vestingLength","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"cliffLength","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vestingInterval","type":"uint256"}],"name":"GrantAccepted","type":"event"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"vestingLength","type":"uint256"},{"internalType":"uint256","name":"cliffLength","type":"uint256"},{"internalType":"uint256","name":"vestingInterval","type":"uint256"},{"internalType":"bytes32[]","name":"merkleProof","type":"bytes32[]"}],"name":"acceptGrant","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"communityRewards","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"isGrantAccepted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"merkleRoot","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b5060405161064c38038061064c8339818101604052604081101561003357600080fd5b5080516020909101516001600160a01b038216610097576040805162461bcd60e51b815260206004820152601b60248201527f43616e6e6f742075736520746865206e756c6c20616464726573730000000000604482015290519081900360640190fd5b806100e9576040805162461bcd60e51b815260206004820152601c60248201527f496e76616c6964206d65726b6c6520726f6f742070726f766964656400000000604482015290519081900360640190fd5b606082901b6001600160601b03191660805260a08190526001600160a01b0390911690610519610133600039806101775280610290525080610153528061034452506105196000f3fe608060405234801561001057600080fd5b506004361061004c5760003560e01c8063193ce1e4146100515780632eb4a7ab1461007557806338dcb4f01461008f578063f67000d1146100c0575b600080fd5b610059610151565b604080516001600160a01b039092168252519081900360200190f35b61007d610175565b60408051918252519081900360200190f35b6100ac600480360360208110156100a557600080fd5b5035610199565b604080519115158252519081900360200190f35b61014f600480360360c08110156100d657600080fd5b8135916020810135916040820135916060810135916080820135919081019060c0810160a082013564010000000081111561011057600080fd5b82018360208201111561012257600080fd5b8035906020019184602083028401116401000000008311171561014457600080fd5b5090925090506101bf565b005b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b6101c887610199565b15610213576040805162461bcd60e51b815260206004820152601660248201527511dc985b9d08185b1c9958591e481858d8d95c1d195960521b604482015290519081900360640190fd5b6040805160208082018a90523360601b8284015260548201899052607482018890526094820187905260b48083018790528351808403909101815260d4830180855281519183019190912060f49286028085018401909552858252936102bb939192879287928392909101908490808284376000920191909152507f000000000000000000000000000000000000000000000000000000000000000092508591506104139050565b6102fc576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b604482015290519081900360640190fd5b610305886104bc565b60408051630633936560e21b81523360048201526024810189905260448101889052606481018790526084810186905290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916318ce4d949160a48082019260209290919082900301818787803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b505050506040513d60208110156103b657600080fd5b5051604080518a8152602081018a905280820189905260608101889052905191925033918b9184917f862fb6a8214c1a74401b07287b99c56ae4b4c6070977d74ab79744bb5bac24fa9181900360800190a4505050505050505050565b600081815b85518110156104b157600086828151811061042f57fe5b6020026020010151905080831161047657828160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092506104a8565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610418565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fea2646970667358221220bc2179087000f9decb0361cc44302daef3ccb9d27cd4920ec2cf8ec0a5ff142164736f6c634300060c00330000000000000000000000000cd73c18c085deb287257ed2307ec713e9af3460926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c5
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c8063193ce1e4146100515780632eb4a7ab1461007557806338dcb4f01461008f578063f67000d1146100c0575b600080fd5b610059610151565b604080516001600160a01b039092168252519081900360200190f35b61007d610175565b60408051918252519081900360200190f35b6100ac600480360360208110156100a557600080fd5b5035610199565b604080519115158252519081900360200190f35b61014f600480360360c08110156100d657600080fd5b8135916020810135916040820135916060810135916080820135919081019060c0810160a082013564010000000081111561011057600080fd5b82018360208201111561012257600080fd5b8035906020019184602083028401116401000000008311171561014457600080fd5b5090925090506101bf565b005b7f0000000000000000000000000cd73c18c085deb287257ed2307ec713e9af346081565b7f926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c581565b6101008104600090815260208190526040902054600160ff9092169190911b9081161490565b6101c887610199565b15610213576040805162461bcd60e51b815260206004820152601660248201527511dc985b9d08185b1c9958591e481858d8d95c1d195960521b604482015290519081900360640190fd5b6040805160208082018a90523360601b8284015260548201899052607482018890526094820187905260b48083018790528351808403909101815260d4830180855281519183019190912060f49286028085018401909552858252936102bb939192879287928392909101908490808284376000920191909152507f926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c592508591506104139050565b6102fc576040805162461bcd60e51b815260206004820152600d60248201526c24b73b30b634b210383937b7b360991b604482015290519081900360640190fd5b610305886104bc565b60408051630633936560e21b81523360048201526024810189905260448101889052606481018790526084810186905290516000916001600160a01b037f0000000000000000000000000cd73c18c085deb287257ed2307ec713e9af346016916318ce4d949160a48082019260209290919082900301818787803b15801561038c57600080fd5b505af11580156103a0573d6000803e3d6000fd5b505050506040513d60208110156103b657600080fd5b5051604080518a8152602081018a905280820189905260608101889052905191925033918b9184917f862fb6a8214c1a74401b07287b99c56ae4b4c6070977d74ab79744bb5bac24fa9181900360800190a4505050505050505050565b600081815b85518110156104b157600086828151811061042f57fe5b6020026020010151905080831161047657828160405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092506104a8565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610418565b509092149392505050565b610100810460009081526020819052604090208054600160ff9093169290921b909117905556fea2646970667358221220bc2179087000f9decb0361cc44302daef3ccb9d27cd4920ec2cf8ec0a5ff142164736f6c634300060c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000cd73c18c085deb287257ed2307ec713e9af3460926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c5
-----Decoded View---------------
Arg [0] : communityRewards_ (address): 0x0Cd73c18C085dEB287257ED2307eC713e9Af3460
Arg [1] : merkleRoot_ (bytes32): 0x926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c5
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000000cd73c18c085deb287257ed2307ec713e9af3460
Arg [1] : 926446af7200bedeab4755e62ef8d73ac9409bde8e84d5e64a4677690cc9d9c5
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 24 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.