@realitio/realitio-contracts
Version:
Collection of smart contracts for the Realitio fact verification platform
1,302 lines (1,301 loc) • 94.4 kB
JSON
{
"contractName": "RealitioSafeMath256",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bbb2af58d3a17481bbd3174717efa723a17337a77498b77c24ff037d2918fc8c0029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bbb2af58d3a17481bbd3174717efa723a17337a77498b77c24ff037d2918fc8c0029",
"sourceMap": "127:723:15:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
"deployedSourceMap": "127:723:15:-;;;;;;;;",
"source": "pragma solidity ^0.4.25;\n\n/**\n * @title ReailtioSafeMath256\n * @dev Math operations with safety checks that throw on error\n */\nlibrary RealitioSafeMath256 {\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n uint256 c = a * b;\n assert(c / a == b);\n return c;\n }\n\n function div(uint256 a, uint256 b) internal pure returns (uint256) {\n // assert(b > 0); // Solidity automatically throws when dividing by 0\n uint256 c = a / b;\n // assert(a == b * c + a % b); // There is no case in which this doesn't hold\n return c;\n }\n\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n assert(b <= a);\n return a - b;\n }\n\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n assert(c >= a);\n return c;\n }\n}\n",
"sourcePath": "/home/ed/working/realitio-contracts/truffle/contracts/RealitioSafeMath256.sol",
"ast": {
"absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/RealitioSafeMath256.sol",
"exportedSymbols": {
"RealitioSafeMath256": [
7068
]
},
"id": 7069,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6972,
"literals": [
"solidity",
"^",
"0.4",
".25"
],
"nodeType": "PragmaDirective",
"src": "0:24:15"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title ReailtioSafeMath256\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 7068,
"linearizedBaseContracts": [
7068
],
"name": "RealitioSafeMath256",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7004,
"nodeType": "Block",
"src": "226:106:15",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6983,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6981,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6974,
"src": "236:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 6982,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "241:1:15",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "236:6:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 6987,
"nodeType": "IfStatement",
"src": "232:35:15",
"trueBody": {
"id": 6986,
"nodeType": "Block",
"src": "244:23:15",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 6984,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "259:1:15",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 6980,
"id": 6985,
"nodeType": "Return",
"src": "252:8:15"
}
]
}
},
{
"assignments": [
6989
],
"declarations": [
{
"constant": false,
"id": 6989,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 7005,
"src": "272:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6988,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "272:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 6993,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6992,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6990,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6974,
"src": "284:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 6991,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6976,
"src": "288:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "284:5:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "272:17:15"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6999,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6997,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6995,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6989,
"src": "302:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 6996,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6974,
"src": "306:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "302:5:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 6998,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6976,
"src": "311:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "302:10:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 6994,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9692,
"src": "295:6:15",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 7000,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "295:18:15",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 7001,
"nodeType": "ExpressionStatement",
"src": "295:18:15"
},
{
"expression": {
"argumentTypes": null,
"id": 7002,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6989,
"src": "326:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 6980,
"id": 7003,
"nodeType": "Return",
"src": "319:8:15"
}
]
},
"documentation": null,
"id": 7005,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "mul",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6977,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6974,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 7005,
"src": "172:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6973,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "172:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6976,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 7005,
"src": "183:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6975,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "183:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "171:22:15"
},
"payable": false,
"returnParameters": {
"id": 6980,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6979,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 7005,
"src": "217:7:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 6978,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "217:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "216:9:15"
},
"scope": 7068,
"src": "159:173:15",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 7022,
"nodeType": "Block",
"src": "403:198:15",
"statements": [
{
"assignments": [
7015
],
"declarations": [
{
"constant": false,
"id": 7015,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 7023,
"src": "483:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7014,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "483:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7019,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7018,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7016,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7007,
"src": "495:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 7017,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7009,
"src": "499:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "495:5:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "483:17:15"
},
{
"expression": {
"argumentTypes": null,
"id": 7020,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7015,
"src": "595:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 7013,
"id": 7021,
"nodeType": "Return",
"src": "588:8:15"
}
]
},
"documentation": null,
"id": 7023,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "div",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 7010,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7007,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 7023,
"src": "349:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7006,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "349:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7009,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 7023,
"src": "360:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7008,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "360:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "348:22:15"
},
"payable": false,
"returnParameters": {
"id": 7013,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7012,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 7023,
"src": "394:7:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7011,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "394:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "393:9:15"
},
"scope": 7068,
"src": "336:265:15",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 7042,
"nodeType": "Block",
"src": "672:43:15",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7035,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7033,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7027,
"src": "685:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 7034,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7025,
"src": "690:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "685:6:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 7032,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9692,
"src": "678:6:15",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 7036,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "678:14:15",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 7037,
"nodeType": "ExpressionStatement",
"src": "678:14:15"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7040,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7038,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7025,
"src": "705:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 7039,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7027,
"src": "709:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "705:5:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 7031,
"id": 7041,
"nodeType": "Return",
"src": "698:12:15"
}
]
},
"documentation": null,
"id": 7043,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "sub",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 7028,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7025,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 7043,
"src": "618:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7024,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "618:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7027,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 7043,
"src": "629:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7026,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "629:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "617:22:15"
},
"payable": false,
"returnParameters": {
"id": 7031,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7030,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 7043,
"src": "663:7:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7029,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "663:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "662:9:15"
},
"scope": 7068,
"src": "605:110:15",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 7066,
"nodeType": "Block",
"src": "786:62:15",
"statements": [
{
"assignments": [
7053
],
"declarations": [
{
"constant": false,
"id": 7053,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 7067,
"src": "792:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7052,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "792:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 7057,
"initialValue": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7056,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7054,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7045,
"src": "804:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 7055,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7047,
"src": "808:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "804:5:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "792:17:15"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 7061,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 7059,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7053,
"src": "822:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 7060,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7045,
"src": "827:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "822:6:15",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 7058,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 9692,
"src": "815:6:15",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 7062,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "815:14:15",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 7063,
"nodeType": "ExpressionStatement",
"src": "815:14:15"
},
{
"expression": {
"argumentTypes": null,
"id": 7064,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 7053,
"src": "842:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 7051,
"id": 7065,
"nodeType": "Return",
"src": "835:8:15"
}
]
},
"documentation": null,
"id": 7067,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 7048,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7045,
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 7067,
"src": "732:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7044,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "732:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 7047,
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 7067,
"src": "743:9:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7046,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "743:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "731:22:15"
},
"payable": false,
"returnParameters": {
"id": 7051,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 7050,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 7067,
"src": "777:7:15",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7049,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "777:7:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "776:9:15"
},
"scope": 7068,
"src": "719:129:15",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 7069,
"src": "127:723:15"
}
],
"src": "0:851:15"
},
"legacyAST": {
"absolutePath": "/home/ed/working/realitio-contracts/truffle/contracts/RealitioSafeMath256.sol",
"exportedSymbols": {
"RealitioSafeMath256": [
7068
]
},
"id": 7069,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6972,
"literals": [
"solidity",
"^",
"0.4",
".25"
],
"nodeType": "PragmaDirective",
"src": "0:24:15"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title ReailtioSafeMath256\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 7068,
"linearizedBaseContracts": [
7068
],
"name": "RealitioSafeMath256",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 7004,
"nodeType": "Block",
"src": "226:106:15",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6983,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6981,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6974,
"src": "236:1:15",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"