9192 lines
401 KiB
JSON
9192 lines
401 KiB
JSON
{
|
|
"contractName": "DODOMath",
|
|
"abi": [],
|
|
"metadata": "{\"compiler\":{\"version\":\"0.6.9+commit.3e3065ac\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"author\":\"DODO Breeder\",\"methods\":{},\"title\":\"DODOMath\"},\"userdoc\":{\"methods\":{},\"notice\":\"Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions\"}},\"settings\":{\"compilationTarget\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol\":\"DODOMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol\":{\"keccak256\":\"0xe3f63c53706f21ad68ebeff69321682ffa83bb0552db7e4453dff9772724f657\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://64e385f8c3fbe9e485d0b1b0f90f9621bf50fe02ee7cb95a44828a255db3581f\",\"dweb:/ipfs/QmNesw9cspw1fDDumDy1BSrCeGVij1BAfAVXpfajKHGUcn\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol\":{\"keccak256\":\"0x9a093cbac4e37ed4ee5e27495dae08754bbfec81f7c0ceb57a5a7ac4f362208f\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://1ddd9e5de1c555f0d1232e148fe18574e6adaa348e792844d9011bbd39bf908f\",\"dweb:/ipfs/QmSgZNwPNqCrQC4kJNdwH3iQNasbTfw2cbTtAtNVcpqnYc\"]},\"/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol\":{\"keccak256\":\"0x57d750628881687f826b54f60cbfd46c1a172433eed892bbb123f91869886af1\",\"license\":\"Apache-2.0\",\"urls\":[\"bzz-raw://b40bd7946010ddae9679f36630510217dcaa9cb8643824f9edc8ef52bda95717\",\"dweb:/ipfs/QmZSjpfUGyrmokZyaMc74a8h6zy2qFVECPVP8VfTvzNEFb\"]}},\"version\":1}",
|
|
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204ab0f72f27dc6c0858ee116c73cf432296878159be55cb820fe425a836628a7064736f6c63430006090033",
|
|
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204ab0f72f27dc6c0858ee116c73cf432296878159be55cb820fe425a836628a7064736f6c63430006090033",
|
|
"immutableReferences": {},
|
|
"sourceMap": "379:3502:35:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
|
|
"deployedSourceMap": "379:3502:35:-:0;;;;;;;;",
|
|
"source": "/*\n\n Copyright 2020 DODO ZOO.\n SPDX-License-Identifier: Apache-2.0\n\n*/\n\npragma solidity 0.6.9;\npragma experimental ABIEncoderV2;\n\nimport {SafeMath} from \"./SafeMath.sol\";\nimport {DecimalMath} from \"./DecimalMath.sol\";\n\n/**\n * @title DODOMath\n * @author DODO Breeder\n *\n * @notice Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions\n */\nlibrary DODOMath {\n using SafeMath for uint256;\n\n /*\n Integrate dodo curve fron V1 to V2\n require V0>=V1>=V2>0\n res = (1-k)i(V1-V2)+ikV0*V0(1/V2-1/V1)\n let V1-V2=delta\n res = i*delta*(1-k+k(V0^2/V1/V2))\n */\n function _GeneralIntegrate(\n uint256 V0,\n uint256 V1,\n uint256 V2,\n uint256 i,\n uint256 k\n ) internal pure returns (uint256) {\n uint256 fairAmount = DecimalMath.mul(i, V1.sub(V2)); // i*delta\n uint256 V0V0V1V2 = DecimalMath.divCeil(V0.mul(V0).div(V1), V2);\n uint256 penalty = DecimalMath.mul(k, V0V0V1V2); // k(V0^2/V1/V2)\n return DecimalMath.mul(fairAmount, DecimalMath.ONE.sub(k).add(penalty));\n }\n\n /*\n The same with integration expression above, we have:\n i*deltaB = (Q2-Q1)*(1-k+kQ0^2/Q1/Q2)\n Given Q1 and deltaB, solve Q2\n This is a quadratic function and the standard version is\n aQ2^2 + bQ2 + c = 0, where\n a=1-k\n -b=(1-k)Q1-kQ0^2/Q1+i*deltaB\n c=-kQ0^2\n and Q2=(-b+sqrt(b^2+4(1-k)kQ0^2))/2(1-k)\n note: another root is negative, abondan\n if deltaBSig=true, then Q2>Q1\n if deltaBSig=false, then Q2<Q1\n */\n function _SolveQuadraticFunctionForTrade(\n uint256 Q0,\n uint256 Q1,\n uint256 ideltaB,\n bool deltaBSig,\n uint256 k\n ) internal pure returns (uint256) {\n // calculate -b value and sig\n // -b = (1-k)Q1-kQ0^2/Q1+i*deltaB\n uint256 kQ02Q1 = DecimalMath.mul(k, Q0).mul(Q0).div(Q1); // kQ0^2/Q1\n uint256 b = DecimalMath.mul(DecimalMath.ONE.sub(k), Q1); // (1-k)Q1\n bool minusbSig = true;\n if (deltaBSig) {\n b = b.add(ideltaB); // (1-k)Q1+i*deltaB\n } else {\n kQ02Q1 = kQ02Q1.add(ideltaB); // i*deltaB+kQ0^2/Q1\n }\n if (b >= kQ02Q1) {\n b = b.sub(kQ02Q1);\n minusbSig = true;\n } else {\n b = kQ02Q1.sub(b);\n minusbSig = false;\n }\n\n // calculate sqrt\n uint256 squareRoot = DecimalMath.mul(\n DecimalMath.ONE.sub(k).mul(4),\n DecimalMath.mul(k, Q0).mul(Q0)\n ); // 4(1-k)kQ0^2\n squareRoot = b.mul(b).add(squareRoot).sqrt(); // sqrt(b*b+4(1-k)kQ0*Q0)\n\n // final res\n uint256 denominator = DecimalMath.ONE.sub(k).mul(2); // 2(1-k)\n uint256 numerator;\n if (minusbSig) {\n numerator = b.add(squareRoot);\n } else {\n numerator = squareRoot.sub(b);\n }\n\n if (deltaBSig) {\n return DecimalMath.divFloor(numerator, denominator);\n } else {\n return DecimalMath.divCeil(numerator, denominator);\n }\n }\n\n /*\n Start from the integration function\n i*deltaB = (Q2-Q1)*(1-k+kQ0^2/Q1/Q2)\n Assume Q2=Q0, Given Q1 and deltaB, solve Q0\n let fairAmount = i*deltaB\n */\n function _SolveQuadraticFunctionForTarget(\n uint256 V1,\n uint256 k,\n uint256 fairAmount\n ) internal pure returns (uint256 V0) {\n // V0 = V1+V1*(sqrt-1)/2k\n uint256 sqrt = DecimalMath.divCeil(DecimalMath.mul(k, fairAmount).mul(4), V1);\n sqrt = sqrt.add(DecimalMath.ONE).mul(DecimalMath.ONE).sqrt();\n uint256 premium = DecimalMath.divCeil(sqrt.sub(DecimalMath.ONE), k.mul(2));\n // V0 is greater than or equal to V1 according to the solution\n return DecimalMath.mul(V1, DecimalMath.ONE.add(premium));\n }\n}\n",
|
|
"sourcePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol",
|
|
"ast": {
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol",
|
|
"exportedSymbols": {
|
|
"DODOMath": [
|
|
10992
|
|
]
|
|
},
|
|
"id": 10993,
|
|
"license": "Apache-2.0",
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 10680,
|
|
"literals": [
|
|
"solidity",
|
|
"0.6",
|
|
".9"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "78:22:35"
|
|
},
|
|
{
|
|
"id": 10681,
|
|
"literals": [
|
|
"experimental",
|
|
"ABIEncoderV2"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "101:33:35"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
|
|
"file": "./SafeMath.sol",
|
|
"id": 10683,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 10993,
|
|
"sourceUnit": 11624,
|
|
"src": "136:40:35",
|
|
"symbolAliases": [
|
|
{
|
|
"foreign": {
|
|
"argumentTypes": null,
|
|
"id": 10682,
|
|
"name": "SafeMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": null,
|
|
"src": "144:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": null,
|
|
"typeString": null
|
|
}
|
|
},
|
|
"local": null
|
|
}
|
|
],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol",
|
|
"file": "./DecimalMath.sol",
|
|
"id": 10685,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 10993,
|
|
"sourceUnit": 11079,
|
|
"src": "177:46:35",
|
|
"symbolAliases": [
|
|
{
|
|
"foreign": {
|
|
"argumentTypes": null,
|
|
"id": 10684,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": null,
|
|
"src": "185:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": null,
|
|
"typeString": null
|
|
}
|
|
},
|
|
"local": null
|
|
}
|
|
],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"abstract": false,
|
|
"baseContracts": [],
|
|
"contractDependencies": [],
|
|
"contractKind": "library",
|
|
"documentation": {
|
|
"id": 10686,
|
|
"nodeType": "StructuredDocumentation",
|
|
"src": "225:153:35",
|
|
"text": " @title DODOMath\n @author DODO Breeder\n @notice Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions"
|
|
},
|
|
"fullyImplemented": true,
|
|
"id": 10992,
|
|
"linearizedBaseContracts": [
|
|
10992
|
|
],
|
|
"name": "DODOMath",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"id": 10689,
|
|
"libraryName": {
|
|
"contractScope": null,
|
|
"id": 10687,
|
|
"name": "SafeMath",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 11623,
|
|
"src": "408:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_SafeMath_$11623",
|
|
"typeString": "library SafeMath"
|
|
}
|
|
},
|
|
"nodeType": "UsingForDirective",
|
|
"src": "402:27:35",
|
|
"typeName": {
|
|
"id": 10688,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "421:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10750,
|
|
"nodeType": "Block",
|
|
"src": "797:305:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10705
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10705,
|
|
"mutability": "mutable",
|
|
"name": "fairAmount",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "807:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10704,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "807:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10714,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10708,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10697,
|
|
"src": "844:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10711,
|
|
"name": "V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10695,
|
|
"src": "854:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10709,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10693,
|
|
"src": "847:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10710,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "847:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10712,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "847:10:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10706,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "828:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10707,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "828:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10713,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "828:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "807:51:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10716
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10716,
|
|
"mutability": "mutable",
|
|
"name": "V0V0V1V2",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "879:16:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10715,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "879:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10728,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10724,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10693,
|
|
"src": "933:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10721,
|
|
"name": "V0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10691,
|
|
"src": "925:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10719,
|
|
"name": "V0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10691,
|
|
"src": "918:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10720,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "918:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10722,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "918:10:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10723,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "div",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11499,
|
|
"src": "918:14:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10725,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "918:18:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10726,
|
|
"name": "V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10695,
|
|
"src": "938:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10717,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "898:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10718,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "898:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10727,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "898:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "879:62:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10730
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10730,
|
|
"mutability": "mutable",
|
|
"name": "penalty",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "951:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10729,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "951:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10736,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10733,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10699,
|
|
"src": "985:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10734,
|
|
"name": "V0V0V1V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10716,
|
|
"src": "988:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10731,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "969:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10732,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "969:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10735,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "969:28:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "951:46:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10739,
|
|
"name": "fairAmount",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10705,
|
|
"src": "1047:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10746,
|
|
"name": "penalty",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10730,
|
|
"src": "1086:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10743,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10699,
|
|
"src": "1079:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10740,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1059:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10741,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "1059:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10742,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "1059:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10744,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1059:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10745,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "1059:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10747,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1059:35:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10737,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1031:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10738,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1031:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10748,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1031:64:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10703,
|
|
"id": 10749,
|
|
"nodeType": "Return",
|
|
"src": "1024:71:35"
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10751,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_GeneralIntegrate",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10700,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10691,
|
|
"mutability": "mutable",
|
|
"name": "V0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "670:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10690,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "670:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10693,
|
|
"mutability": "mutable",
|
|
"name": "V1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "690:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10692,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "690:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10695,
|
|
"mutability": "mutable",
|
|
"name": "V2",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "710:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10694,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "710:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10697,
|
|
"mutability": "mutable",
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "730:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10696,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "730:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10699,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "749:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10698,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "749:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "660:104:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10703,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10702,
|
|
"mutability": "mutable",
|
|
"name": "",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "788:7:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10701,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "788:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "787:9:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "634:468:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10924,
|
|
"nodeType": "Block",
|
|
"src": "1795:1320:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10767
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10767,
|
|
"mutability": "mutable",
|
|
"name": "kQ02Q1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "1885:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10766,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1885:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10779,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10777,
|
|
"name": "Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10755,
|
|
"src": "1937:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10774,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "1929:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10770,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "1918:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10771,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "1921:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10768,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1902:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10769,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1902:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10772,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10773,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "1902:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10775,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10776,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "div",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11499,
|
|
"src": "1902:34:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10778,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:38:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "1885:55:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10781
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10781,
|
|
"mutability": "mutable",
|
|
"name": "b",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "1962:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10780,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1962:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10791,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10787,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2010:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10784,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1990:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10785,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "1990:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10786,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "1990:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10788,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1990:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10789,
|
|
"name": "Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10755,
|
|
"src": "2014:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10782,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1974:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10783,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1974:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10790,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1974:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "1962:55:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10793
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10793,
|
|
"mutability": "mutable",
|
|
"name": "minusbSig",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2038:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"typeName": {
|
|
"id": 10792,
|
|
"name": "bool",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2038:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10795,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "74727565",
|
|
"id": 10794,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2055:4:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "true"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2038:21:35"
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10796,
|
|
"name": "deltaBSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10759,
|
|
"src": "2073:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10812,
|
|
"nodeType": "Block",
|
|
"src": "2153:74:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10810,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10805,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2167:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10808,
|
|
"name": "ideltaB",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10757,
|
|
"src": "2187:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10806,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2176:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10807,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2176:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10809,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2176:19:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2167:28:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10811,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2167:28:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10813,
|
|
"nodeType": "IfStatement",
|
|
"src": "2069:158:35",
|
|
"trueBody": {
|
|
"id": 10804,
|
|
"nodeType": "Block",
|
|
"src": "2084:63:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10802,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10797,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2098:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10800,
|
|
"name": "ideltaB",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10757,
|
|
"src": "2108:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10798,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2102:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10799,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2102:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10801,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2102:14:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2098:18:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10803,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2098:18:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 10816,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 10814,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2240:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": ">=",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 10815,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2245:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2240:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10840,
|
|
"nodeType": "Block",
|
|
"src": "2331:73:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10834,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10829,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2345:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10832,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2360:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10830,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2349:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10831,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2349:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10833,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2349:13:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2345:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10835,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2345:17:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10838,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10836,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2376:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"hexValue": "66616c7365",
|
|
"id": 10837,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2388:5:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "false"
|
|
},
|
|
"src": "2376:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 10839,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2376:17:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10841,
|
|
"nodeType": "IfStatement",
|
|
"src": "2236:168:35",
|
|
"trueBody": {
|
|
"id": 10828,
|
|
"nodeType": "Block",
|
|
"src": "2253:72:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10822,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10817,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2267:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10820,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2277:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10818,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2271:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10819,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2271:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10821,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2271:13:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2267:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10823,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2267:17:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10826,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10824,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2298:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"hexValue": "74727565",
|
|
"id": 10825,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2310:4:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "true"
|
|
},
|
|
"src": "2298:16:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 10827,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2298:16:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"assignments": [
|
|
10843
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10843,
|
|
"mutability": "mutable",
|
|
"name": "squareRoot",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2440:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10842,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2440:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10863,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "34",
|
|
"id": 10852,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2517:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
},
|
|
"value": "4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10849,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2510:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10846,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2490:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10847,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "2490:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10848,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2490:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10850,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2490:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10851,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2490:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10853,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2490:29:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10860,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "2560:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10856,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2549:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10857,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "2552:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10854,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2533:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10855,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "2533:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10858,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2533:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10859,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2533:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10861,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2533:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10844,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2461:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10845,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "2461:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10862,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2461:112:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2440:133:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10874,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10864,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2598:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10870,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2624:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10867,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2617:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10865,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2611:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10866,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2611:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10868,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:8:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10869,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2611:12:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10871,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:24:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10872,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sqrt",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11622,
|
|
"src": "2611:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10873,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:31:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2598:44:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10875,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2598:44:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10877
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10877,
|
|
"mutability": "mutable",
|
|
"name": "denominator",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2700:19:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10876,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2700:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10886,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "32",
|
|
"id": 10884,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2749:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
},
|
|
"value": "2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10881,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2742:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10878,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2722:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10879,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "2722:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10880,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2722:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10882,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2722:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10883,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2722:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10885,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2722:29:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2700:51:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10888
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10888,
|
|
"mutability": "mutable",
|
|
"name": "numerator",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2771:17:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10887,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2771:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10889,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2771:17:35"
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10890,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2802:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10906,
|
|
"nodeType": "Block",
|
|
"src": "2873:54:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10904,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10899,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2887:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10902,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2914:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10900,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2899:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10901,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2899:14:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10903,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2899:17:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2887:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10905,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2887:29:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10907,
|
|
"nodeType": "IfStatement",
|
|
"src": "2798:129:35",
|
|
"trueBody": {
|
|
"id": 10898,
|
|
"nodeType": "Block",
|
|
"src": "2813:54:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10896,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10891,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2827:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10894,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2845:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10892,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2839:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10893,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2839:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10895,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2839:17:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2827:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10897,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2827:29:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10908,
|
|
"name": "deltaBSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10759,
|
|
"src": "2941:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10922,
|
|
"nodeType": "Block",
|
|
"src": "3034:75:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10918,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "3075:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10919,
|
|
"name": "denominator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10877,
|
|
"src": "3086:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10916,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3055:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10917,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3055:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10920,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3055:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10765,
|
|
"id": 10921,
|
|
"nodeType": "Return",
|
|
"src": "3048:50:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10923,
|
|
"nodeType": "IfStatement",
|
|
"src": "2937:172:35",
|
|
"trueBody": {
|
|
"id": 10915,
|
|
"nodeType": "Block",
|
|
"src": "2952:76:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10911,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2994:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10912,
|
|
"name": "denominator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10877,
|
|
"src": "3005:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10909,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2973:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10910,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divFloor",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11059,
|
|
"src": "2973:20:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10913,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2973:44:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10765,
|
|
"id": 10914,
|
|
"nodeType": "Return",
|
|
"src": "2966:51:35"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10925,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_SolveQuadraticFunctionForTrade",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10762,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10753,
|
|
"mutability": "mutable",
|
|
"name": "Q0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1658:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10752,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1658:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10755,
|
|
"mutability": "mutable",
|
|
"name": "Q1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1678:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10754,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1678:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10757,
|
|
"mutability": "mutable",
|
|
"name": "ideltaB",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1698:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10756,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1698:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10759,
|
|
"mutability": "mutable",
|
|
"name": "deltaBSig",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1723:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"typeName": {
|
|
"id": 10758,
|
|
"name": "bool",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1723:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10761,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1747:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10760,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1747:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "1648:114:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10765,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10764,
|
|
"mutability": "mutable",
|
|
"name": "",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1786:7:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10763,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1786:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "1785:9:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "1608:1507:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10990,
|
|
"nodeType": "Block",
|
|
"src": "3460:419:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10937
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10937,
|
|
"mutability": "mutable",
|
|
"name": "sqrt",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10990,
|
|
"src": "3504:12:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10936,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3504:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10950,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "34",
|
|
"id": 10946,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "3574:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
},
|
|
"value": "4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10942,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10929,
|
|
"src": "3555:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10943,
|
|
"name": "fairAmount",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10931,
|
|
"src": "3558:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10940,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3539:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10941,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "3539:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10944,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3539:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10945,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3539:34:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10947,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3539:37:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10948,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10927,
|
|
"src": "3578:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10938,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3519:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10939,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3519:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10949,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3519:62:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "3504:77:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10963,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10951,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3591:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10958,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3628:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10959,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3628:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10954,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3607:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10955,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3607:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10952,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3598:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10953,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "3598:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10956,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:25:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10957,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3598:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10960,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:46:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10961,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sqrt",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11622,
|
|
"src": "3598:51:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10962,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:53:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "3591:60:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10964,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "3591:60:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10966
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10966,
|
|
"mutability": "mutable",
|
|
"name": "premium",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10990,
|
|
"src": "3661:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10965,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3661:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10979,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10971,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3708:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10972,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3708:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10969,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3699:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10970,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "3699:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10973,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3699:25:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "32",
|
|
"id": 10976,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "3732:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
},
|
|
"value": "2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10974,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10929,
|
|
"src": "3726:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10975,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3726:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10977,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3726:8:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10967,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3679:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10968,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3679:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10978,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3679:56:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "3661:74:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10982,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10927,
|
|
"src": "3839:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10986,
|
|
"name": "premium",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10966,
|
|
"src": "3863:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10983,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3843:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10984,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3843:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10985,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "3843:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10987,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3843:28:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10980,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3823:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10981,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "3823:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10988,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3823:49:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10935,
|
|
"id": 10989,
|
|
"nodeType": "Return",
|
|
"src": "3816:56:35"
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10991,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_SolveQuadraticFunctionForTarget",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10932,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10927,
|
|
"mutability": "mutable",
|
|
"name": "V1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3361:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10926,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3361:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10929,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3381:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10928,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3381:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10931,
|
|
"mutability": "mutable",
|
|
"name": "fairAmount",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3400:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10930,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3400:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "3351:73:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10935,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10934,
|
|
"mutability": "mutable",
|
|
"name": "V0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3448:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10933,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3448:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "3447:12:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "3310:569:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"scope": 10993,
|
|
"src": "379:3502:35"
|
|
}
|
|
],
|
|
"src": "78:3804:35"
|
|
},
|
|
"legacyAST": {
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DODOMath.sol",
|
|
"exportedSymbols": {
|
|
"DODOMath": [
|
|
10992
|
|
]
|
|
},
|
|
"id": 10993,
|
|
"license": "Apache-2.0",
|
|
"nodeType": "SourceUnit",
|
|
"nodes": [
|
|
{
|
|
"id": 10680,
|
|
"literals": [
|
|
"solidity",
|
|
"0.6",
|
|
".9"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "78:22:35"
|
|
},
|
|
{
|
|
"id": 10681,
|
|
"literals": [
|
|
"experimental",
|
|
"ABIEncoderV2"
|
|
],
|
|
"nodeType": "PragmaDirective",
|
|
"src": "101:33:35"
|
|
},
|
|
{
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/SafeMath.sol",
|
|
"file": "./SafeMath.sol",
|
|
"id": 10683,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 10993,
|
|
"sourceUnit": 11624,
|
|
"src": "136:40:35",
|
|
"symbolAliases": [
|
|
{
|
|
"foreign": {
|
|
"argumentTypes": null,
|
|
"id": 10682,
|
|
"name": "SafeMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": null,
|
|
"src": "144:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": null,
|
|
"typeString": null
|
|
}
|
|
},
|
|
"local": null
|
|
}
|
|
],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"absolutePath": "/Users/owen/Desktop/dodo/dodo-smart-contract/contracts/lib/DecimalMath.sol",
|
|
"file": "./DecimalMath.sol",
|
|
"id": 10685,
|
|
"nodeType": "ImportDirective",
|
|
"scope": 10993,
|
|
"sourceUnit": 11079,
|
|
"src": "177:46:35",
|
|
"symbolAliases": [
|
|
{
|
|
"foreign": {
|
|
"argumentTypes": null,
|
|
"id": 10684,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": null,
|
|
"src": "185:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": null,
|
|
"typeString": null
|
|
}
|
|
},
|
|
"local": null
|
|
}
|
|
],
|
|
"unitAlias": ""
|
|
},
|
|
{
|
|
"abstract": false,
|
|
"baseContracts": [],
|
|
"contractDependencies": [],
|
|
"contractKind": "library",
|
|
"documentation": {
|
|
"id": 10686,
|
|
"nodeType": "StructuredDocumentation",
|
|
"src": "225:153:35",
|
|
"text": " @title DODOMath\n @author DODO Breeder\n @notice Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions"
|
|
},
|
|
"fullyImplemented": true,
|
|
"id": 10992,
|
|
"linearizedBaseContracts": [
|
|
10992
|
|
],
|
|
"name": "DODOMath",
|
|
"nodeType": "ContractDefinition",
|
|
"nodes": [
|
|
{
|
|
"id": 10689,
|
|
"libraryName": {
|
|
"contractScope": null,
|
|
"id": 10687,
|
|
"name": "SafeMath",
|
|
"nodeType": "UserDefinedTypeName",
|
|
"referencedDeclaration": 11623,
|
|
"src": "408:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_contract$_SafeMath_$11623",
|
|
"typeString": "library SafeMath"
|
|
}
|
|
},
|
|
"nodeType": "UsingForDirective",
|
|
"src": "402:27:35",
|
|
"typeName": {
|
|
"id": 10688,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "421:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10750,
|
|
"nodeType": "Block",
|
|
"src": "797:305:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10705
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10705,
|
|
"mutability": "mutable",
|
|
"name": "fairAmount",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "807:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10704,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "807:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10714,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10708,
|
|
"name": "i",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10697,
|
|
"src": "844:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10711,
|
|
"name": "V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10695,
|
|
"src": "854:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10709,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10693,
|
|
"src": "847:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10710,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "847:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10712,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "847:10:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10706,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "828:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10707,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "828:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10713,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "828:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "807:51:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10716
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10716,
|
|
"mutability": "mutable",
|
|
"name": "V0V0V1V2",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "879:16:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10715,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "879:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10728,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10724,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10693,
|
|
"src": "933:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10721,
|
|
"name": "V0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10691,
|
|
"src": "925:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10719,
|
|
"name": "V0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10691,
|
|
"src": "918:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10720,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "918:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10722,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "918:10:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10723,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "div",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11499,
|
|
"src": "918:14:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10725,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "918:18:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10726,
|
|
"name": "V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10695,
|
|
"src": "938:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10717,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "898:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10718,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "898:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10727,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "898:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "879:62:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10730
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10730,
|
|
"mutability": "mutable",
|
|
"name": "penalty",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10750,
|
|
"src": "951:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10729,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "951:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10736,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10733,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10699,
|
|
"src": "985:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10734,
|
|
"name": "V0V0V1V2",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10716,
|
|
"src": "988:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10731,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "969:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10732,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "969:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10735,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "969:28:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "951:46:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10739,
|
|
"name": "fairAmount",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10705,
|
|
"src": "1047:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10746,
|
|
"name": "penalty",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10730,
|
|
"src": "1086:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10743,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10699,
|
|
"src": "1079:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10740,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1059:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10741,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "1059:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10742,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "1059:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10744,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1059:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10745,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "1059:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10747,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1059:35:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10737,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1031:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10738,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1031:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10748,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1031:64:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10703,
|
|
"id": 10749,
|
|
"nodeType": "Return",
|
|
"src": "1024:71:35"
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10751,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_GeneralIntegrate",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10700,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10691,
|
|
"mutability": "mutable",
|
|
"name": "V0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "670:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10690,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "670:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10693,
|
|
"mutability": "mutable",
|
|
"name": "V1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "690:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10692,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "690:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10695,
|
|
"mutability": "mutable",
|
|
"name": "V2",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "710:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10694,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "710:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10697,
|
|
"mutability": "mutable",
|
|
"name": "i",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "730:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10696,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "730:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10699,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "749:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10698,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "749:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "660:104:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10703,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10702,
|
|
"mutability": "mutable",
|
|
"name": "",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10751,
|
|
"src": "788:7:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10701,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "788:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "787:9:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "634:468:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10924,
|
|
"nodeType": "Block",
|
|
"src": "1795:1320:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10767
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10767,
|
|
"mutability": "mutable",
|
|
"name": "kQ02Q1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "1885:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10766,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1885:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10779,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10777,
|
|
"name": "Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10755,
|
|
"src": "1937:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10774,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "1929:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10770,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "1918:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10771,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "1921:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10768,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1902:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10769,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1902:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10772,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10773,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "1902:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10775,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10776,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "div",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11499,
|
|
"src": "1902:34:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10778,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1902:38:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "1885:55:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10781
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10781,
|
|
"mutability": "mutable",
|
|
"name": "b",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "1962:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10780,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1962:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10791,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10787,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2010:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10784,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1990:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10785,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "1990:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10786,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "1990:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10788,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1990:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10789,
|
|
"name": "Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10755,
|
|
"src": "2014:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10782,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "1974:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10783,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "1974:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10790,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "1974:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "1962:55:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10793
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10793,
|
|
"mutability": "mutable",
|
|
"name": "minusbSig",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2038:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"typeName": {
|
|
"id": 10792,
|
|
"name": "bool",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2038:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10795,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"hexValue": "74727565",
|
|
"id": 10794,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2055:4:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "true"
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2038:21:35"
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10796,
|
|
"name": "deltaBSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10759,
|
|
"src": "2073:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10812,
|
|
"nodeType": "Block",
|
|
"src": "2153:74:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10810,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10805,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2167:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10808,
|
|
"name": "ideltaB",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10757,
|
|
"src": "2187:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10806,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2176:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10807,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2176:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10809,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2176:19:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2167:28:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10811,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2167:28:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10813,
|
|
"nodeType": "IfStatement",
|
|
"src": "2069:158:35",
|
|
"trueBody": {
|
|
"id": 10804,
|
|
"nodeType": "Block",
|
|
"src": "2084:63:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10802,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10797,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2098:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10800,
|
|
"name": "ideltaB",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10757,
|
|
"src": "2108:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10798,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2102:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10799,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2102:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10801,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2102:14:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2098:18:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10803,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2098:18:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"commonType": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"id": 10816,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftExpression": {
|
|
"argumentTypes": null,
|
|
"id": 10814,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2240:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "BinaryOperation",
|
|
"operator": ">=",
|
|
"rightExpression": {
|
|
"argumentTypes": null,
|
|
"id": 10815,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2245:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2240:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10840,
|
|
"nodeType": "Block",
|
|
"src": "2331:73:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10834,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10829,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2345:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10832,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2360:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10830,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2349:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10831,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2349:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10833,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2349:13:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2345:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10835,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2345:17:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10838,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10836,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2376:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"hexValue": "66616c7365",
|
|
"id": 10837,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2388:5:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "false"
|
|
},
|
|
"src": "2376:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 10839,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2376:17:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10841,
|
|
"nodeType": "IfStatement",
|
|
"src": "2236:168:35",
|
|
"trueBody": {
|
|
"id": 10828,
|
|
"nodeType": "Block",
|
|
"src": "2253:72:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10822,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10817,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2267:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10820,
|
|
"name": "kQ02Q1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10767,
|
|
"src": "2277:6:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10818,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2271:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10819,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2271:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10821,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2271:13:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2267:17:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10823,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2267:17:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10826,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10824,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2298:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"hexValue": "74727565",
|
|
"id": 10825,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "bool",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2310:4:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"value": "true"
|
|
},
|
|
"src": "2298:16:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"id": 10827,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2298:16:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"assignments": [
|
|
10843
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10843,
|
|
"mutability": "mutable",
|
|
"name": "squareRoot",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2440:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10842,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2440:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10863,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "34",
|
|
"id": 10852,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2517:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
},
|
|
"value": "4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10849,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2510:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10846,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2490:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10847,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "2490:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10848,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2490:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10850,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2490:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10851,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2490:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10853,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2490:29:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10860,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "2560:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10856,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2549:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10857,
|
|
"name": "Q0",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10753,
|
|
"src": "2552:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10854,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2533:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10855,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "2533:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10858,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2533:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10859,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2533:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10861,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2533:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10844,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2461:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10845,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "2461:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10862,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2461:112:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2440:133:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10874,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10864,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2598:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10870,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2624:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10867,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2617:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10865,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2611:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10866,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2611:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10868,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:8:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10869,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2611:12:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10871,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:24:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10872,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sqrt",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11622,
|
|
"src": "2611:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10873,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2611:31:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2598:44:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10875,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2598:44:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10877
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10877,
|
|
"mutability": "mutable",
|
|
"name": "denominator",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2700:19:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10876,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2700:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10886,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "32",
|
|
"id": 10884,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "2749:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
},
|
|
"value": "2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10881,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10761,
|
|
"src": "2742:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10878,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2722:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10879,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "2722:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10880,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2722:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10882,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2722:22:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10883,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "2722:26:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10885,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2722:29:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2700:51:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10888
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10888,
|
|
"mutability": "mutable",
|
|
"name": "numerator",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10924,
|
|
"src": "2771:17:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10887,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "2771:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10889,
|
|
"initialValue": null,
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "2771:17:35"
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10890,
|
|
"name": "minusbSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10793,
|
|
"src": "2802:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10906,
|
|
"nodeType": "Block",
|
|
"src": "2873:54:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10904,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10899,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2887:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10902,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2914:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10900,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2899:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10901,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "2899:14:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10903,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2899:17:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2887:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10905,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2887:29:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10907,
|
|
"nodeType": "IfStatement",
|
|
"src": "2798:129:35",
|
|
"trueBody": {
|
|
"id": 10898,
|
|
"nodeType": "Block",
|
|
"src": "2813:54:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10896,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10891,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2827:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10894,
|
|
"name": "squareRoot",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10843,
|
|
"src": "2845:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10892,
|
|
"name": "b",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10781,
|
|
"src": "2839:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10893,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "2839:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10895,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2839:17:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "2827:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10897,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "2827:29:35"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"condition": {
|
|
"argumentTypes": null,
|
|
"id": 10908,
|
|
"name": "deltaBSig",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10759,
|
|
"src": "2941:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"falseBody": {
|
|
"id": 10922,
|
|
"nodeType": "Block",
|
|
"src": "3034:75:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10918,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "3075:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10919,
|
|
"name": "denominator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10877,
|
|
"src": "3086:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10916,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3055:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10917,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3055:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10920,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3055:43:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10765,
|
|
"id": 10921,
|
|
"nodeType": "Return",
|
|
"src": "3048:50:35"
|
|
}
|
|
]
|
|
},
|
|
"id": 10923,
|
|
"nodeType": "IfStatement",
|
|
"src": "2937:172:35",
|
|
"trueBody": {
|
|
"id": 10915,
|
|
"nodeType": "Block",
|
|
"src": "2952:76:35",
|
|
"statements": [
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10911,
|
|
"name": "numerator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10888,
|
|
"src": "2994:9:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10912,
|
|
"name": "denominator",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10877,
|
|
"src": "3005:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10909,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "2973:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10910,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divFloor",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11059,
|
|
"src": "2973:20:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10913,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "2973:44:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10765,
|
|
"id": 10914,
|
|
"nodeType": "Return",
|
|
"src": "2966:51:35"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10925,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_SolveQuadraticFunctionForTrade",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10762,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10753,
|
|
"mutability": "mutable",
|
|
"name": "Q0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1658:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10752,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1658:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10755,
|
|
"mutability": "mutable",
|
|
"name": "Q1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1678:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10754,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1678:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10757,
|
|
"mutability": "mutable",
|
|
"name": "ideltaB",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1698:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10756,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1698:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10759,
|
|
"mutability": "mutable",
|
|
"name": "deltaBSig",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1723:14:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
},
|
|
"typeName": {
|
|
"id": 10758,
|
|
"name": "bool",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1723:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_bool",
|
|
"typeString": "bool"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10761,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1747:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10760,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1747:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "1648:114:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10765,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10764,
|
|
"mutability": "mutable",
|
|
"name": "",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10925,
|
|
"src": "1786:7:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10763,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "1786:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "1785:9:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "1608:1507:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"body": {
|
|
"id": 10990,
|
|
"nodeType": "Block",
|
|
"src": "3460:419:35",
|
|
"statements": [
|
|
{
|
|
"assignments": [
|
|
10937
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10937,
|
|
"mutability": "mutable",
|
|
"name": "sqrt",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10990,
|
|
"src": "3504:12:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10936,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3504:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10950,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "34",
|
|
"id": 10946,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "3574:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
},
|
|
"value": "4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_4_by_1",
|
|
"typeString": "int_const 4"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10942,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10929,
|
|
"src": "3555:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10943,
|
|
"name": "fairAmount",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10931,
|
|
"src": "3558:10:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10940,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3539:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10941,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "3539:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10944,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3539:30:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10945,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3539:34:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10947,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3539:37:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10948,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10927,
|
|
"src": "3578:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10938,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3519:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10939,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3519:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10949,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3519:62:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "3504:77:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10963,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"leftHandSide": {
|
|
"argumentTypes": null,
|
|
"id": 10951,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3591:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "Assignment",
|
|
"operator": "=",
|
|
"rightHandSide": {
|
|
"argumentTypes": null,
|
|
"arguments": [],
|
|
"expression": {
|
|
"argumentTypes": [],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10958,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3628:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10959,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3628:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10954,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3607:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10955,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3607:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10952,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3598:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10953,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "3598:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10956,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:25:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10957,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3598:29:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10960,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:46:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10961,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sqrt",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11622,
|
|
"src": "3598:51:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10962,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3598:53:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"src": "3591:60:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10964,
|
|
"nodeType": "ExpressionStatement",
|
|
"src": "3591:60:35"
|
|
},
|
|
{
|
|
"assignments": [
|
|
10966
|
|
],
|
|
"declarations": [
|
|
{
|
|
"constant": false,
|
|
"id": 10966,
|
|
"mutability": "mutable",
|
|
"name": "premium",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10990,
|
|
"src": "3661:15:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10965,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3661:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"id": 10979,
|
|
"initialValue": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10971,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3708:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10972,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3708:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10969,
|
|
"name": "sqrt",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10937,
|
|
"src": "3699:4:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10970,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "sub",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11557,
|
|
"src": "3699:8:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10973,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3699:25:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"hexValue": "32",
|
|
"id": 10976,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": true,
|
|
"kind": "number",
|
|
"lValueRequested": false,
|
|
"nodeType": "Literal",
|
|
"src": "3732:1:35",
|
|
"subdenomination": null,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
},
|
|
"value": "2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_rational_2_by_1",
|
|
"typeString": "int_const 2"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10974,
|
|
"name": "k",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10929,
|
|
"src": "3726:1:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10975,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11478,
|
|
"src": "3726:5:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10977,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3726:8:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10967,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3679:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10968,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "divCeil",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11077,
|
|
"src": "3679:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10978,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3679:56:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"nodeType": "VariableDeclarationStatement",
|
|
"src": "3661:74:35"
|
|
},
|
|
{
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10982,
|
|
"name": "V1",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10927,
|
|
"src": "3839:2:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
{
|
|
"argumentTypes": null,
|
|
"arguments": [
|
|
{
|
|
"argumentTypes": null,
|
|
"id": 10986,
|
|
"name": "premium",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 10966,
|
|
"src": "3863:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10983,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3843:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10984,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "ONE",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11006,
|
|
"src": "3843:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"id": 10985,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "add",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11582,
|
|
"src": "3843:19:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$bound_to$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10987,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3843:28:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": [
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
{
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
],
|
|
"expression": {
|
|
"argumentTypes": null,
|
|
"id": 10980,
|
|
"name": "DecimalMath",
|
|
"nodeType": "Identifier",
|
|
"overloadedDeclarations": [],
|
|
"referencedDeclaration": 11078,
|
|
"src": "3823:11:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_type$_t_contract$_DecimalMath_$11078_$",
|
|
"typeString": "type(library DecimalMath)"
|
|
}
|
|
},
|
|
"id": 10981,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"lValueRequested": false,
|
|
"memberName": "mul",
|
|
"nodeType": "MemberAccess",
|
|
"referencedDeclaration": 11023,
|
|
"src": "3823:15:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_uint256_$",
|
|
"typeString": "function (uint256,uint256) pure returns (uint256)"
|
|
}
|
|
},
|
|
"id": 10988,
|
|
"isConstant": false,
|
|
"isLValue": false,
|
|
"isPure": false,
|
|
"kind": "functionCall",
|
|
"lValueRequested": false,
|
|
"names": [],
|
|
"nodeType": "FunctionCall",
|
|
"src": "3823:49:35",
|
|
"tryCall": false,
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"functionReturnParameters": 10935,
|
|
"id": 10989,
|
|
"nodeType": "Return",
|
|
"src": "3816:56:35"
|
|
}
|
|
]
|
|
},
|
|
"documentation": null,
|
|
"id": 10991,
|
|
"implemented": true,
|
|
"kind": "function",
|
|
"modifiers": [],
|
|
"name": "_SolveQuadraticFunctionForTarget",
|
|
"nodeType": "FunctionDefinition",
|
|
"overrides": null,
|
|
"parameters": {
|
|
"id": 10932,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10927,
|
|
"mutability": "mutable",
|
|
"name": "V1",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3361:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10926,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3361:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10929,
|
|
"mutability": "mutable",
|
|
"name": "k",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3381:9:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10928,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3381:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
},
|
|
{
|
|
"constant": false,
|
|
"id": 10931,
|
|
"mutability": "mutable",
|
|
"name": "fairAmount",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3400:18:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10930,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3400:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "3351:73:35"
|
|
},
|
|
"returnParameters": {
|
|
"id": 10935,
|
|
"nodeType": "ParameterList",
|
|
"parameters": [
|
|
{
|
|
"constant": false,
|
|
"id": 10934,
|
|
"mutability": "mutable",
|
|
"name": "V0",
|
|
"nodeType": "VariableDeclaration",
|
|
"overrides": null,
|
|
"scope": 10991,
|
|
"src": "3448:10:35",
|
|
"stateVariable": false,
|
|
"storageLocation": "default",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
},
|
|
"typeName": {
|
|
"id": 10933,
|
|
"name": "uint256",
|
|
"nodeType": "ElementaryTypeName",
|
|
"src": "3448:7:35",
|
|
"typeDescriptions": {
|
|
"typeIdentifier": "t_uint256",
|
|
"typeString": "uint256"
|
|
}
|
|
},
|
|
"value": null,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"src": "3447:12:35"
|
|
},
|
|
"scope": 10992,
|
|
"src": "3310:569:35",
|
|
"stateMutability": "pure",
|
|
"virtual": false,
|
|
"visibility": "internal"
|
|
}
|
|
],
|
|
"scope": 10993,
|
|
"src": "379:3502:35"
|
|
}
|
|
],
|
|
"src": "78:3804:35"
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.6.9+commit.3e3065ac.Emscripten.clang"
|
|
},
|
|
"networks": {},
|
|
"schemaVersion": "3.2.3",
|
|
"updatedAt": "2020-11-06T08:03:35.715Z",
|
|
"devdoc": {
|
|
"author": "DODO Breeder",
|
|
"methods": {},
|
|
"title": "DODOMath"
|
|
},
|
|
"userdoc": {
|
|
"methods": {},
|
|
"notice": "Functions for complex calculating. Including ONE Integration and TWO Quadratic solutions"
|
|
}
|
|
} |