More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 194 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Get Tokens | 8350318 | 2009 days ago | IN | 0 ETH | 0.00017449 | ||||
Get Tokens | 8245761 | 2025 days ago | IN | 0 ETH | 0.00052362 | ||||
Get Tokens | 8227358 | 2028 days ago | IN | 0 ETH | 0.00017462 | ||||
Transfer | 8209111 | 2031 days ago | IN | 0.00870242 ETH | 0.00008418 | ||||
Get Tokens | 8208712 | 2031 days ago | IN | 0 ETH | 0.00017453 | ||||
Get Tokens | 8199372 | 2032 days ago | IN | 0 ETH | 0.00005888 | ||||
Get Tokens | 8195136 | 2033 days ago | IN | 0 ETH | 0.00017454 | ||||
Get Tokens | 8136995 | 2042 days ago | IN | 0 ETH | 0.00349232 | ||||
Get Tokens | 8117417 | 2045 days ago | IN | 0 ETH | 0.0005232 | ||||
Get Tokens | 8105634 | 2047 days ago | IN | 0 ETH | 0.00017453 | ||||
Get Tokens | 8104178 | 2047 days ago | IN | 0 ETH | 0.00017457 | ||||
Get Tokens | 8070313 | 2053 days ago | IN | 0 ETH | 0.00029444 | ||||
Get Tokens | 8070309 | 2053 days ago | IN | 0 ETH | 0.00174567 | ||||
Get Tokens | 8009526 | 2062 days ago | IN | 0 ETH | 0.00034869 | ||||
Get Tokens | 8003809 | 2063 days ago | IN | 0 ETH | 0.00017437 | ||||
Get Tokens | 7996605 | 2064 days ago | IN | 0 ETH | 0.00017201 | ||||
Get Tokens | 7988576 | 2065 days ago | IN | 0 ETH | 0.00017204 | ||||
Get Tokens | 7988276 | 2065 days ago | IN | 0 ETH | 0.00104716 | ||||
Get Tokens | 7987264 | 2066 days ago | IN | 0 ETH | 0.00052356 | ||||
Get Tokens | 7987044 | 2066 days ago | IN | 0 ETH | 0.00052364 | ||||
Get Tokens | 7969777 | 2068 days ago | IN | 0 ETH | 0.00034875 | ||||
Get Tokens | 7969727 | 2068 days ago | IN | 0 ETH | 0.00034859 | ||||
Get Tokens | 7969465 | 2068 days ago | IN | 0 ETH | 0.00034386 | ||||
Get Tokens | 7969446 | 2068 days ago | IN | 0 ETH | 0.00034885 | ||||
Get Tokens | 7969407 | 2068 days ago | IN | 0 ETH | 0.0003491 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x961Ac833...E4B4eABF1 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
dapMerkle
Compiler Version
v0.5.3+commit.10d17f24
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2019-03-19 */ pragma solidity 0.5.3; interface erc20token { function transfer(address _to, uint256 _amount) external returns (bool); function balanceOf(address _p) external returns (uint256); function decimals() external returns (uint256); } contract dapMerkle { /* variables */ bytes32 public root; erc20token public token; address payable owner; uint256 public amountSent; /* storage */ mapping (address => bool) public sent; /* events */ event tokensSent(address to, uint256 amount); event rootChanged(bytes32 root); /* modifiers */ modifier onlyOwner(){ if (msg.sender == owner){ _; } } constructor (address _token, bytes32 _merkleRoot) public{ owner = msg.sender; root = _merkleRoot; token = erc20token(_token); } function setRoot(bytes32 _root) external onlyOwner { root = _root; emit rootChanged(_root); } function getTokenBalance() external returns (uint256){ return token.balanceOf(address(this)); } function abortAirdrop() onlyOwner external{ require(token.balanceOf(address(this)) > 0); assert( token.transfer(owner, token.balanceOf( address(this) ) ) ); selfdestruct(owner); } function getTokens(bytes32[] calldata _proof, address _receiver, uint256 _amount) external returns (bool){ require (!sent[_receiver]); require (_amount > 0); require( verify(_proof, makeLeaf(_receiver, _amount)) ); uint256 decimals = token.decimals(); uint256 amount = _amount*(10**decimals); sent[_receiver] = true; assert(token.transfer(_receiver, amount)); amountSent += _amount; emit tokensSent(_receiver, _amount); return true; } function addressToAsciiString(address x) internal pure returns (string memory) { bytes memory s = new bytes(40); for (uint i = 0; i < 20; i++) { byte b = byte(uint8(uint(x) / (2**(8*(19 - i))))); byte hi = byte(uint8(b) / 16); byte lo = byte(uint8(b) - 16 * uint8(hi)); s[2*i] = char(hi); s[2*i+1] = char(lo); } return string(s); } function char(byte b) internal pure returns (byte c) { if (b < byte(uint8(10))) return byte(uint8(b) + 0x30); else return byte(uint8(b) + 0x57); } function uintToStr(uint i) internal pure returns (string memory){ if (i == 0) return "0"; uint j = i; uint length; while (j != 0){ length++; j /= 10; } bytes memory bstr = new bytes(length); uint k = length - 1; while (i != 0){ bstr[k--] = byte(uint8(48 + i % 10)); i /= 10; } return string(bstr); } function makeLeaf(address _a, uint256 _n) internal pure returns(bytes32) { string memory prefix = "0x"; string memory space = " "; bytes memory _ba = bytes(prefix); bytes memory _bb = bytes(addressToAsciiString(_a)); bytes memory _bc = bytes(space); bytes memory _bd = bytes(uintToStr(_n)); string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length); bytes memory babcde = bytes(abcde); uint k = 0; for (uint8 i = 0; i < _ba.length; i++) babcde[k++] = _ba[i]; for (uint8 i = 0; i < _bb.length; i++) babcde[k++] = _bb[i]; for (uint8 i = 0; i < _bc.length; i++) babcde[k++] = _bc[i]; for (uint8 i = 0; i < _bd.length; i++) babcde[k++] = _bd[i]; return keccak256(babcde); } function verify(bytes32[] memory proof, bytes32 leaf) internal view 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; } function makeString(address _a, uint256 _n) external pure returns(bytes memory){ string memory prefix = "0x"; string memory space = " "; bytes memory _ba = bytes(prefix); bytes memory _bb = bytes(addressToAsciiString(_a)); bytes memory _bc = bytes(space); bytes memory _bd = bytes(uintToStr(_n)); string memory abcde = new string(_ba.length + _bb.length + _bc.length + _bd.length); bytes memory babcde = bytes(abcde); uint k = 0; for (uint8 i = 0; i < _ba.length; i++) babcde[k++] = _ba[i]; for (uint8 i = 0; i < _bb.length; i++) babcde[k++] = _bb[i]; for (uint8 i = 0; i < _bc.length; i++) babcde[k++] = _bc[i]; for (uint8 i = 0; i < _bd.length; i++) babcde[k++] = _bd[i]; return babcde; } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"constant":true,"inputs":[],"name":"amountSent","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"abortAirdrop","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"sent","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"getTokenBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_proof","type":"bytes32[]"},{"name":"_receiver","type":"address"},{"name":"_amount","type":"uint256"}],"name":"getTokens","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_root","type":"bytes32"}],"name":"setRoot","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_a","type":"address"},{"name":"_n","type":"uint256"}],"name":"makeString","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"pure","type":"function"},{"constant":true,"inputs":[],"name":"root","outputs":[{"name":"","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_merkleRoot","type":"bytes32"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"tokensSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"root","type":"bytes32"}],"name":"rootChanged","type":"event"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106100b0576000357c010000000000000000000000000000000000000000000000000000000090048063d7480fc311610083578063d7480fc31461011b578063dab5f3401461019a578063e12a1cea146101b7578063ebf0c71714610258578063fc0c546a14610260576100b0565b806350d38cf7146100b55780637bc84332146100cf5780637bf786f8146100d957806382b2e25714610113575b600080fd5b6100bd610284565b60408051918252519081900360200190f35b6100d761028a565b005b6100ff600480360360208110156100ef57600080fd5b5035600160a060020a0316610481565b604080519115158252519081900360200190f35b6100bd610496565b6100ff6004803603606081101561013157600080fd5b81019060208101813564010000000081111561014c57600080fd5b82018360208201111561015e57600080fd5b8035906020019184602083028401116401000000008311171561018057600080fd5b9193509150600160a060020a03813516906020013561052c565b6100d7600480360360208110156101b057600080fd5b5035610761565b6101e3600480360360408110156101cd57600080fd5b50600160a060020a0381351690602001356107b0565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021d578181015183820152602001610205565b50505050905090810190601f16801561024a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100bd610a22565b610268610a28565b60408051600160a060020a039092168252519081900360200190f35b60035481565b600254600160a060020a031633141561047f57600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561030257600080fd5b505af1158015610316573d6000803e3d6000fd5b505050506040513d602081101561032c57600080fd5b50511161033857600080fd5b600154600254604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a039384169363a9059cbb93169184916370a08231916024808201926020929091908290030181600087803b1580156103ab57600080fd5b505af11580156103bf573d6000803e3d6000fd5b505050506040513d60208110156103d557600080fd5b5051604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561043d57600080fd5b505af1158015610451573d6000803e3d6000fd5b505050506040513d602081101561046757600080fd5b5051151561047157fe5b600254600160a060020a0316ff5b565b60046020526000908152604090205460ff1681565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b1580156104fb57600080fd5b505af115801561050f573d6000803e3d6000fd5b505050506040513d602081101561052557600080fd5b5051905090565b600160a060020a03821660009081526004602052604081205460ff161561055257600080fd5b6000821161055f57600080fd5b6105a78585808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152506105a29250879150869050610a37565b610cb1565b15156105b257600080fd5b600154604080517f313ce5670000000000000000000000000000000000000000000000000000000081529051600092600160a060020a03169163313ce56791600480830192602092919082900301818787803b15801561061157600080fd5b505af1158015610625573d6000803e3d6000fd5b505050506040513d602081101561063b57600080fd5b5051600160a060020a038086166000818152600460208181526040808420805460ff191660019081179091555481517fa9059cbb00000000000000000000000000000000000000000000000000000000815293840195909552600a87900a8a0260248401819052905196975095939094169363a9059cbb9360448084019492939192918390030190829087803b1580156106d457600080fd5b505af11580156106e8573d6000803e3d6000fd5b505050506040513d60208110156106fe57600080fd5b5051151561070857fe5b600380548501905560408051600160a060020a03871681526020810186905281517f0a831211c113c63e83cbd6173d5390d69cd60c0c2fbffe221d46fbe507e6963d929181900390910190a15060019695505050505050565b600254600160a060020a03163314156107ad5760008190556040805182815290517f996dd038403057848bfba8f3b47a86984df13cb0e01909d9c52f7da0ead02bd49181900360200190a15b50565b604080518082018252600281527f30780000000000000000000000000000000000000000000000000000000000006020808301919091528251808401909352600183527f200000000000000000000000000000000000000000000000000000000000000090830152606091818361082687610d60565b905082606061083488610e64565b9050606081518351855187510101016040519080825280601f01601f19166020018201604052801561086d576020820181803883390190505b509050806000805b87518160ff1610156108d957878160ff1681518110151561089257fe5b90602001015160f860020a900460f860020a0283838060010194508151811015156108b957fe5b906020010190600160f860020a031916908160001a905350600101610875565b5060005b86518160ff16101561094157868160ff168151811015156108fa57fe5b90602001015160f860020a900460f860020a02838380600101945081518110151561092157fe5b906020010190600160f860020a031916908160001a9053506001016108dd565b5060005b85518160ff1610156109a957858160ff1681518110151561096257fe5b90602001015160f860020a900460f860020a02838380600101945081518110151561098957fe5b906020010190600160f860020a031916908160001a905350600101610945565b5060005b84518160ff161015610a1157848160ff168151811015156109ca57fe5b90602001015160f860020a900460f860020a0283838060010194508151811015156109f157fe5b906020010190600160f860020a031916908160001a9053506001016109ad565b50909b9a5050505050505050505050565b60005481565b600154600160a060020a031681565b604080518082018252600281527f30780000000000000000000000000000000000000000000000000000000000006020808301919091528251808401909352600183527f200000000000000000000000000000000000000000000000000000000000000090830152600091816060610aae87610d60565b9050826060610abc88610e64565b9050606081518351855187510101016040519080825280601f01601f191660200182016040528015610af5576020820181803883390190505b509050806000805b87518160ff161015610b6157878160ff16815181101515610b1a57fe5b90602001015160f860020a900460f860020a028383806001019450815181101515610b4157fe5b906020010190600160f860020a031916908160001a905350600101610afd565b5060005b86518160ff161015610bc957868160ff16815181101515610b8257fe5b90602001015160f860020a900460f860020a028383806001019450815181101515610ba957fe5b906020010190600160f860020a031916908160001a905350600101610b65565b5060005b85518160ff161015610c3157858160ff16815181101515610bea57fe5b90602001015160f860020a900460f860020a028383806001019450815181101515610c1157fe5b906020010190600160f860020a031916908160001a905350600101610bcd565b5060005b84518160ff161015610c9957848160ff16815181101515610c5257fe5b90602001015160f860020a900460f860020a028383806001019450815181101515610c7957fe5b906020010190600160f860020a031916908160001a905350600101610c35565b505080516020909101209a9950505050505050505050565b600081815b8451811015610d545760008582815181101515610ccf57fe5b90602001906020020151905080831015610d195782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610d4b565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610cb6565b50600054149392505050565b604080516028808252606082810190935282919060208201818038833901905050905060005b6014811015610e5b5760008160130360080260020a85600160a060020a0316811515610dae57fe5b0460f860020a029050600060108260f860020a900460ff16811515610dcf57fe5b0460f860020a90810291508082046010028184040302610dee82610f48565b8585600202815181101515610dff57fe5b906020010190600160f860020a031916908160001a905350610e2081610f48565b8585600202600101815181101515610e3457fe5b906020010190600160f860020a031916908160001a9053505060019092019150610d869050565b5090505b919050565b6060811515610ea7575060408051808201909152600181527f30000000000000000000000000000000000000000000000000000000000000006020820152610e5f565b8160005b8115610ebf57600101600a82049150610eab565b6060816040519080825280601f01601f191660200182016040528015610eec576020820181803883390190505b50905060001982015b8515610f3f57815160001982019160f860020a6030600a8a060102918491908110610f1c57fe5b906020010190600160f860020a031916908160001a905350600a86049550610ef5565b50949350505050565b60007f0a000000000000000000000000000000000000000000000000000000000000007fff0000000000000000000000000000000000000000000000000000000000000083161015610fac578160f860020a900460300160f860020a029050610e5f565b8160f860020a900460570160f860020a029050610e5f56fea165627a7a723058208a9bfeb411d056caf4854b5c19c80df8235d4cf76444d9a79eed725611c579a70029
Swarm Source
bzzr://8a9bfeb411d056caf4854b5c19c80df8235d4cf76444d9a79eed725611c579a7
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.