{ "contractName": "Faucet", "abi": [ { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "owner", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function", "constant": true }, { "stateMutability": "payable", "type": "receive", "payable": true }, { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "name": "withdraw", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/Faucet.sol\":\"Faucet\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/Faucet.sol\":{\"keccak256\":\"0x537ce0f06ccd1f6f0a2d66fcd3a24339cb6bd95dd1c64b20fd0c3f3f375aba92\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://1ed09f5010f2afa44599f232be8b1cb1b3b8cbbf1b260527f9573c4a3bd50015\",\"dweb:/ipfs/QmavacGBaUPkwVwB9RWVPSEpKvUagjibz4cYRcro1AjnMQ\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610263806100606000396000f3fe60806040526004361061002d5760003560e01c80632e1a7d4d146100395780638da5cb5b1461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101a4565b61008d565b005b34801561006e57600080fd5b50610077610145565b6040516100849190610212565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100e557600080fd5b68056bc75e2d631000008111156100fb57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610141573d6000803e3d6000fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b6000819050919050565b6101818161016e565b811461018c57600080fd5b50565b60008135905061019e81610178565b92915050565b6000602082840312156101ba576101b9610169565b5b60006101c88482850161018f565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101fc826101d1565b9050919050565b61020c816101f1565b82525050565b60006020820190506102276000830184610203565b9291505056fea26469706673582212205fee55d00b753ce85887608c5c3235528de612673e4d46f06eb4518bdc5dc98564736f6c63430008130033", "deployedBytecode": "0x60806040526004361061002d5760003560e01c80632e1a7d4d146100395780638da5cb5b1461006257610034565b3661003457005b600080fd5b34801561004557600080fd5b50610060600480360381019061005b91906101a4565b61008d565b005b34801561006e57600080fd5b50610077610145565b6040516100849190610212565b60405180910390f35b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146100e557600080fd5b68056bc75e2d631000008111156100fb57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610141573d6000803e3d6000fd5b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080fd5b6000819050919050565b6101818161016e565b811461018c57600080fd5b50565b60008135905061019e81610178565b92915050565b6000602082840312156101ba576101b9610169565b5b60006101c88482850161018f565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006101fc826101d1565b9050919050565b61020c816101f1565b82525050565b60006020820190506102276000830184610203565b9291505056fea26469706673582212205fee55d00b753ce85887608c5c3235528de612673e4d46f06eb4518bdc5dc98564736f6c63430008130033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:1608:1", "statements": [ { "body": { "nodeType": "YulBlock", "src": "47:35:1", "statements": [ { "nodeType": "YulAssignment", "src": "57:19:1", "value": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "73:2:1", "type": "", "value": "64" } ], "functionName": { "name": "mload", "nodeType": "YulIdentifier", "src": "67:5:1" }, "nodeType": "YulFunctionCall", "src": "67:9:1" }, "variableNames": [ { "name": "memPtr", "nodeType": "YulIdentifier", "src": "57:6:1" } ] } ] }, "name": "allocate_unbounded", "nodeType": "YulFunctionDefinition", "returnVariables": [ { "name": "memPtr", "nodeType": "YulTypedName", "src": "40:6:1", "type": "" } ], "src": "7:75:1" }, { "body": { "nodeType": "YulBlock", "src": "177:28:1", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "194:1:1", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "197:1:1", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "187:6:1" }, "nodeType": "YulFunctionCall", "src": "187:12:1" }, "nodeType": "YulExpressionStatement", "src": "187:12:1" } ] }, "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulFunctionDefinition", "src": "88:117:1" }, { "body": { "nodeType": "YulBlock", "src": "300:28:1", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "317:1:1", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "320:1:1", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "310:6:1" }, "nodeType": "YulFunctionCall", "src": "310:12:1" }, "nodeType": "YulExpressionStatement", "src": "310:12:1" } ] }, "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", "nodeType": "YulFunctionDefinition", "src": "211:117:1" }, { "body": { "nodeType": "YulBlock", "src": "379:32:1", "statements": [ { "nodeType": "YulAssignment", "src": "389:16:1", "value": { "name": "value", "nodeType": "YulIdentifier", "src": "400:5:1" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", "src": "389:7:1" } ] } ] }, "name": "cleanup_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "361:5:1", "type": "" } ], "returnVariables": [ { "name": "cleaned", "nodeType": "YulTypedName", "src": "371:7:1", "type": "" } ], "src": "334:77:1" }, { "body": { "nodeType": "YulBlock", "src": "460:79:1", "statements": [ { "body": { "nodeType": "YulBlock", "src": "517:16:1", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "526:1:1", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "529:1:1", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "519:6:1" }, "nodeType": "YulFunctionCall", "src": "519:12:1" }, "nodeType": "YulExpressionStatement", "src": "519:12:1" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "483:5:1" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "508:5:1" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", "src": "490:17:1" }, "nodeType": "YulFunctionCall", "src": "490:24:1" } ], "functionName": { "name": "eq", "nodeType": "YulIdentifier", "src": "480:2:1" }, "nodeType": "YulFunctionCall", "src": "480:35:1" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "473:6:1" }, "nodeType": "YulFunctionCall", "src": "473:43:1" }, "nodeType": "YulIf", "src": "470:63:1" } ] }, "name": "validator_revert_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "453:5:1", "type": "" } ], "src": "417:122:1" }, { "body": { "nodeType": "YulBlock", "src": "597:87:1", "statements": [ { "nodeType": "YulAssignment", "src": "607:29:1", "value": { "arguments": [ { "name": "offset", "nodeType": "YulIdentifier", "src": "629:6:1" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", "src": "616:12:1" }, "nodeType": "YulFunctionCall", "src": "616:20:1" }, "variableNames": [ { "name": "value", "nodeType": "YulIdentifier", "src": "607:5:1" } ] }, { "expression": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "672:5:1" } ], "functionName": { "name": "validator_revert_t_uint256", "nodeType": "YulIdentifier", "src": "645:26:1" }, "nodeType": "YulFunctionCall", "src": "645:33:1" }, "nodeType": "YulExpressionStatement", "src": "645:33:1" } ] }, "name": "abi_decode_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "offset", "nodeType": "YulTypedName", "src": "575:6:1", "type": "" }, { "name": "end", "nodeType": "YulTypedName", "src": "583:3:1", "type": "" } ], "returnVariables": [ { "name": "value", "nodeType": "YulTypedName", "src": "591:5:1", "type": "" } ], "src": "545:139:1" }, { "body": { "nodeType": "YulBlock", "src": "756:263:1", "statements": [ { "body": { "nodeType": "YulBlock", "src": "802:83:1", "statements": [ { "expression": { "arguments": [], "functionName": { "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulIdentifier", "src": "804:77:1" }, "nodeType": "YulFunctionCall", "src": "804:79:1" }, "nodeType": "YulExpressionStatement", "src": "804:79:1" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "777:7:1" }, { "name": "headStart", "nodeType": "YulIdentifier", "src": "786:9:1" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "773:3:1" }, "nodeType": "YulFunctionCall", "src": "773:23:1" }, { "kind": "number", "nodeType": "YulLiteral", "src": "798:2:1", "type": "", "value": "32" } ], "functionName": { "name": "slt", "nodeType": "YulIdentifier", "src": "769:3:1" }, "nodeType": "YulFunctionCall", "src": "769:32:1" }, "nodeType": "YulIf", "src": "766:119:1" }, { "nodeType": "YulBlock", "src": "895:117:1", "statements": [ { "nodeType": "YulVariableDeclaration", "src": "910:15:1", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "924:1:1", "type": "", "value": "0" }, "variables": [ { "name": "offset", "nodeType": "YulTypedName", "src": "914:6:1", "type": "" } ] }, { "nodeType": "YulAssignment", "src": "939:63:1", "value": { "arguments": [ { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "974:9:1" }, { "name": "offset", "nodeType": "YulIdentifier", "src": "985:6:1" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "970:3:1" }, "nodeType": "YulFunctionCall", "src": "970:22:1" }, { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "994:7:1" } ], "functionName": { "name": "abi_decode_t_uint256", "nodeType": "YulIdentifier", "src": "949:20:1" }, "nodeType": "YulFunctionCall", "src": "949:53:1" }, "variableNames": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "939:6:1" } ] } ] } ] }, "name": "abi_decode_tuple_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", "nodeType": "YulTypedName", "src": "726:9:1", "type": "" }, { "name": "dataEnd", "nodeType": "YulTypedName", "src": "737:7:1", "type": "" } ], "returnVariables": [ { "name": "value0", "nodeType": "YulTypedName", "src": "749:6:1", "type": "" } ], "src": "690:329:1" }, { "body": { "nodeType": "YulBlock", "src": "1070:81:1", "statements": [ { "nodeType": "YulAssignment", "src": "1080:65:1", "value": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "1095:5:1" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1102:42:1", "type": "", "value": "0xffffffffffffffffffffffffffffffffffffffff" } ], "functionName": { "name": "and", "nodeType": "YulIdentifier", "src": "1091:3:1" }, "nodeType": "YulFunctionCall", "src": "1091:54:1" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", "src": "1080:7:1" } ] } ] }, "name": "cleanup_t_uint160", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "1052:5:1", "type": "" } ], "returnVariables": [ { "name": "cleaned", "nodeType": "YulTypedName", "src": "1062:7:1", "type": "" } ], "src": "1025:126:1" }, { "body": { "nodeType": "YulBlock", "src": "1202:51:1", "statements": [ { "nodeType": "YulAssignment", "src": "1212:35:1", "value": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "1241:5:1" } ], "functionName": { "name": "cleanup_t_uint160", "nodeType": "YulIdentifier", "src": "1223:17:1" }, "nodeType": "YulFunctionCall", "src": "1223:24:1" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", "src": "1212:7:1" } ] } ] }, "name": "cleanup_t_address", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "1184:5:1", "type": "" } ], "returnVariables": [ { "name": "cleaned", "nodeType": "YulTypedName", "src": "1194:7:1", "type": "" } ], "src": "1157:96:1" }, { "body": { "nodeType": "YulBlock", "src": "1324:53:1", "statements": [ { "expression": { "arguments": [ { "name": "pos", "nodeType": "YulIdentifier", "src": "1341:3:1" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "1364:5:1" } ], "functionName": { "name": "cleanup_t_address", "nodeType": "YulIdentifier", "src": "1346:17:1" }, "nodeType": "YulFunctionCall", "src": "1346:24:1" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "1334:6:1" }, "nodeType": "YulFunctionCall", "src": "1334:37:1" }, "nodeType": "YulExpressionStatement", "src": "1334:37:1" } ] }, "name": "abi_encode_t_address_to_t_address_fromStack", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "1312:5:1", "type": "" }, { "name": "pos", "nodeType": "YulTypedName", "src": "1319:3:1", "type": "" } ], "src": "1259:118:1" }, { "body": { "nodeType": "YulBlock", "src": "1481:124:1", "statements": [ { "nodeType": "YulAssignment", "src": "1491:26:1", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "1503:9:1" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1514:2:1", "type": "", "value": "32" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "1499:3:1" }, "nodeType": "YulFunctionCall", "src": "1499:18:1" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", "src": "1491:4:1" } ] }, { "expression": { "arguments": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "1571:6:1" }, { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "1584:9:1" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1595:1:1", "type": "", "value": "0" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "1580:3:1" }, "nodeType": "YulFunctionCall", "src": "1580:17:1" } ], "functionName": { "name": "abi_encode_t_address_to_t_address_fromStack", "nodeType": "YulIdentifier", "src": "1527:43:1" }, "nodeType": "YulFunctionCall", "src": "1527:71:1" }, "nodeType": "YulExpressionStatement", "src": "1527:71:1" } ] }, "name": "abi_encode_tuple_t_address__to_t_address__fromStack_reversed", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", "nodeType": "YulTypedName", "src": "1453:9:1", "type": "" }, { "name": "value0", "nodeType": "YulTypedName", "src": "1465:6:1", "type": "" } ], "returnVariables": [ { "name": "tail", "nodeType": "YulTypedName", "src": "1476:4:1", "type": "" } ], "src": "1383:222:1" } ] }, "contents": "{\n\n function allocate_unbounded() -> memPtr {\n memPtr := mload(64)\n }\n\n function revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() {\n revert(0, 0)\n }\n\n function revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db() {\n revert(0, 0)\n }\n\n function cleanup_t_uint256(value) -> cleaned {\n cleaned := value\n }\n\n function validator_revert_t_uint256(value) {\n if iszero(eq(value, cleanup_t_uint256(value))) { revert(0, 0) }\n }\n\n function abi_decode_t_uint256(offset, end) -> value {\n value := calldataload(offset)\n validator_revert_t_uint256(value)\n }\n\n function abi_decode_tuple_t_uint256(headStart, dataEnd) -> value0 {\n if slt(sub(dataEnd, headStart), 32) { revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b() }\n\n {\n\n let offset := 0\n\n value0 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function cleanup_t_uint160(value) -> cleaned {\n cleaned := and(value, 0xffffffffffffffffffffffffffffffffffffffff)\n }\n\n function cleanup_t_address(value) -> cleaned {\n cleaned := cleanup_t_uint160(value)\n }\n\n function abi_encode_t_address_to_t_address_fromStack(value, pos) {\n mstore(pos, cleanup_t_address(value))\n }\n\n function abi_encode_tuple_t_address__to_t_address__fromStack_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_address_to_t_address_fromStack(value0, add(headStart, 0))\n\n }\n\n}\n", "id": 1, "language": "Yul", "name": "#utility.yul" } ], "sourceMap": "66:373:0:-:0;;;120:49;;;;;;;;;;152:10;144:5;;:18;;;;;;;;;;;;;;;;;;66:373;;;;;;", "deployedSourceMap": "66:373:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;258:140;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;93:20;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;258:140;228:5;;;;;;;;;;214:19;;:10;:19;;;206:28;;;;;;334:9:::1;324:6;:19;;316:28;;;::::0;::::1;;363:10;355:28;;:36;384:6;355:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;258:140:::0;:::o;93:20::-;;;;;;;;;;;;:::o;88:117:1:-;197:1;194;187:12;334:77;371:7;400:5;389:16;;334:77;;;:::o;417:122::-;490:24;508:5;490:24;:::i;:::-;483:5;480:35;470:63;;529:1;526;519:12;470:63;417:122;:::o;545:139::-;591:5;629:6;616:20;607:29;;645:33;672:5;645:33;:::i;:::-;545:139;;;;:::o;690:329::-;749:6;798:2;786:9;777:7;773:23;769:32;766:119;;;804:79;;:::i;:::-;766:119;924:1;949:53;994:7;985:6;974:9;970:22;949:53;:::i;:::-;939:63;;895:117;690:329;;;;:::o;1025:126::-;1062:7;1102:42;1095:5;1091:54;1080:65;;1025:126;;;:::o;1157:96::-;1194:7;1223:24;1241:5;1223:24;:::i;:::-;1212:35;;1157:96;;;:::o;1259:118::-;1346:24;1364:5;1346:24;:::i;:::-;1341:3;1334:37;1259:118;;:::o;1383:222::-;1476:4;1514:2;1503:9;1499:18;1491:26;;1527:71;1595:1;1584:9;1580:17;1571:6;1527:71;:::i;:::-;1383:222;;;;:::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity >=0.4.22 <0.9.0;\n\ncontract Faucet {\n \n address public owner;\n\n constructor() {\n owner = msg.sender;\n }\n\n modifier onlyOwner() {\n require(msg.sender == owner);\n _;\n }\n\n function withdraw(uint amount) public onlyOwner {\n require(amount <= 100 ether);\n\n payable(msg.sender).transfer(amount);\n }\n\n receive() external payable{\n }\n}\n", "sourcePath": "/home/snsd0805/code/1112_blockchain/HW1_with_Truffle/contracts/Faucet.sol", "ast": { "absolutePath": "project:/contracts/Faucet.sol", "exportedSymbols": { "Faucet": [ 51 ] }, "id": 52, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", ">=", "0.4", ".22", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "32:32:0" }, { "abstract": false, "baseContracts": [], "canonicalName": "Faucet", "contractDependencies": [], "contractKind": "contract", "fullyImplemented": true, "id": 51, "linearizedBaseContracts": [ 51 ], "name": "Faucet", "nameLocation": "75:6:0", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "8da5cb5b", "id": 3, "mutability": "mutable", "name": "owner", "nameLocation": "108:5:0", "nodeType": "VariableDeclaration", "scope": 51, "src": "93:20:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 2, "name": "address", "nodeType": "ElementaryTypeName", "src": "93:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "public" }, { "body": { "id": 11, "nodeType": "Block", "src": "134:35:0", "statements": [ { "expression": { "id": 9, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 6, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "144:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "expression": { "id": 7, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967281, "src": "152:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 8, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "156:6:0", "memberName": "sender", "nodeType": "MemberAccess", "src": "152:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "144:18:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 10, "nodeType": "ExpressionStatement", "src": "144:18:0" } ] }, "id": 12, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 4, "nodeType": "ParameterList", "parameters": [], "src": "131:2:0" }, "returnParameters": { "id": 5, "nodeType": "ParameterList", "parameters": [], "src": "134:0:0" }, "scope": 51, "src": "120:49:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 22, "nodeType": "Block", "src": "196:56:0", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 18, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "expression": { "id": 15, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967281, "src": "214:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 16, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "218:6:0", "memberName": "sender", "nodeType": "MemberAccess", "src": "214:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "id": 17, "name": "owner", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "228:5:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "214:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 14, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "206:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 19, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "206:28:0", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 20, "nodeType": "ExpressionStatement", "src": "206:28:0" }, { "id": 21, "nodeType": "PlaceholderStatement", "src": "244:1:0" } ] }, "id": 23, "name": "onlyOwner", "nameLocation": "184:9:0", "nodeType": "ModifierDefinition", "parameters": { "id": 13, "nodeType": "ParameterList", "parameters": [], "src": "193:2:0" }, "src": "175:77:0", "virtual": false, "visibility": "internal" }, { "body": { "id": 45, "nodeType": "Block", "src": "306:92:0", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 33, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 31, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "324:6:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "hexValue": "313030", "id": 32, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "334:9:0", "subdenomination": "ether", "typeDescriptions": { "typeIdentifier": "t_rational_100000000000000000000_by_1", "typeString": "int_const 100000000000000000000" }, "value": "100" }, "src": "324:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 30, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "316:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 34, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "316:28:0", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 35, "nodeType": "ExpressionStatement", "src": "316:28:0" }, { "expression": { "arguments": [ { "id": 42, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 25, "src": "384:6:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "arguments": [ { "expression": { "id": 38, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967281, "src": "363:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 39, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "367:6:0", "memberName": "sender", "nodeType": "MemberAccess", "src": "363:10:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 37, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "355:8:0", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_payable_$", "typeString": "type(address payable)" }, "typeName": { "id": 36, "name": "address", "nodeType": "ElementaryTypeName", "src": "355:8:0", "stateMutability": "payable", "typeDescriptions": {} } }, "id": 40, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "355:19:0", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "id": 41, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "375:8:0", "memberName": "transfer", "nodeType": "MemberAccess", "src": "355:28:0", "typeDescriptions": { "typeIdentifier": "t_function_transfer_nonpayable$_t_uint256_$returns$__$", "typeString": "function (uint256)" } }, "id": 43, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "355:36:0", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 44, "nodeType": "ExpressionStatement", "src": "355:36:0" } ] }, "functionSelector": "2e1a7d4d", "id": 46, "implemented": true, "kind": "function", "modifiers": [ { "id": 28, "kind": "modifierInvocation", "modifierName": { "id": 27, "name": "onlyOwner", "nameLocations": [ "296:9:0" ], "nodeType": "IdentifierPath", "referencedDeclaration": 23, "src": "296:9:0" }, "nodeType": "ModifierInvocation", "src": "296:9:0" } ], "name": "withdraw", "nameLocation": "267:8:0", "nodeType": "FunctionDefinition", "parameters": { "id": 26, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 25, "mutability": "mutable", "name": "amount", "nameLocation": "281:6:0", "nodeType": "VariableDeclaration", "scope": 46, "src": "276:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 24, "name": "uint", "nodeType": "ElementaryTypeName", "src": "276:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "275:13:0" }, "returnParameters": { "id": 29, "nodeType": "ParameterList", "parameters": [], "src": "306:0:0" }, "scope": 51, "src": "258:140:0", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 49, "nodeType": "Block", "src": "430:7:0", "statements": [] }, "id": 50, "implemented": true, "kind": "receive", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 47, "nodeType": "ParameterList", "parameters": [], "src": "411:2:0" }, "returnParameters": { "id": 48, "nodeType": "ParameterList", "parameters": [], "src": "430:0:0" }, "scope": 51, "src": "404:33:0", "stateMutability": "payable", "virtual": false, "visibility": "external" } ], "scope": 52, "src": "66:373:0", "usedErrors": [] } ], "src": "32:408:0" }, "compiler": { "name": "solc", "version": "0.8.19+commit.7dd6d404.Emscripten.clang" }, "networks": { "5777": { "events": {}, "links": {}, "address": "0xd613B1eb50cEd9682C51Fc87ae1C6EBF70300116", "transactionHash": "0xb88e8a7cc39c6c7a0855476fa4513c14f841643f90cc51eb6f25eb7b7cfd858d" } }, "schemaVersion": "3.4.13", "updatedAt": "2023-03-16T16:01:01.946Z", "networkType": "ethereum", "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }