Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Hodler
Compiler Version
v0.8.24+commit.e11b9ed9
Contract Source Code (Solidity)
/** *Submitted for verification at Etherscan.io on 2024-02-18 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.24; contract Hodler { // Payable address can send Ether via transfer or send address payable public owner; uint256 public releaseTimeInUnixSeconds; // Payable constructor can receive Ether constructor(uint256 _releaseInDays) payable { owner = payable(msg.sender); releaseTimeInUnixSeconds = block.timestamp + _releaseInDays * 24 * 60 * 60; } // Function to receive Ether. msg.data must be empty receive() external payable { if(msg.sender == owner) { if(block.timestamp >= releaseTimeInUnixSeconds) { withdraw(); } } } // Fallback function is called when msg.data is not empty fallback() external payable { if(msg.sender == owner) { if(block.timestamp >= releaseTimeInUnixSeconds) { withdraw(); } } } function unlockAndWithdraw() public { require(msg.sender == owner, "Don't try to steal my ether."); require(block.timestamp >= releaseTimeInUnixSeconds, "Stop trading, just hodl."); withdraw(); } // Function to withdraw all Ether from this contract. function withdraw() private { // get the amount of Ether stored in this contract uint amount = address(this).balance; // send all Ether to owner (bool success, ) = owner.call{value: amount}(""); require(success, "Oops, it is messed up."); } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"uint256","name":"_releaseInDays","type":"uint256"}],"stateMutability":"payable","type":"constructor"},{"stateMutability":"payable","type":"fallback"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"releaseTimeInUnixSeconds","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlockAndWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
6080604052604051610740380380610740833981810160405281019061002591906100d6565b335f806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550603c80601883610074919061012e565b61007e919061012e565b610088919061012e565b42610093919061016f565b600181905550506101a2565b5f80fd5b5f819050919050565b6100b5816100a3565b81146100bf575f80fd5b50565b5f815190506100d0816100ac565b92915050565b5f602082840312156100eb576100ea61009f565b5b5f6100f8848285016100c2565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610138826100a3565b9150610143836100a3565b9250828202610151816100a3565b9150828204841483151761016857610167610101565b5b5092915050565b5f610179826100a3565b9150610184836100a3565b925082820190508082111561019c5761019b610101565b5b92915050565b610591806101af5f395ff3fe608060405260043610610037575f3560e01c8063599a51d21461010a5780635cb2fe8a146101345780638da5cb5b1461014a576100a3565b366100a3575f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036100a15760015442106100a05761009f610174565b5b5b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361010857600154421061010757610106610174565b5b5b005b348015610115575f80fd5b5061011e610244565b60405161012b9190610361565b60405180910390f35b34801561013f575f80fd5b5061014861024a565b005b348015610155575f80fd5b5061015e610326565b60405161016b91906103b9565b60405180910390f35b5f4790505f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16826040516101bd906103ff565b5f6040518083038185875af1925050503d805f81146101f7576040519150601f19603f3d011682016040523d82523d5f602084013e6101fc565b606091505b5050905080610240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102379061046d565b60405180910390fd5b5050565b60015481565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ce906104d5565b60405180910390fd5b60015442101561031c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103139061053d565b60405180910390fd5b610324610174565b565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f819050919050565b61035b81610349565b82525050565b5f6020820190506103745f830184610352565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6103a38261037a565b9050919050565b6103b381610399565b82525050565b5f6020820190506103cc5f8301846103aa565b92915050565b5f81905092915050565b50565b5f6103ea5f836103d2565b91506103f5826103dc565b5f82019050919050565b5f610409826103df565b9150819050919050565b5f82825260208201905092915050565b7f4f6f70732c206974206973206d65737365642075702e000000000000000000005f82015250565b5f610457601683610413565b915061046282610423565b602082019050919050565b5f6020820190508181035f8301526104848161044b565b9050919050565b7f446f6e27742074727920746f20737465616c206d792065746865722e000000005f82015250565b5f6104bf601c83610413565b91506104ca8261048b565b602082019050919050565b5f6020820190508181035f8301526104ec816104b3565b9050919050565b7f53746f702074726164696e672c206a75737420686f646c2e00000000000000005f82015250565b5f610527601883610413565b9150610532826104f3565b602082019050919050565b5f6020820190508181035f8301526105548161051b565b905091905056fea26469706673582212202aebf15ce8d7f32fbdf21237e0db6e1ff600a929c6b1aad7f60cbf2740bd97b964736f6c63430008180033000000000000000000000000000000000000000000000000000000000000016d
Deployed Bytecode
0x608060405260043610610037575f3560e01c8063599a51d21461010a5780635cb2fe8a146101345780638da5cb5b1461014a576100a3565b366100a3575f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16036100a15760015442106100a05761009f610174565b5b5b005b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff160361010857600154421061010757610106610174565b5b5b005b348015610115575f80fd5b5061011e610244565b60405161012b9190610361565b60405180910390f35b34801561013f575f80fd5b5061014861024a565b005b348015610155575f80fd5b5061015e610326565b60405161016b91906103b9565b60405180910390f35b5f4790505f805f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16826040516101bd906103ff565b5f6040518083038185875af1925050503d805f81146101f7576040519150601f19603f3d011682016040523d82523d5f602084013e6101fc565b606091505b5050905080610240576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102379061046d565b60405180910390fd5b5050565b60015481565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146102d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ce906104d5565b60405180910390fd5b60015442101561031c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103139061053d565b60405180910390fd5b610324610174565b565b5f8054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f819050919050565b61035b81610349565b82525050565b5f6020820190506103745f830184610352565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6103a38261037a565b9050919050565b6103b381610399565b82525050565b5f6020820190506103cc5f8301846103aa565b92915050565b5f81905092915050565b50565b5f6103ea5f836103d2565b91506103f5826103dc565b5f82019050919050565b5f610409826103df565b9150819050919050565b5f82825260208201905092915050565b7f4f6f70732c206974206973206d65737365642075702e000000000000000000005f82015250565b5f610457601683610413565b915061046282610423565b602082019050919050565b5f6020820190508181035f8301526104848161044b565b9050919050565b7f446f6e27742074727920746f20737465616c206d792065746865722e000000005f82015250565b5f6104bf601c83610413565b91506104ca8261048b565b602082019050919050565b5f6020820190508181035f8301526104ec816104b3565b9050919050565b7f53746f702074726164696e672c206a75737420686f646c2e00000000000000005f82015250565b5f610527601883610413565b9150610532826104f3565b602082019050919050565b5f6020820190508181035f8301526105548161051b565b905091905056fea26469706673582212202aebf15ce8d7f32fbdf21237e0db6e1ff600a929c6b1aad7f60cbf2740bd97b964736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000016d
-----Decoded View---------------
Arg [0] : _releaseInDays (uint256): 365
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000000000016d
Deployed Bytecode Sourcemap
61:1424:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;547:5;;;;;;;;;;533:19;;:10;:19;;;530:131;;590:24;;571:15;:43;568:86;;634:10;:8;:10::i;:::-;568:86;530:131;61:1424;;785:5;;;;;;;;;;771:19;;:10;:19;;;768:143;;832:24;;813:15;:43;810:92;;880:10;:8;:10::i;:::-;810:92;768:143;61:1424;173:39;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;922:215;;;;;;;;;;;;;:::i;:::-;;140:28;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;1202:280;1297:11;1311:21;1297:35;;1378:12;1396:5;;;;;;;;;;;:10;;1414:6;1396:29;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1377:48;;;1442:7;1434:42;;;;;;;;;;;;:::i;:::-;;;;;;;;;1230:252;;1202:280::o;173:39::-;;;;:::o;922:215::-;987:5;;;;;;;;;;973:19;;:10;:19;;;965:60;;;;;;;;;;;;:::i;:::-;;;;;;;;;1059:24;;1040:15;:43;;1032:80;;;;;;;;;;;;:::i;:::-;;;;;;;;;1121:10;:8;:10::i;:::-;922:215::o;140:28::-;;;;;;;;;;;;:::o;7:77:1:-;44:7;73:5;62:16;;7:77;;;:::o;90:118::-;177:24;195:5;177:24;:::i;:::-;172:3;165:37;90:118;;:::o;214:222::-;307:4;345:2;334:9;330:18;322:26;;358:71;426:1;415:9;411:17;402:6;358:71;:::i;:::-;214:222;;;;:::o;442:126::-;479:7;519:42;512:5;508:54;497:65;;442:126;;;:::o;574:104::-;619:7;648:24;666:5;648:24;:::i;:::-;637:35;;574:104;;;:::o;684:142::-;787:32;813:5;787:32;:::i;:::-;782:3;775:45;684:142;;:::o;832:254::-;941:4;979:2;968:9;964:18;956:26;;992:87;1076:1;1065:9;1061:17;1052:6;992:87;:::i;:::-;832:254;;;;:::o;1092:147::-;1193:11;1230:3;1215:18;;1092:147;;;;:::o;1245:114::-;;:::o;1365:398::-;1524:3;1545:83;1626:1;1621:3;1545:83;:::i;:::-;1538:90;;1637:93;1726:3;1637:93;:::i;:::-;1755:1;1750:3;1746:11;1739:18;;1365:398;;;:::o;1769:379::-;1953:3;1975:147;2118:3;1975:147;:::i;:::-;1968:154;;2139:3;2132:10;;1769:379;;;:::o;2154:169::-;2238:11;2272:6;2267:3;2260:19;2312:4;2307:3;2303:14;2288:29;;2154:169;;;;:::o;2329:172::-;2469:24;2465:1;2457:6;2453:14;2446:48;2329:172;:::o;2507:366::-;2649:3;2670:67;2734:2;2729:3;2670:67;:::i;:::-;2663:74;;2746:93;2835:3;2746:93;:::i;:::-;2864:2;2859:3;2855:12;2848:19;;2507:366;;;:::o;2879:419::-;3045:4;3083:2;3072:9;3068:18;3060:26;;3132:9;3126:4;3122:20;3118:1;3107:9;3103:17;3096:47;3160:131;3286:4;3160:131;:::i;:::-;3152:139;;2879:419;;;:::o;3304:178::-;3444:30;3440:1;3432:6;3428:14;3421:54;3304:178;:::o;3488:366::-;3630:3;3651:67;3715:2;3710:3;3651:67;:::i;:::-;3644:74;;3727:93;3816:3;3727:93;:::i;:::-;3845:2;3840:3;3836:12;3829:19;;3488:366;;;:::o;3860:419::-;4026:4;4064:2;4053:9;4049:18;4041:26;;4113:9;4107:4;4103:20;4099:1;4088:9;4084:17;4077:47;4141:131;4267:4;4141:131;:::i;:::-;4133:139;;3860:419;;;:::o;4285:174::-;4425:26;4421:1;4413:6;4409:14;4402:50;4285:174;:::o;4465:366::-;4607:3;4628:67;4692:2;4687:3;4628:67;:::i;:::-;4621:74;;4704:93;4793:3;4704:93;:::i;:::-;4822:2;4817:3;4813:12;4806:19;;4465:366;;;:::o;4837:419::-;5003:4;5041:2;5030:9;5026:18;5018:26;;5090:9;5084:4;5080:20;5076:1;5065:9;5061:17;5054:47;5118:131;5244:4;5118:131;:::i;:::-;5110:139;;4837:419;;;:::o
Swarm Source
ipfs://2aebf15ce8d7f32fbdf21237e0db6e1ff600a929c6b1aad7f60cbf2740bd97b9
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | Ether (ETH) | 100.00% | $3,362.56 | 1.2 | $4,035.08 |
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.