{ "contractName": "ConvertLib", "abi": [ { "inputs": [ { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "uint256", "name": "conversionRate", "type": "uint256" } ], "name": "convert", "outputs": [ { "internalType": "uint256", "name": "convertedAmount", "type": "uint256" } ], "stateMutability": "pure", "type": "function", "constant": true } ], "metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"conversionRate\",\"type\":\"uint256\"}],\"name\":\"convert\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"convertedAmount\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/ConvertLib.sol\":\"ConvertLib\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/ConvertLib.sol\":{\"keccak256\":\"0x3ee33e6e8cf55bad996568ba3cd311ac174c8b4fd9fd51cd6aabf6000d5c9643\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://de003f417b98896601d7f63ab7cee95f38f237af4d56712019221644954a7509\",\"dweb:/ipfs/QmQb7FVshbroABJCpCsn6hf2gu7nqUdXvFHkWNwjRSVwkm\"]}},\"version\":1}", "bytecode": "0x6101e4610053600b82828239805160001a607314610046577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806396e4ee3d1461003a575b600080fd5b610054600480360381019061004f91906100bb565b61006a565b604051610061919061010a565b60405180910390f35b600081836100789190610154565b905092915050565b600080fd5b6000819050919050565b61009881610085565b81146100a357600080fd5b50565b6000813590506100b58161008f565b92915050565b600080604083850312156100d2576100d1610080565b5b60006100e0858286016100a6565b92505060206100f1858286016100a6565b9150509250929050565b61010481610085565b82525050565b600060208201905061011f60008301846100fb565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061015f82610085565b915061016a83610085565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156101a3576101a2610125565b5b82820290509291505056fea264697066735822122086a5cfd3205322c82cb7659874af63b9351c42f027990cf9b3307c7042a3f4bd64736f6c634300080d0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100355760003560e01c806396e4ee3d1461003a575b600080fd5b610054600480360381019061004f91906100bb565b61006a565b604051610061919061010a565b60405180910390f35b600081836100789190610154565b905092915050565b600080fd5b6000819050919050565b61009881610085565b81146100a357600080fd5b50565b6000813590506100b58161008f565b92915050565b600080604083850312156100d2576100d1610080565b5b60006100e0858286016100a6565b92505060206100f1858286016100a6565b9150509250929050565b61010481610085565b82525050565b600060208201905061011f60008301846100fb565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061015f82610085565b915061016a83610085565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156101a3576101a2610125565b5b82820290509291505056fea264697066735822122086a5cfd3205322c82cb7659874af63b9351c42f027990cf9b3307c7042a3f4bd64736f6c634300080d0033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [ { "ast": { "nodeType": "YulBlock", "src": "0:2083:3", "statements": [ { "body": { "nodeType": "YulBlock", "src": "47:35:3", "statements": [ { "nodeType": "YulAssignment", "src": "57:19:3", "value": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "73:2:3", "type": "", "value": "64" } ], "functionName": { "name": "mload", "nodeType": "YulIdentifier", "src": "67:5:3" }, "nodeType": "YulFunctionCall", "src": "67:9:3" }, "variableNames": [ { "name": "memPtr", "nodeType": "YulIdentifier", "src": "57:6:3" } ] } ] }, "name": "allocate_unbounded", "nodeType": "YulFunctionDefinition", "returnVariables": [ { "name": "memPtr", "nodeType": "YulTypedName", "src": "40:6:3", "type": "" } ], "src": "7:75:3" }, { "body": { "nodeType": "YulBlock", "src": "177:28:3", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "194:1:3", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "197:1:3", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "187:6:3" }, "nodeType": "YulFunctionCall", "src": "187:12:3" }, "nodeType": "YulExpressionStatement", "src": "187:12:3" } ] }, "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulFunctionDefinition", "src": "88:117:3" }, { "body": { "nodeType": "YulBlock", "src": "300:28:3", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "317:1:3", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "320:1:3", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "310:6:3" }, "nodeType": "YulFunctionCall", "src": "310:12:3" }, "nodeType": "YulExpressionStatement", "src": "310:12:3" } ] }, "name": "revert_error_c1322bf8034eace5e0b5c7295db60986aa89aae5e0ea0873e4689e076861a5db", "nodeType": "YulFunctionDefinition", "src": "211:117:3" }, { "body": { "nodeType": "YulBlock", "src": "379:32:3", "statements": [ { "nodeType": "YulAssignment", "src": "389:16:3", "value": { "name": "value", "nodeType": "YulIdentifier", "src": "400:5:3" }, "variableNames": [ { "name": "cleaned", "nodeType": "YulIdentifier", "src": "389:7:3" } ] } ] }, "name": "cleanup_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "361:5:3", "type": "" } ], "returnVariables": [ { "name": "cleaned", "nodeType": "YulTypedName", "src": "371:7:3", "type": "" } ], "src": "334:77:3" }, { "body": { "nodeType": "YulBlock", "src": "460:79:3", "statements": [ { "body": { "nodeType": "YulBlock", "src": "517:16:3", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "526:1:3", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "529:1:3", "type": "", "value": "0" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "519:6:3" }, "nodeType": "YulFunctionCall", "src": "519:12:3" }, "nodeType": "YulExpressionStatement", "src": "519:12:3" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "483:5:3" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "508:5:3" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", "src": "490:17:3" }, "nodeType": "YulFunctionCall", "src": "490:24:3" } ], "functionName": { "name": "eq", "nodeType": "YulIdentifier", "src": "480:2:3" }, "nodeType": "YulFunctionCall", "src": "480:35:3" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "473:6:3" }, "nodeType": "YulFunctionCall", "src": "473:43:3" }, "nodeType": "YulIf", "src": "470:63:3" } ] }, "name": "validator_revert_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "453:5:3", "type": "" } ], "src": "417:122:3" }, { "body": { "nodeType": "YulBlock", "src": "597:87:3", "statements": [ { "nodeType": "YulAssignment", "src": "607:29:3", "value": { "arguments": [ { "name": "offset", "nodeType": "YulIdentifier", "src": "629:6:3" } ], "functionName": { "name": "calldataload", "nodeType": "YulIdentifier", "src": "616:12:3" }, "nodeType": "YulFunctionCall", "src": "616:20:3" }, "variableNames": [ { "name": "value", "nodeType": "YulIdentifier", "src": "607:5:3" } ] }, { "expression": { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "672:5:3" } ], "functionName": { "name": "validator_revert_t_uint256", "nodeType": "YulIdentifier", "src": "645:26:3" }, "nodeType": "YulFunctionCall", "src": "645:33:3" }, "nodeType": "YulExpressionStatement", "src": "645:33:3" } ] }, "name": "abi_decode_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "offset", "nodeType": "YulTypedName", "src": "575:6:3", "type": "" }, { "name": "end", "nodeType": "YulTypedName", "src": "583:3:3", "type": "" } ], "returnVariables": [ { "name": "value", "nodeType": "YulTypedName", "src": "591:5:3", "type": "" } ], "src": "545:139:3" }, { "body": { "nodeType": "YulBlock", "src": "773:391:3", "statements": [ { "body": { "nodeType": "YulBlock", "src": "819:83:3", "statements": [ { "expression": { "arguments": [], "functionName": { "name": "revert_error_dbdddcbe895c83990c08b3492a0e83918d802a52331272ac6fdb6a7c4aea3b1b", "nodeType": "YulIdentifier", "src": "821:77:3" }, "nodeType": "YulFunctionCall", "src": "821:79:3" }, "nodeType": "YulExpressionStatement", "src": "821:79:3" } ] }, "condition": { "arguments": [ { "arguments": [ { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "794:7:3" }, { "name": "headStart", "nodeType": "YulIdentifier", "src": "803:9:3" } ], "functionName": { "name": "sub", "nodeType": "YulIdentifier", "src": "790:3:3" }, "nodeType": "YulFunctionCall", "src": "790:23:3" }, { "kind": "number", "nodeType": "YulLiteral", "src": "815:2:3", "type": "", "value": "64" } ], "functionName": { "name": "slt", "nodeType": "YulIdentifier", "src": "786:3:3" }, "nodeType": "YulFunctionCall", "src": "786:32:3" }, "nodeType": "YulIf", "src": "783:119:3" }, { "nodeType": "YulBlock", "src": "912:117:3", "statements": [ { "nodeType": "YulVariableDeclaration", "src": "927:15:3", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "941:1:3", "type": "", "value": "0" }, "variables": [ { "name": "offset", "nodeType": "YulTypedName", "src": "931:6:3", "type": "" } ] }, { "nodeType": "YulAssignment", "src": "956:63:3", "value": { "arguments": [ { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "991:9:3" }, { "name": "offset", "nodeType": "YulIdentifier", "src": "1002:6:3" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "987:3:3" }, "nodeType": "YulFunctionCall", "src": "987:22:3" }, { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "1011:7:3" } ], "functionName": { "name": "abi_decode_t_uint256", "nodeType": "YulIdentifier", "src": "966:20:3" }, "nodeType": "YulFunctionCall", "src": "966:53:3" }, "variableNames": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "956:6:3" } ] } ] }, { "nodeType": "YulBlock", "src": "1039:118:3", "statements": [ { "nodeType": "YulVariableDeclaration", "src": "1054:16:3", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "1068:2:3", "type": "", "value": "32" }, "variables": [ { "name": "offset", "nodeType": "YulTypedName", "src": "1058:6:3", "type": "" } ] }, { "nodeType": "YulAssignment", "src": "1084:63:3", "value": { "arguments": [ { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "1119:9:3" }, { "name": "offset", "nodeType": "YulIdentifier", "src": "1130:6:3" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "1115:3:3" }, "nodeType": "YulFunctionCall", "src": "1115:22:3" }, { "name": "dataEnd", "nodeType": "YulIdentifier", "src": "1139:7:3" } ], "functionName": { "name": "abi_decode_t_uint256", "nodeType": "YulIdentifier", "src": "1094:20:3" }, "nodeType": "YulFunctionCall", "src": "1094:53:3" }, "variableNames": [ { "name": "value1", "nodeType": "YulIdentifier", "src": "1084:6:3" } ] } ] } ] }, "name": "abi_decode_tuple_t_uint256t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", "nodeType": "YulTypedName", "src": "735:9:3", "type": "" }, { "name": "dataEnd", "nodeType": "YulTypedName", "src": "746:7:3", "type": "" } ], "returnVariables": [ { "name": "value0", "nodeType": "YulTypedName", "src": "758:6:3", "type": "" }, { "name": "value1", "nodeType": "YulTypedName", "src": "766:6:3", "type": "" } ], "src": "690:474:3" }, { "body": { "nodeType": "YulBlock", "src": "1243:53:3", "statements": [ { "expression": { "arguments": [ { "name": "pos", "nodeType": "YulIdentifier", "src": "1260:3:3" }, { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "1283:5:3" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", "src": "1265:17:3" }, "nodeType": "YulFunctionCall", "src": "1265:24:3" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "1253:6:3" }, "nodeType": "YulFunctionCall", "src": "1253:37:3" }, "nodeType": "YulExpressionStatement", "src": "1253:37:3" } ] }, "name": "abi_encode_t_uint256_to_t_uint256_fromStack_library", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "value", "nodeType": "YulTypedName", "src": "1231:5:3", "type": "" }, { "name": "pos", "nodeType": "YulTypedName", "src": "1238:3:3", "type": "" } ], "src": "1170:126:3" }, { "body": { "nodeType": "YulBlock", "src": "1408:132:3", "statements": [ { "nodeType": "YulAssignment", "src": "1418:26:3", "value": { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "1430:9:3" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1441:2:3", "type": "", "value": "32" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "1426:3:3" }, "nodeType": "YulFunctionCall", "src": "1426:18:3" }, "variableNames": [ { "name": "tail", "nodeType": "YulIdentifier", "src": "1418:4:3" } ] }, { "expression": { "arguments": [ { "name": "value0", "nodeType": "YulIdentifier", "src": "1506:6:3" }, { "arguments": [ { "name": "headStart", "nodeType": "YulIdentifier", "src": "1519:9:3" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1530:1:3", "type": "", "value": "0" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "1515:3:3" }, "nodeType": "YulFunctionCall", "src": "1515:17:3" } ], "functionName": { "name": "abi_encode_t_uint256_to_t_uint256_fromStack_library", "nodeType": "YulIdentifier", "src": "1454:51:3" }, "nodeType": "YulFunctionCall", "src": "1454:79:3" }, "nodeType": "YulExpressionStatement", "src": "1454:79:3" } ] }, "name": "abi_encode_tuple_t_uint256__to_t_uint256__fromStack_library_reversed", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "headStart", "nodeType": "YulTypedName", "src": "1380:9:3", "type": "" }, { "name": "value0", "nodeType": "YulTypedName", "src": "1392:6:3", "type": "" } ], "returnVariables": [ { "name": "tail", "nodeType": "YulTypedName", "src": "1403:4:3", "type": "" } ], "src": "1302:238:3" }, { "body": { "nodeType": "YulBlock", "src": "1574:152:3", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1591:1:3", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1594:77:3", "type": "", "value": "35408467139433450592217433187231851964531694900788300625387963629091585785856" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "1584:6:3" }, "nodeType": "YulFunctionCall", "src": "1584:88:3" }, "nodeType": "YulExpressionStatement", "src": "1584:88:3" }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1688:1:3", "type": "", "value": "4" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1691:4:3", "type": "", "value": "0x11" } ], "functionName": { "name": "mstore", "nodeType": "YulIdentifier", "src": "1681:6:3" }, "nodeType": "YulFunctionCall", "src": "1681:15:3" }, "nodeType": "YulExpressionStatement", "src": "1681:15:3" }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1712:1:3", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1715:4:3", "type": "", "value": "0x24" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "1705:6:3" }, "nodeType": "YulFunctionCall", "src": "1705:15:3" }, "nodeType": "YulExpressionStatement", "src": "1705:15:3" } ] }, "name": "panic_error_0x11", "nodeType": "YulFunctionDefinition", "src": "1546:180:3" }, { "body": { "nodeType": "YulBlock", "src": "1780:300:3", "statements": [ { "nodeType": "YulAssignment", "src": "1790:25:3", "value": { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "1813:1:3" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", "src": "1795:17:3" }, "nodeType": "YulFunctionCall", "src": "1795:20:3" }, "variableNames": [ { "name": "x", "nodeType": "YulIdentifier", "src": "1790:1:3" } ] }, { "nodeType": "YulAssignment", "src": "1824:25:3", "value": { "arguments": [ { "name": "y", "nodeType": "YulIdentifier", "src": "1847:1:3" } ], "functionName": { "name": "cleanup_t_uint256", "nodeType": "YulIdentifier", "src": "1829:17:3" }, "nodeType": "YulFunctionCall", "src": "1829:20:3" }, "variableNames": [ { "name": "y", "nodeType": "YulIdentifier", "src": "1824:1:3" } ] }, { "body": { "nodeType": "YulBlock", "src": "2022:22:3", "statements": [ { "expression": { "arguments": [], "functionName": { "name": "panic_error_0x11", "nodeType": "YulIdentifier", "src": "2024:16:3" }, "nodeType": "YulFunctionCall", "src": "2024:18:3" }, "nodeType": "YulExpressionStatement", "src": "2024:18:3" } ] }, "condition": { "arguments": [ { "arguments": [ { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "1934:1:3" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "1927:6:3" }, "nodeType": "YulFunctionCall", "src": "1927:9:3" } ], "functionName": { "name": "iszero", "nodeType": "YulIdentifier", "src": "1920:6:3" }, "nodeType": "YulFunctionCall", "src": "1920:17:3" }, { "arguments": [ { "name": "y", "nodeType": "YulIdentifier", "src": "1942:1:3" }, { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1949:66:3", "type": "", "value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" }, { "name": "x", "nodeType": "YulIdentifier", "src": "2017:1:3" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "1945:3:3" }, "nodeType": "YulFunctionCall", "src": "1945:74:3" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "1939:2:3" }, "nodeType": "YulFunctionCall", "src": "1939:81:3" } ], "functionName": { "name": "and", "nodeType": "YulIdentifier", "src": "1916:3:3" }, "nodeType": "YulFunctionCall", "src": "1916:105:3" }, "nodeType": "YulIf", "src": "1913:131:3" }, { "nodeType": "YulAssignment", "src": "2054:20:3", "value": { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "2069:1:3" }, { "name": "y", "nodeType": "YulIdentifier", "src": "2072:1:3" } ], "functionName": { "name": "mul", "nodeType": "YulIdentifier", "src": "2065:3:3" }, "nodeType": "YulFunctionCall", "src": "2065:9:3" }, "variableNames": [ { "name": "product", "nodeType": "YulIdentifier", "src": "2054:7:3" } ] } ] }, "name": "checked_mul_t_uint256", "nodeType": "YulFunctionDefinition", "parameters": [ { "name": "x", "nodeType": "YulTypedName", "src": "1763:1:3", "type": "" }, { "name": "y", "nodeType": "YulTypedName", "src": "1766:1:3", "type": "" } ], "returnVariables": [ { "name": "product", "nodeType": "YulTypedName", "src": "1772:7:3", "type": "" } ], "src": "1732:348:3" } ] }, "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_uint256t_uint256(headStart, dataEnd) -> value0, value1 {\n if slt(sub(dataEnd, headStart), 64) { 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 let offset := 32\n\n value1 := abi_decode_t_uint256(add(headStart, offset), dataEnd)\n }\n\n }\n\n function abi_encode_t_uint256_to_t_uint256_fromStack_library(value, pos) {\n mstore(pos, cleanup_t_uint256(value))\n }\n\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_library_reversed(headStart , value0) -> tail {\n tail := add(headStart, 32)\n\n abi_encode_t_uint256_to_t_uint256_fromStack_library(value0, add(headStart, 0))\n\n }\n\n function panic_error_0x11() {\n mstore(0, 35408467139433450592217433187231851964531694900788300625387963629091585785856)\n mstore(4, 0x11)\n revert(0, 0x24)\n }\n\n function checked_mul_t_uint256(x, y) -> product {\n x := cleanup_t_uint256(x)\n y := cleanup_t_uint256(y)\n\n // overflow, if x != 0 and y > (maxValue / x)\n if and(iszero(iszero(x)), gt(y, div(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, x))) { panic_error_0x11() }\n\n product := mul(x, y)\n }\n\n}\n", "id": 3, "language": "Yul", "name": "#utility.yul" } ], "sourceMap": "197:156:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "197:156:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;218:133;;;;;;;;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;;290:20;333:14;324:6;:23;;;;:::i;:::-;317:30;;218:133;;;;:::o;88:117:3:-;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:474::-;758:6;766;815:2;803:9;794:7;790:23;786:32;783:119;;;821:79;;:::i;:::-;783:119;941:1;966:53;1011:7;1002:6;991:9;987:22;966:53;:::i;:::-;956:63;;912:117;1068:2;1094:53;1139:7;1130:6;1119:9;1115:22;1094:53;:::i;:::-;1084:63;;1039:118;690:474;;;;;:::o;1170:126::-;1265:24;1283:5;1265:24;:::i;:::-;1260:3;1253:37;1170:126;;:::o;1302:238::-;1403:4;1441:2;1430:9;1426:18;1418:26;;1454:79;1530:1;1519:9;1515:17;1506:6;1454:79;:::i;:::-;1302:238;;;;:::o;1546:180::-;1594:77;1591:1;1584:88;1691:4;1688:1;1681:15;1715:4;1712:1;1705:15;1732:348;1772:7;1795:20;1813:1;1795:20;:::i;:::-;1790:25;;1829:20;1847:1;1829:20;:::i;:::-;1824:25;;2017:1;1949:66;1945:74;1942:1;1939:81;1934:1;1927:9;1920:17;1916:105;1913:131;;;2024:18;;:::i;:::-;1913:131;2072:1;2069;2065:9;2054:20;;1732:348;;;;:::o", "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.13;\n\n// A library is like a contract with reusable code, which can be called by other contracts.\n// Deploying common code can reduce gas costs.\nlibrary ConvertLib{\n\tfunction convert(uint amount, uint conversionRate) public pure returns (uint convertedAmount)\n\t{\n\t\treturn amount * conversionRate;\n\t}\n}\n", "sourcePath": "/home/matze/Programming/legacy/truffle/contracts/ConvertLib.sol", "ast": { "absolutePath": "project:/contracts/ConvertLib.sol", "exportedSymbols": { "ConvertLib": [ 16 ] }, "id": 17, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.8", ".13" ], "nodeType": "PragmaDirective", "src": "32:24:0" }, { "abstract": false, "baseContracts": [], "canonicalName": "ConvertLib", "contractDependencies": [], "contractKind": "library", "fullyImplemented": true, "id": 16, "linearizedBaseContracts": [ 16 ], "name": "ConvertLib", "nameLocation": "205:10:0", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 14, "nodeType": "Block", "src": "313:38:0", "statements": [ { "expression": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 10, "name": "amount", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3, "src": "324:6:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "id": 11, "name": "conversionRate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5, "src": "333:14:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "324:23:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 9, "id": 13, "nodeType": "Return", "src": "317:30:0" } ] }, "functionSelector": "96e4ee3d", "id": 15, "implemented": true, "kind": "function", "modifiers": [], "name": "convert", "nameLocation": "227:7:0", "nodeType": "FunctionDefinition", "parameters": { "id": 6, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 3, "mutability": "mutable", "name": "amount", "nameLocation": "240:6:0", "nodeType": "VariableDeclaration", "scope": 15, "src": "235:11:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2, "name": "uint", "nodeType": "ElementaryTypeName", "src": "235:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 5, "mutability": "mutable", "name": "conversionRate", "nameLocation": "253:14:0", "nodeType": "VariableDeclaration", "scope": 15, "src": "248:19:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 4, "name": "uint", "nodeType": "ElementaryTypeName", "src": "248:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "234:34:0" }, "returnParameters": { "id": 9, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8, "mutability": "mutable", "name": "convertedAmount", "nameLocation": "295:15:0", "nodeType": "VariableDeclaration", "scope": 15, "src": "290:20:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7, "name": "uint", "nodeType": "ElementaryTypeName", "src": "290:4:0", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "289:22:0" }, "scope": 16, "src": "218:133:0", "stateMutability": "pure", "virtual": false, "visibility": "public" } ], "scope": 17, "src": "197:156:0", "usedErrors": [] } ], "src": "32:322:0" }, "compiler": { "name": "solc", "version": "0.8.13+commit.abaa5c0e.Emscripten.clang" }, "networks": { "1338": { "events": {}, "links": {}, "address": "0x6cF7a4627f90F2016CCffC027E3C0ce740D5d8fD", "transactionHash": "0x64ef60c166fb5c10ca45dade679f26717e57eeee709aea6858b8780e25176a5c" } }, "schemaVersion": "3.4.10", "updatedAt": "2022-11-12T10:55:01.119Z", "networkType": "ethereum", "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }