-
Notifications
You must be signed in to change notification settings - Fork 2
/
example-standard-input.json
23 lines (23 loc) · 1.43 KB
/
example-standard-input.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
"language": "Solidity",
"sources": {
"contracts/Lock.sol": {
"content": "// SPDX-License-Identifier: UNLICENSED\npragma solidity ^0.8.9;\n\n// Uncomment this line to use console.log\n// import \"hardhat/console.sol\";\n\ncontract Lock {\n uint public unlockTime;\n address payable public owner;\n\n event Withdrawal(uint amount, uint when);\n\n constructor(uint _unlockTime) payable {\n require(\n block.timestamp < _unlockTime,\n \"Unlock time should be in the future\"\n );\n\n unlockTime = _unlockTime;\n owner = payable(msg.sender);\n }\n\n function withdraw() public {\n // Uncomment this line, and the import of \"hardhat/console.sol\", to print a log in your terminal\n // console.log(\"Unlock time is %o and block timestamp is %o\", unlockTime, block.timestamp);\n\n require(block.timestamp >= unlockTime, \"You can't withdraw yet\");\n require(msg.sender == owner, \"You aren't the owner\");\n\n emit Withdrawal(address(this).balance, block.timestamp);\n\n owner.transfer(address(this).balance);\n }\n}\n"
}
},
"settings": {
"optimizer": { "enabled": false, "runs": 200 },
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"metadata"
],
"": ["ast"]
}
}
}
}