@kollateral/kollateral-contracts
Version:
1,170 lines • 47.6 kB
JSON
{
"contractName": "ExtendedMath",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol\":\"ExtendedMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol\":{\"keccak256\":\"0x9b4a67b1242134b64f557613259bfb51268d488cbc7b27cb2bc72c2f21f2b71f\",\"urls\":[\"bzz-raw://47bc3f04cddcbbe7a0373a074d50bbc1720ef7d73266532aab07474ea426ab43\",\"dweb:/ipfs/QmdPdivc8yXbmvDL1nG8xXHJF7qcfx6JqQoCFBv1ohDmdP\"]},\"@openzeppelin/contracts/math/SafeMath.sol\":{\"keccak256\":\"0x640b6dee7a4b830bdfd52b5031a07fc2b12209f5b2e29e5d364a7d37f69d8076\",\"urls\":[\"bzz-raw://31113152e1ddb78fe7a4197f247591ca894e93f916867beb708d8e747b6cc74f\",\"dweb:/ipfs/QmbZaJyXdpsYGykVhHH9qpVGQg9DGCxE2QufbCUy3daTgq\"]}},\"version\":1}",
"bytecode": "0x6080604052348015600f57600080fd5b50603e80601d6000396000f3fe6080604052600080fdfea265627a7a7231582066919bd9e3c87a23a0ac081351e12cc8fd81dc36e12416a59b6f89aa417f544d64736f6c63430005100032",
"deployedBytecode": "0x6080604052600080fdfea265627a7a7231582066919bd9e3c87a23a0ac081351e12cc8fd81dc36e12416a59b6f89aa417f544d64736f6c63430005100032",
"sourceMap": "78:310:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;78:310:0;;;;;;;",
"deployedSourceMap": "78:310:0:-;;;;;",
"source": "pragma solidity ^0.5.0;\n\nimport \"@openzeppelin/contracts/math/SafeMath.sol\";\n\ncontract ExtendedMath {\n using SafeMath for uint256;\n\n // divide a/b then optionally floor or ceiling\n function divAndRound(uint256 a, uint256 b, bool ceiling) internal pure returns (uint256) {\n uint256 floor = a.div(b);\n return (ceiling && a.mod(b) != 0) ? floor.add(1) : floor;\n }\n}\n",
"sourcePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol",
"ast": {
"absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol",
"exportedSymbols": {
"ExtendedMath": [
41
]
},
"id": 42,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:0"
},
{
"absolutePath": "@openzeppelin/contracts/math/SafeMath.sol",
"file": "@openzeppelin/contracts/math/SafeMath.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 42,
"sourceUnit": 2904,
"src": "25:51:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 41,
"linearizedBaseContracts": [
41
],
"name": "ExtendedMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 5,
"libraryName": {
"contractScope": null,
"id": 3,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2903,
"src": "112:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$2903",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "106:27:0",
"typeName": {
"id": 4,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "125:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"body": {
"id": 39,
"nodeType": "Block",
"src": "279:107:0",
"statements": [
{
"assignments": [
17
],
"declarations": [
{
"constant": false,
"id": 17,
"name": "floor",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "289:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "289:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 20,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "311:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 18,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "305:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 2836,
"src": "305:5:0",
"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": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "305:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "289:24:0"
},
{
"expression": {
"argumentTypes": null,
"condition": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 30,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 23,
"name": "ceiling",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "331:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 29,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 26,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "348:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 24,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "342:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 25,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mod",
"nodeType": "MemberAccess",
"referencedDeclaration": 2879,
"src": "342:5:0",
"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": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "342:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 28,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "354:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "342:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "331:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 31,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "330:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"argumentTypes": null,
"id": 36,
"name": "floor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "374:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "330:49:0",
"trueExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "31",
"id": 34,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "369:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"expression": {
"argumentTypes": null,
"id": 32,
"name": "floor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "359:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 2743,
"src": "359:9:0",
"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": 35,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "359:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15,
"id": 38,
"nodeType": "Return",
"src": "323:56:0"
}
]
},
"documentation": null,
"id": 40,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "divAndRound",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "211:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "211:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "222:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "222:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 11,
"name": "ceiling",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "233:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "233:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "210:36:0"
},
"returnParameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "270:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "270:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "269:9:0"
},
"scope": 41,
"src": "190:196:0",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 42,
"src": "78:310:0"
}
],
"src": "0:389:0"
},
"legacyAST": {
"absolutePath": "/Users/kbrizzle/code/kollateral/protocol/contracts/ExtendedMath.sol",
"exportedSymbols": {
"ExtendedMath": [
41
]
},
"id": 42,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:0"
},
{
"absolutePath": "@openzeppelin/contracts/math/SafeMath.sol",
"file": "@openzeppelin/contracts/math/SafeMath.sol",
"id": 2,
"nodeType": "ImportDirective",
"scope": 42,
"sourceUnit": 2904,
"src": "25:51:0",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 41,
"linearizedBaseContracts": [
41
],
"name": "ExtendedMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 5,
"libraryName": {
"contractScope": null,
"id": 3,
"name": "SafeMath",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2903,
"src": "112:8:0",
"typeDescriptions": {
"typeIdentifier": "t_contract$_SafeMath_$2903",
"typeString": "library SafeMath"
}
},
"nodeType": "UsingForDirective",
"src": "106:27:0",
"typeName": {
"id": 4,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "125:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"body": {
"id": 39,
"nodeType": "Block",
"src": "279:107:0",
"statements": [
{
"assignments": [
17
],
"declarations": [
{
"constant": false,
"id": 17,
"name": "floor",
"nodeType": "VariableDeclaration",
"scope": 39,
"src": "289:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 16,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "289:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 22,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 20,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "311:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 18,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "305:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "div",
"nodeType": "MemberAccess",
"referencedDeclaration": 2836,
"src": "305:5:0",
"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": 21,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "305:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "289:24:0"
},
{
"expression": {
"argumentTypes": null,
"condition": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 30,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 23,
"name": "ceiling",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "331:7:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "&&",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 29,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 26,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9,
"src": "348:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"argumentTypes": null,
"id": 24,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7,
"src": "342:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 25,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "mod",
"nodeType": "MemberAccess",
"referencedDeclaration": 2879,
"src": "342:5:0",
"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": 27,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "342:8:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 28,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "354:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "342:13:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "331:24:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"id": 31,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "330:26:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"argumentTypes": null,
"id": 36,
"name": "floor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "374:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "330:49:0",
"trueExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "31",
"id": 34,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "369:1:0",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"expression": {
"argumentTypes": null,
"id": 32,
"name": "floor",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 17,
"src": "359:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 2743,
"src": "359:9:0",
"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": 35,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "359:12:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 15,
"id": 38,
"nodeType": "Return",
"src": "323:56:0"
}
]
},
"documentation": null,
"id": 40,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "divAndRound",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "211:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "211:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 9,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "222:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "222:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 11,
"name": "ceiling",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "233:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 10,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "233:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "210:36:0"
},
"returnParameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 40,
"src": "270:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 13,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "270:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "269:9:0"
},
"scope": 41,
"src": "190:196:0",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 42,
"src": "78:310:0"
}
],
"src": "0:389:0"
},
"compiler": {
"name": "solc",
"version": "0.5.16+commit.9c3226ce.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.0.20",
"updatedAt": "2020-02-01T23:51:00.328Z",
"devdoc": {
"methods": {}
},
"userdoc": {
"methods": {}
}
}