@windfallswap/core
Version:
🎛 Core contracts for the Windfall Swap protocol
1,136 lines (1,135 loc) • 86.5 kB
JSON
{
"contractName": "Math",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/D/defi/windfall/windfallswap-core/contracts/libraries/Math.sol\":\"Math\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/D/defi/windfall/windfallswap-core/contracts/libraries/Math.sol\":{\"keccak256\":\"0x59371bbb24653eabdec42dd004bc94c70536bd655b007b3175c89561597b258b\",\"urls\":[\"bzz-raw://a17afc98200f4dacc7a1b15adcdc6515abfbf42d78354d530e9df5966c301976\",\"dweb:/ipfs/QmeNz4PfMKN2nAmNxSBqVrWw6g1b3EpRa4ZuDpHq7kafh7\"]}},\"version\":1}",
"bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158207867bd5824c0b408ad0083202b10eda2cae4177b765b62b4b10b50410fe865e164736f6c63430005100032",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a723158207867bd5824c0b408ad0083202b10eda2cae4177b765b62b4b10b50410fe865e164736f6c63430005100032",
"sourceMap": "83:540:9:-;;132:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24",
"deployedSourceMap": "83:540:9:-;;;;;;;;",
"source": "pragma solidity =0.5.16;\r\n\r\n// a library for performing various math operations\r\n\r\nlibrary Math {\r\n function min(uint x, uint y) internal pure returns (uint z) {\r\n z = x < y ? x : y;\r\n }\r\n\r\n // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method)\r\n function sqrt(uint y) internal pure returns (uint z) {\r\n if (y > 3) {\r\n z = y;\r\n uint x = y / 2 + 1;\r\n while (x < z) {\r\n z = x;\r\n x = (y / x + x) / 2;\r\n }\r\n } else if (y != 0) {\r\n z = 1;\r\n }\r\n }\r\n}\r\n",
"sourcePath": "D:\\defi\\windfall\\windfallswap-core\\contracts\\libraries\\Math.sol",
"ast": {
"absolutePath": "/D/defi/windfall/windfallswap-core/contracts/libraries/Math.sol",
"exportedSymbols": {
"Math": [
2250
]
},
"id": 2251,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2176,
"literals": [
"solidity",
"=",
"0.5",
".16"
],
"nodeType": "PragmaDirective",
"src": "0:24:9"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 2250,
"linearizedBaseContracts": [
2250
],
"name": "Math",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2194,
"nodeType": "Block",
"src": "163:36:9",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2192,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2185,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2183,
"src": "174:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2188,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2186,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2178,
"src": "178:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 2187,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2180,
"src": "182:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "178:5:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"argumentTypes": null,
"id": 2190,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2180,
"src": "190:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2191,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "178:13:9",
"trueExpression": {
"argumentTypes": null,
"id": 2189,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2178,
"src": "186:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "174:17:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2193,
"nodeType": "ExpressionStatement",
"src": "174:17:9"
}
]
},
"documentation": null,
"id": 2195,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "min",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2181,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2178,
"name": "x",
"nodeType": "VariableDeclaration",
"scope": 2195,
"src": "116:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2177,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "116:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2180,
"name": "y",
"nodeType": "VariableDeclaration",
"scope": 2195,
"src": "124:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2179,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "124:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "115:16:9"
},
"returnParameters": {
"id": 2184,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2183,
"name": "z",
"nodeType": "VariableDeclaration",
"scope": 2195,
"src": "155:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2182,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "155:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "154:8:9"
},
"scope": 2250,
"src": "103:96:9",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2248,
"nodeType": "Block",
"src": "370:250:9",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2204,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2202,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "385:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "33",
"id": 2203,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "389:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_3_by_1",
"typeString": "int_const 3"
},
"value": "3"
},
"src": "385:5:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2240,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2238,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "573:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 2239,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "578:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "573:6:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 2246,
"nodeType": "IfStatement",
"src": "569:44:9",
"trueBody": {
"id": 2245,
"nodeType": "Block",
"src": "581:32:9",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2243,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2241,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "596:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "31",
"id": 2242,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "600:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "596:5:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2244,
"nodeType": "ExpressionStatement",
"src": "596:5:9"
}
]
}
},
"id": 2247,
"nodeType": "IfStatement",
"src": "381:232:9",
"trueBody": {
"id": 2237,
"nodeType": "Block",
"src": "392:171:9",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2207,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2205,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "407:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 2206,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "411:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "407:5:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2208,
"nodeType": "ExpressionStatement",
"src": "407:5:9"
},
{
"assignments": [
2210
],
"declarations": [
{
"constant": false,
"id": 2210,
"name": "x",
"nodeType": "VariableDeclaration",
"scope": 2237,
"src": "427:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2209,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "427:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 2216,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2215,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2213,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2211,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "436:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 2212,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "440:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "436:5:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 2214,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "444:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "436:9:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "427:18:9"
},
{
"body": {
"id": 2235,
"nodeType": "Block",
"src": "474:78:9",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2222,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2220,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "493:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"id": 2221,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2210,
"src": "497:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "493:5:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2223,
"nodeType": "ExpressionStatement",
"src": "493:5:9"
},
{
"expression": {
"argumentTypes": null,
"id": 2233,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2224,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2210,
"src": "517:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2232,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2229,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2227,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2225,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2197,
"src": "522:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 2226,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2210,
"src": "526:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "522:5:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 2228,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2210,
"src": "530:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "522:9:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 2230,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "521:11:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 2231,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "535:1:9",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"src": "521:15:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "517:19:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2234,
"nodeType": "ExpressionStatement",
"src": "517:19:9"
}
]
},
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2219,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2217,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2210,
"src": "467:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 2218,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2200,
"src": "471:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "467:5:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 2236,
"nodeType": "WhileStatement",
"src": "460:92:9"
}
]
}
}
]
},
"documentation": null,
"id": 2249,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sqrt",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2198,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2197,
"name": "y",
"nodeType": "VariableDeclaration",
"scope": 2249,
"src": "331:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2196,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "331:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "330:8:9"
},
"returnParameters": {
"id": 2201,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2200,
"name": "z",
"nodeType": "VariableDeclaration",
"scope": 2249,
"src": "362:6:9",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2199,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "362:4:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "361:8:9"
},
"scope": 2250,
"src": "317:303:9",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 2251,
"src": "83:540:9"
}
],
"src": "0:625:9"
},
"legacyAST": {
"absolutePath": "/D/defi/windfall/windfallswap-core/contracts/libraries/Math.sol",
"exportedSymbols": {
"Math": [
2250
]
},
"id": 2251,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2176,
"literals": [
"solidity",
"=",
"0.5",
".16"
],
"nodeType": "PragmaDirective",
"src": "0:24:9"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 2250,
"linearizedBaseContracts": [
2250
],
"name": "Math",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2194,
"nodeType": "Block",
"src": "163:36:9",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 2192,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2185,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2183,
"src": "174:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2188,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2186,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2178,
"src": "178:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"id": 2187,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2180,
"src": "182:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "178:5:9",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"argumentTypes": null,
"id": 2190,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2180,
"src": "190:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 2191,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "178:13:9",
"trueExpression": {
"argumentTypes": null,
"id": 2189,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2178,
"src": "186:1:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "174:17:9",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},