Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 25 from a total of 454 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Drop | 7688596 | 2362 days ago | IN | 0 ETH | 0.0014164 | ||||
Drop | 7688547 | 2362 days ago | IN | 0 ETH | 0.00286062 | ||||
Drop | 7687722 | 2362 days ago | IN | 0 ETH | 0.00286238 | ||||
Drop | 7649330 | 2368 days ago | IN | 0 ETH | 0.00285877 | ||||
Drop | 7630945 | 2371 days ago | IN | 0 ETH | 0.0002729 | ||||
Drop | 7590235 | 2377 days ago | IN | 0 ETH | 0.00095436 | ||||
Drop | 7533583 | 2386 days ago | IN | 0 ETH | 0.00010097 | ||||
Drop | 7533576 | 2386 days ago | IN | 0 ETH | 0.00010097 | ||||
Drop | 7533573 | 2386 days ago | IN | 0 ETH | 0.00020413 | ||||
Drop | 7528624 | 2387 days ago | IN | 0 ETH | 0.00286423 | ||||
Drop | 7522085 | 2388 days ago | IN | 0 ETH | 0.00286259 | ||||
Drop | 7513705 | 2389 days ago | IN | 0 ETH | 0.00286578 | ||||
Drop | 7497017 | 2391 days ago | IN | 0 ETH | 0.0014159 | ||||
Drop | 7497014 | 2391 days ago | IN | 0 ETH | 0.00286011 | ||||
Drop | 7495778 | 2392 days ago | IN | 0 ETH | 0.00068088 | ||||
Drop | 7490074 | 2393 days ago | IN | 0 ETH | 0.00108976 | ||||
Drop | 7481957 | 2394 days ago | IN | 0 ETH | 0.00286154 | ||||
Drop | 7481333 | 2394 days ago | IN | 0 ETH | 0.00027246 | ||||
Drop | 7479782 | 2394 days ago | IN | 0 ETH | 0.00027264 | ||||
Drop | 7479763 | 2394 days ago | IN | 0 ETH | 0.00027207 | ||||
Drop | 7479754 | 2394 days ago | IN | 0 ETH | 0.00027273 | ||||
Drop | 7479738 | 2394 days ago | IN | 0 ETH | 0.00025885 | ||||
Drop | 7479703 | 2394 days ago | IN | 0 ETH | 0.00027248 | ||||
Drop | 7479687 | 2394 days ago | IN | 0 ETH | 0.00027258 | ||||
Drop | 7479663 | 2394 days ago | IN | 0 ETH | 0.0002726 |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
MerkleProofAirdrop
Compiler Version
v0.5.4+commit.9549d8ff
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-03-01 */ pragma solidity ^0.5.0; /** * @title MerkleProof * @dev Merkle proof verification based on * https://github.com/ameensol/merkle-tree-solidity/blob/master/src/MerkleProof.sol */ library MerkleProof { /** * @dev Verifies a Merkle proof proving the existence of a leaf in a Merkle tree. Assumes that each pair of leaves * and each pair of pre-images are sorted. * @param proof Merkle proof containing sibling hashes on the branch from the leaf to the root of the Merkle tree * @param root Merkle root * @param leaf Leaf of Merkle tree */ 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; } } interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transferFrom(address from, address to, uint256 value) external returns (bool); } /** * @title MerkleProof * @dev Merkle proof verification based on * https://github.com/ameensol/merkle-tree-solidity/blob/master/src/MerkleProof.sol */ contract MerkleProofAirdrop { event Drop(string ipfs, address indexed rec, uint amount); struct Airdrop { address owner; bytes32 root; address tokenAddress; uint total; uint claimed; mapping(address => bool) claimedRecipients; } mapping(bytes32 => Airdrop) public airdrops; address payable public owner; constructor(address payable _owner) public { owner = _owner; } function createNewAirdrop( bytes32 _root, address _tokenAddress, uint _total, string memory _ipfs ) public payable { require(msg.value >= 0.2 ether); bytes32 ipfsHash = keccak256(abi.encodePacked(_ipfs)); IERC20 token = IERC20(_tokenAddress); require(token.allowance(msg.sender, address(this)) >= _total, "this contract must be allowed to spend tokens"); airdrops[ipfsHash] = Airdrop({ owner: msg.sender, root: _root, tokenAddress: _tokenAddress, total: _total, claimed: 0 }); owner.transfer(address(this).balance); } function cancelAirdrop(string memory _ipfs) public { bytes32 ipfsHash = keccak256(abi.encodePacked(_ipfs)); Airdrop storage airdrop = airdrops[ipfsHash]; require(msg.sender == airdrop.owner); uint left = airdrop.total - airdrop.claimed; require(left > 0); IERC20 token = IERC20(airdrop.tokenAddress); require(token.balanceOf(address(this)) >= left, "not enough tokens"); token.transfer(msg.sender, left); } function drop(bytes32[] memory proof, address _recipient, uint256 _amount, string memory _ipfs) public { bytes32 hash = keccak256(abi.encode(_recipient, _amount)); bytes32 leaf = keccak256(abi.encode(hash)); bytes32 ipfsHash = keccak256(abi.encodePacked(_ipfs)); Airdrop storage airdrop = airdrops[ipfsHash]; require(verify(proof, airdrop.root, leaf)); require(airdrop.claimedRecipients[_recipient] == false, "double spend"); airdrop.claimedRecipients[_recipient] = true; airdrop.claimed += _amount; IERC20 token = IERC20(airdrop.tokenAddress); require(token.allowance(airdrop.owner, address(this)) >= _amount, "this contract must be allowed to spend tokens"); token.transferFrom(airdrop.owner, _recipient, _amount); // transfer tokens emit Drop(_ipfs, _recipient, _amount); } function verify( bytes32[] memory proof, bytes32 root, bytes32 leaf ) public pure returns (bool) { return MerkleProof.verify(proof, root, leaf); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"constant":false,"inputs":[{"name":"_root","type":"bytes32"},{"name":"_tokenAddress","type":"address"},{"name":"_total","type":"uint256"},{"name":"_ipfs","type":"string"}],"name":"createNewAirdrop","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_ipfs","type":"string"}],"name":"cancelAirdrop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"proof","type":"bytes32[]"},{"name":"root","type":"bytes32"},{"name":"leaf","type":"bytes32"}],"name":"verify","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"proof","type":"bytes32[]"},{"name":"_recipient","type":"address"},{"name":"_amount","type":"uint256"},{"name":"_ipfs","type":"string"}],"name":"drop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"bytes32"}],"name":"airdrops","outputs":[{"name":"owner","type":"address"},{"name":"root","type":"bytes32"},{"name":"tokenAddress","type":"address"},{"name":"total","type":"uint256"},{"name":"claimed","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_owner","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"ipfs","type":"string"},{"indexed":true,"name":"rec","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Drop","type":"event"}]
Contract Creation Code
608060405234801561001057600080fd5b50604051602080610e778339810180604052602081101561003057600080fd5b505160018054600160a060020a031916600160a060020a03909216919091179055610e17806100606000396000f3fe608060405260043610610071577c0100000000000000000000000000000000000000000000000000000000600035046342c9f9968114610076578063537af4191461013a5780635a9a49c7146101ed5780638da5cb5b146102b6578063dbcb7eb5146102e7578063ee583c6914610433575b600080fd5b6101386004803603608081101561008c57600080fd5b813591600160a060020a0360208201351691604082013591908101906080810160608201356401000000008111156100c357600080fd5b8201836020820111156100d557600080fd5b803590602001918460018302840111640100000000831117156100f757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610497945050505050565b005b34801561014657600080fd5b506101386004803603602081101561015d57600080fd5b81019060208101813564010000000081111561017857600080fd5b82018360208201111561018a57600080fd5b803590602001918460018302840111640100000000831117156101ac57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506106b7945050505050565b3480156101f957600080fd5b506102a26004803603606081101561021057600080fd5b81019060208101813564010000000081111561022b57600080fd5b82018360208201111561023d57600080fd5b8035906020019184602083028401116401000000008311171561025f57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602001356108e2565b604080519115158252519081900360200190f35b3480156102c257600080fd5b506102cb6108f7565b60408051600160a060020a039092168252519081900360200190f35b3480156102f357600080fd5b506101386004803603608081101561030a57600080fd5b81019060208101813564010000000081111561032557600080fd5b82018360208201111561033757600080fd5b8035906020019184602083028401116401000000008311171561035957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295600160a060020a03853516956020860135959194509250606081019150604001356401000000008111156103be57600080fd5b8201836020820111156103d057600080fd5b803590602001918460018302840111640100000000831117156103f257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610906945050505050565b34801561043f57600080fd5b5061045d6004803603602081101561045657600080fd5b5035610cd5565b60408051600160a060020a039687168152602081019590955292909416838301526060830152608082019290925290519081900360a00190f35b6702c68af0bb1400003410156104ac57600080fd5b6000816040516020018082805190602001908083835b602083106104e15780518252601f1990920191602091820191016104c2565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183528085528251928201929092207fdd62ed3e0000000000000000000000000000000000000000000000000000000083523360048401523060248401529351939650899550889450600160a060020a0386169363dd62ed3e9350604480840193829003018186803b15801561057e57600080fd5b505afa158015610592573d6000803e3d6000fd5b505050506040513d60208110156105a857600080fd5b505110156105ea5760405160e560020a62461bcd02815260040180806020018281038252602d815260200180610dbf602d913960400191505060405180910390fd5b6040805160a0810182523381526020808201898152600160a060020a03898116848601908152606085018a81526000608087018181528a8252958190528781209651875490851673ffffffffffffffffffffffffffffffffffffffff199182161788559451600180890191909155925160028801805491861691909616179094555160038601559251600490940193909355905492519290911691303180156108fc0292909190818181858888f193505050501580156106ae573d6000803e3d6000fd5b50505050505050565b6000816040516020018082805190602001908083835b602083106106ec5780518252601f1990920191602091820191016106cd565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f1901835284528151918101919091206000818152918290529290208054929550935050600160a060020a03163314905061074c57600080fd5b60048101546003820154036000811161076457600080fd5b6002820154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0390921691839183916370a0823191602480820192602092909190829003018186803b1580156107ce57600080fd5b505afa1580156107e2573d6000803e3d6000fd5b505050506040513d60208110156107f857600080fd5b50511015610850576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f7420656e6f75676820746f6b656e73000000000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051600160a060020a0383169163a9059cbb9160448083019260209291908290030181600087803b1580156108b857600080fd5b505af11580156108cc573d6000803e3d6000fd5b505050506040513d60208110156106ae57600080fd5b60006108ef848484610d10565b949350505050565b600154600160a060020a031681565b60408051600160a060020a03851660208083019190915281830185905282518083038401815260608301845280519082012060808084018290528451808503909101815260a0840190945283519382019390932084519092600092869260c09092019182918401908083835b602083106109915780518252601f199092019160209182019101610972565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001209050600080600083815260200190815260200160002090506109f3888260010154856108e2565b15156109fe57600080fd5b600160a060020a038716600090815260058201602052604090205460ff1615610a71576040805160e560020a62461bcd02815260206004820152600c60248201527f646f75626c65207370656e640000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600583016020908152604091829020805460ff19166001179055600480850180548b0190556002850154855484517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290861692810192909252306024830152925192909316928992849263dd62ed3e9260448082019391829003018186803b158015610b0e57600080fd5b505afa158015610b22573d6000803e3d6000fd5b505050506040513d6020811015610b3857600080fd5b50511015610b7a5760405160e560020a62461bcd02815260040180806020018281038252602d815260200180610dbf602d913960400191505060405180910390fd5b8154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201528a83166024820152604481018a90529051918316916323b872dd916064808201926020929091908290030181600087803b158015610bf057600080fd5b505af1158015610c04573d6000803e3d6000fd5b505050506040513d6020811015610c1a57600080fd5b50506040805160208181018a90528282528851928201929092528751600160a060020a038b16927f19d9ca3964105d232e4ea5beb411fd2c86c8e7f6c20ef62db9e5d4404edb187f928a928c928291606083019186019080838360005b83811015610c8f578181015183820152602001610c77565b50505050905090810190601f168015610cbc5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a2505050505050505050565b60006020819052908152604090208054600182015460028301546003840154600490940154600160a060020a03938416949293909116919085565b600081815b8551811015610db35760008682815181101515610d2e57fe5b90602001906020020151905080831015610d785782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610daa565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610d15565b50909214939250505056fe7468697320636f6e7472616374206d75737420626520616c6c6f77656420746f207370656e6420746f6b656e73a165627a7a72305820595ec363d307c96036b6b1d38684128ae3a4536a46673c533d66f92e2d046d5600290000000000000000000000000039f22efb07a647557c7c5d17854cfd6d489ef3
Deployed Bytecode
0x608060405260043610610071577c0100000000000000000000000000000000000000000000000000000000600035046342c9f9968114610076578063537af4191461013a5780635a9a49c7146101ed5780638da5cb5b146102b6578063dbcb7eb5146102e7578063ee583c6914610433575b600080fd5b6101386004803603608081101561008c57600080fd5b813591600160a060020a0360208201351691604082013591908101906080810160608201356401000000008111156100c357600080fd5b8201836020820111156100d557600080fd5b803590602001918460018302840111640100000000831117156100f757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610497945050505050565b005b34801561014657600080fd5b506101386004803603602081101561015d57600080fd5b81019060208101813564010000000081111561017857600080fd5b82018360208201111561018a57600080fd5b803590602001918460018302840111640100000000831117156101ac57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506106b7945050505050565b3480156101f957600080fd5b506102a26004803603606081101561021057600080fd5b81019060208101813564010000000081111561022b57600080fd5b82018360208201111561023d57600080fd5b8035906020019184602083028401116401000000008311171561025f57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955050823593505050602001356108e2565b604080519115158252519081900360200190f35b3480156102c257600080fd5b506102cb6108f7565b60408051600160a060020a039092168252519081900360200190f35b3480156102f357600080fd5b506101386004803603608081101561030a57600080fd5b81019060208101813564010000000081111561032557600080fd5b82018360208201111561033757600080fd5b8035906020019184602083028401116401000000008311171561035957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295600160a060020a03853516956020860135959194509250606081019150604001356401000000008111156103be57600080fd5b8201836020820111156103d057600080fd5b803590602001918460018302840111640100000000831117156103f257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610906945050505050565b34801561043f57600080fd5b5061045d6004803603602081101561045657600080fd5b5035610cd5565b60408051600160a060020a039687168152602081019590955292909416838301526060830152608082019290925290519081900360a00190f35b6702c68af0bb1400003410156104ac57600080fd5b6000816040516020018082805190602001908083835b602083106104e15780518252601f1990920191602091820191016104c2565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183528085528251928201929092207fdd62ed3e0000000000000000000000000000000000000000000000000000000083523360048401523060248401529351939650899550889450600160a060020a0386169363dd62ed3e9350604480840193829003018186803b15801561057e57600080fd5b505afa158015610592573d6000803e3d6000fd5b505050506040513d60208110156105a857600080fd5b505110156105ea5760405160e560020a62461bcd02815260040180806020018281038252602d815260200180610dbf602d913960400191505060405180910390fd5b6040805160a0810182523381526020808201898152600160a060020a03898116848601908152606085018a81526000608087018181528a8252958190528781209651875490851673ffffffffffffffffffffffffffffffffffffffff199182161788559451600180890191909155925160028801805491861691909616179094555160038601559251600490940193909355905492519290911691303180156108fc0292909190818181858888f193505050501580156106ae573d6000803e3d6000fd5b50505050505050565b6000816040516020018082805190602001908083835b602083106106ec5780518252601f1990920191602091820191016106cd565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f1901835284528151918101919091206000818152918290529290208054929550935050600160a060020a03163314905061074c57600080fd5b60048101546003820154036000811161076457600080fd5b6002820154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0390921691839183916370a0823191602480820192602092909190829003018186803b1580156107ce57600080fd5b505afa1580156107e2573d6000803e3d6000fd5b505050506040513d60208110156107f857600080fd5b50511015610850576040805160e560020a62461bcd02815260206004820152601160248201527f6e6f7420656e6f75676820746f6b656e73000000000000000000000000000000604482015290519081900360640190fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018490529051600160a060020a0383169163a9059cbb9160448083019260209291908290030181600087803b1580156108b857600080fd5b505af11580156108cc573d6000803e3d6000fd5b505050506040513d60208110156106ae57600080fd5b60006108ef848484610d10565b949350505050565b600154600160a060020a031681565b60408051600160a060020a03851660208083019190915281830185905282518083038401815260608301845280519082012060808084018290528451808503909101815260a0840190945283519382019390932084519092600092869260c09092019182918401908083835b602083106109915780518252601f199092019160209182019101610972565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001209050600080600083815260200190815260200160002090506109f3888260010154856108e2565b15156109fe57600080fd5b600160a060020a038716600090815260058201602052604090205460ff1615610a71576040805160e560020a62461bcd02815260206004820152600c60248201527f646f75626c65207370656e640000000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038088166000908152600583016020908152604091829020805460ff19166001179055600480850180548b0190556002850154855484517fdd62ed3e00000000000000000000000000000000000000000000000000000000815290861692810192909252306024830152925192909316928992849263dd62ed3e9260448082019391829003018186803b158015610b0e57600080fd5b505afa158015610b22573d6000803e3d6000fd5b505050506040513d6020811015610b3857600080fd5b50511015610b7a5760405160e560020a62461bcd02815260040180806020018281038252602d815260200180610dbf602d913960400191505060405180910390fd5b8154604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201528a83166024820152604481018a90529051918316916323b872dd916064808201926020929091908290030181600087803b158015610bf057600080fd5b505af1158015610c04573d6000803e3d6000fd5b505050506040513d6020811015610c1a57600080fd5b50506040805160208181018a90528282528851928201929092528751600160a060020a038b16927f19d9ca3964105d232e4ea5beb411fd2c86c8e7f6c20ef62db9e5d4404edb187f928a928c928291606083019186019080838360005b83811015610c8f578181015183820152602001610c77565b50505050905090810190601f168015610cbc5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a2505050505050505050565b60006020819052908152604090208054600182015460028301546003840154600490940154600160a060020a03938416949293909116919085565b600081815b8551811015610db35760008682815181101515610d2e57fe5b90602001906020020151905080831015610d785782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610daa565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610d15565b50909214939250505056fe7468697320636f6e7472616374206d75737420626520616c6c6f77656420746f207370656e6420746f6b656e73a165627a7a72305820595ec363d307c96036b6b1d38684128ae3a4536a46673c533d66f92e2d046d560029
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000039f22efb07a647557c7c5d17854cfd6d489ef3
-----Decoded View---------------
Arg [0] : _owner (address): 0x0039F22efB07A647557C7C5d17854CFD6D489eF3
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000000039f22efb07a647557c7c5d17854cfd6d489ef3
Swarm Source
bzzr://595ec363d307c96036b6b1d38684128ae3a4536a46673c533d66f92e2d046d56
Loading...
Loading
Loading...
Loading

Multichain Portfolio | 34 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.