@etherisc/registry-contracts
Version:
Etherisc's smart contracts for the registry.
1,420 lines (1,419 loc) • 408 kB
JSON
{
"abi": [
{
"inputs": [],
"name": "EXP",
"outputs": [
{
"internalType": "int8",
"name": "",
"type": "int8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MULTIPLIER_HALF",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "ROUNDING_DEFAULT",
"outputs": [
{
"internalType": "enum UFixedType.Rounding",
"name": "",
"type": "uint8"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "decimals",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed",
"name": "a",
"type": "uint256"
},
{
"internalType": "enum UFixedType.Rounding",
"name": "rounding",
"type": "uint8"
}
],
"name": "ftoi",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "UFixed",
"name": "a",
"type": "uint256"
}
],
"name": "ftoi",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "a",
"type": "uint256"
}
],
"name": "itof",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "a",
"type": "uint256"
},
{
"internalType": "int8",
"name": "exp",
"type": "int8"
}
],
"name": "itof",
"outputs": [
{
"internalType": "UFixed",
"name": "",
"type": "uint256"
}
],
"stateMutability": "pure",
"type": "function"
}
],
"allSourcePaths": {
"30": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/math/Math.sol",
"47": "contracts/shared/UFixedMath.sol"
},
"ast": {
"absolutePath": "contracts/shared/UFixedMath.sol",
"exportedSymbols": {
"Math": [
13636
],
"UFixed": [
5099
],
"UFixedType": [
5591
],
"addUFixed": [
5137
],
"delta": [
5410
],
"divUFixed": [
5242
],
"eqUFixed": [
5352
],
"eqz": [
5384
],
"gtUFixed": [
5264
],
"gteUFixed": [
5286
],
"gtz": [
5368
],
"ltUFixed": [
5308
],
"lteUFixed": [
5330
],
"mulUFixed": [
5201
],
"subUFixed": [
5170
]
},
"id": 5592,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5095,
"literals": [
"solidity",
"^",
"0.8",
".19"
],
"nodeType": "PragmaDirective",
"src": "39:24:47"
},
{
"absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/math/Math.sol",
"file": "@openzeppelin/contracts/utils/math/Math.sol",
"id": 5097,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 5592,
"sourceUnit": 13637,
"src": "65:65:47",
"symbolAliases": [
{
"foreign": {
"id": 5096,
"name": "Math",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 13636,
"src": "73:4:47",
"typeDescriptions": {}
},
"nameLocation": "-1:-1:-1"
}
],
"unitAlias": ""
},
{
"canonicalName": "UFixed",
"id": 5099,
"name": "UFixed",
"nameLocation": "137:6:47",
"nodeType": "UserDefinedValueTypeDefinition",
"src": "132:23:47",
"underlyingType": {
"id": 5098,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "147:7:47",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
},
{
"functionList": [
{
"definition": {
"id": 5100,
"name": "addUFixed",
"nameLocations": [
"169:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5137,
"src": "169:9:47"
},
"operator": "+"
},
{
"definition": {
"id": 5101,
"name": "subUFixed",
"nameLocations": [
"189:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5170,
"src": "189:9:47"
},
"operator": "-"
},
{
"definition": {
"id": 5102,
"name": "mulUFixed",
"nameLocations": [
"209:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5201,
"src": "209:9:47"
},
"operator": "*"
},
{
"definition": {
"id": 5103,
"name": "divUFixed",
"nameLocations": [
"229:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5242,
"src": "229:9:47"
},
"operator": "/"
},
{
"definition": {
"id": 5104,
"name": "gtUFixed",
"nameLocations": [
"249:8:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5264,
"src": "249:8:47"
},
"operator": ">"
},
{
"definition": {
"id": 5105,
"name": "gteUFixed",
"nameLocations": [
"268:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5286,
"src": "268:9:47"
},
"operator": ">="
},
{
"definition": {
"id": 5106,
"name": "ltUFixed",
"nameLocations": [
"289:8:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5308,
"src": "289:8:47"
},
"operator": "<"
},
{
"definition": {
"id": 5107,
"name": "lteUFixed",
"nameLocations": [
"308:9:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5330,
"src": "308:9:47"
},
"operator": "<="
},
{
"definition": {
"id": 5108,
"name": "eqUFixed",
"nameLocations": [
"329:8:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5352,
"src": "329:8:47"
},
"operator": "=="
}
],
"global": true,
"id": 5111,
"nodeType": "UsingForDirective",
"src": "157:211:47",
"typeName": {
"id": 5110,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5109,
"name": "UFixed",
"nameLocations": [
"354:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "354:6:47"
},
"referencedDeclaration": 5099,
"src": "354:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
},
{
"body": {
"id": 5136,
"nodeType": "Block",
"src": "430:64:47",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5133,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 5127,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5114,
"src": "469:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5125,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "455:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5126,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "462:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "455:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5128,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "455:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"arguments": [
{
"id": 5131,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5117,
"src": "488:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5129,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "474:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5130,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "481:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "474:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "474:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "455:35:47",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 5123,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "443:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5124,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "450:4:47",
"memberName": "wrap",
"nodeType": "MemberAccess",
"src": "443:11:47",
"typeDescriptions": {
"typeIdentifier": "t_function_wrap_pure$_t_uint256_$returns$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "function (uint256) pure returns (UFixed)"
}
},
"id": 5134,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "443:48:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"functionReturnParameters": 5122,
"id": 5135,
"nodeType": "Return",
"src": "436:55:47"
}
]
},
"id": 5137,
"implemented": true,
"kind": "freeFunction",
"modifiers": [],
"name": "addUFixed",
"nameLocation": "379:9:47",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5118,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5114,
"mutability": "mutable",
"name": "a",
"nameLocation": "396:1:47",
"nodeType": "VariableDeclaration",
"scope": 5137,
"src": "389:8:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5113,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5112,
"name": "UFixed",
"nameLocations": [
"389:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "389:6:47"
},
"referencedDeclaration": 5099,
"src": "389:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5117,
"mutability": "mutable",
"name": "b",
"nameLocation": "406:1:47",
"nodeType": "VariableDeclaration",
"scope": 5137,
"src": "399:8:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5116,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5115,
"name": "UFixed",
"nameLocations": [
"399:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "399:6:47"
},
"referencedDeclaration": 5099,
"src": "399:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "388:20:47"
},
"returnParameters": {
"id": 5122,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5121,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 5137,
"src": "422:6:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5120,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5119,
"name": "UFixed",
"nameLocations": [
"422:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "422:6:47"
},
"referencedDeclaration": 5099,
"src": "422:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "421:8:47"
},
"scope": 5592,
"src": "370:124:47",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 5169,
"nodeType": "Block",
"src": "556:119:47",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"function": 5286,
"id": 5152,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 5150,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5140,
"src": "570:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"id": 5151,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5143,
"src": "575:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"src": "570:6:47",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4552524f523a55464d2d3031303a4e454741544956455f524553554c54",
"id": 5153,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "578:31:47",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7e98af3dcd91d0da46308f5cc761da13dd1eced37b4aa7814a08af5cd2660f25",
"typeString": "literal_string \"ERROR:UFM-010:NEGATIVE_RESULT\""
},
"value": "ERROR:UFM-010:NEGATIVE_RESULT"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_7e98af3dcd91d0da46308f5cc761da13dd1eced37b4aa7814a08af5cd2660f25",
"typeString": "literal_string \"ERROR:UFM-010:NEGATIVE_RESULT\""
}
],
"id": 5149,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "562:7:47",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 5154,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "562:48:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5155,
"nodeType": "ExpressionStatement",
"src": "562:48:47"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 5166,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 5160,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5140,
"src": "650:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5158,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "636:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5159,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "643:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "636:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5161,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "636:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"arguments": [
{
"id": 5164,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5143,
"src": "669:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5162,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "655:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5163,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "662:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "655:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5165,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "655:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "636:35:47",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"expression": {
"id": 5156,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "624:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5157,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "631:4:47",
"memberName": "wrap",
"nodeType": "MemberAccess",
"src": "624:11:47",
"typeDescriptions": {
"typeIdentifier": "t_function_wrap_pure$_t_uint256_$returns$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "function (uint256) pure returns (UFixed)"
}
},
"id": 5167,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "624:48:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"functionReturnParameters": 5148,
"id": 5168,
"nodeType": "Return",
"src": "617:55:47"
}
]
},
"id": 5170,
"implemented": true,
"kind": "freeFunction",
"modifiers": [],
"name": "subUFixed",
"nameLocation": "505:9:47",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 5144,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5140,
"mutability": "mutable",
"name": "a",
"nameLocation": "522:1:47",
"nodeType": "VariableDeclaration",
"scope": 5170,
"src": "515:8:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5139,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5138,
"name": "UFixed",
"nameLocations": [
"515:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "515:6:47"
},
"referencedDeclaration": 5099,
"src": "515:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 5143,
"mutability": "mutable",
"name": "b",
"nameLocation": "532:1:47",
"nodeType": "VariableDeclaration",
"scope": 5170,
"src": "525:8:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5142,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5141,
"name": "UFixed",
"nameLocations": [
"525:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "525:6:47"
},
"referencedDeclaration": 5099,
"src": "525:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "514:20:47"
},
"returnParameters": {
"id": 5148,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5147,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 5170,
"src": "548:6:47",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
},
"typeName": {
"id": 5146,
"nodeType": "UserDefinedTypeName",
"pathNode": {
"id": 5145,
"name": "UFixed",
"nameLocations": [
"548:6:47"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 5099,
"src": "548:6:47"
},
"referencedDeclaration": 5099,
"src": "548:6:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
},
"visibility": "internal"
}
],
"src": "547:8:47"
},
"scope": 5592,
"src": "496:179:47",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 5200,
"nodeType": "Block",
"src": "737:86:47",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"arguments": [
{
"id": 5188,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5173,
"src": "788:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5186,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "774:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5187,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "781:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "774:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5189,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "774:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"arguments": [
{
"id": 5192,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5176,
"src": "806:1:47",
"typeDescriptions": {
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_userDefinedValueType$_UFixed_$5099",
"typeString": "UFixed"
}
],
"expression": {
"id": 5190,
"name": "UFixed",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5099,
"src": "792:6:47",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_userDefinedValueType$_UFixed_$5099_$",
"typeString": "type(UFixed)"
}
},
"id": 5191,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberLocation": "799:6:47",
"memberName": "unwrap",
"nodeType": "MemberAccess",
"src": "792:13:47",
"typeDescriptions": {
"typeIdentifier": "t_function_unwrap_pure$_t_userDefinedValueType$_UFixed_$5099_$returns$_t_uint256_$",
"typeString": "function (UFixed) pure returns (uint256)"
}
},
"id": 5193,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "792:16:47",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
{
"commonType": {
"typeIdentifier": "t_rational_1000000000000000000_by_1",
"typeString": "int_const 1000000000000000000"
},
"id": 5196,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "3130",
"id": 5194,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "810:2:47",
"typeDescriptions": {
"typeIdentifier": "t_rational_10_by_1",
"typeString": "int_const 10"
},
"value": "10"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"hexValue": "3138",
"id": 5195,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "816:2:47",
"typeDescriptions": {
"typeIdentifier": "t_rational_18_by_1",
"typeString": "int_const 18"
},
"value": "18"
},
"src": "810:8:47",
"typeDescriptions": {
"typeIdentifier": "t_rational_1000000000000000000_by_1",
"typeString": "int_const 1000000000000000000"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
{