UNPKG

@reality.eth/contracts

Version:

Collection of smart contracts for the Realitio fact verification platform

701 lines 26.4 kB
{ "contractName": "RealitioSafeMath32", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058204952f180f9a84f30bc43f6bcf266542f2bbe3e2155d11a1151d61f3a0cb90e160029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058204952f180f9a84f30bc43f6bcf266542f2bbe3e2155d11a1151d61f3a0cb90e160029", "sourceMap": "224:158:4:-;;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": "224:158:4:-;;;;;;;;", "source": "pragma solidity ^0.4.24;\n\n/**\n * @title RealitioSafeMath32\n * @dev Math operations with safety checks that throw on error\n * @dev Copy of SafeMath but for uint32 instead of uint256\n * @dev Deleted functions we don't use\n */\nlibrary RealitioSafeMath32 {\n function add(uint32 a, uint32 b) internal pure returns (uint32) {\n uint32 c = a + b;\n assert(c >= a);\n return c;\n }\n}\n", "sourcePath": "/home/ed/working/realitio-contracts-newtest/truffle/contracts/RealitioSafeMath32.sol", "ast": { "absolutePath": "/home/ed/working/realitio-contracts-newtest/truffle/contracts/RealitioSafeMath32.sol", "exportedSymbols": { "RealitioSafeMath32": [ 2447 ] }, "id": 2448, "nodeType": "SourceUnit", "nodes": [ { "id": 2422, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:4" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title RealitioSafeMath32\n@dev Math operations with safety checks that throw on error\n@dev Copy of SafeMath but for uint32 instead of uint256\n@dev Deleted functions we don't use", "fullyImplemented": true, "id": 2447, "linearizedBaseContracts": [ 2447 ], "name": "RealitioSafeMath32", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2445, "nodeType": "Block", "src": "319:61:4", "statements": [ { "assignments": [ 2432 ], "declarations": [ { "constant": false, "id": 2432, "name": "c", "nodeType": "VariableDeclaration", "scope": 2446, "src": "325:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2431, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "325:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "id": 2436, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 2435, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2433, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2424, "src": "336:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2434, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2426, "src": "340:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "336:5:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "VariableDeclarationStatement", "src": "325:16:4" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 2440, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2438, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2432, "src": "354:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2439, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2424, "src": "359:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "354:6:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2437, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2451, "src": "347:6:4", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2441, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "347:14:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2442, "nodeType": "ExpressionStatement", "src": "347:14:4" }, { "expression": { "argumentTypes": null, "id": 2443, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2432, "src": "374:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 2430, "id": 2444, "nodeType": "Return", "src": "367:8:4" } ] }, "documentation": null, "id": 2446, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 2427, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2424, "name": "a", "nodeType": "VariableDeclaration", "scope": 2446, "src": "268:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2423, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "268:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2426, "name": "b", "nodeType": "VariableDeclaration", "scope": 2446, "src": "278:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2425, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "278:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "267:20:4" }, "payable": false, "returnParameters": { "id": 2430, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2429, "name": "", "nodeType": "VariableDeclaration", "scope": 2446, "src": "311:6:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2428, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "311:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "310:8:4" }, "scope": 2447, "src": "255:125:4", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2448, "src": "224:158:4" } ], "src": "0:383:4" }, "legacyAST": { "absolutePath": "/home/ed/working/realitio-contracts-newtest/truffle/contracts/RealitioSafeMath32.sol", "exportedSymbols": { "RealitioSafeMath32": [ 2447 ] }, "id": 2448, "nodeType": "SourceUnit", "nodes": [ { "id": 2422, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:4" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": "@title RealitioSafeMath32\n@dev Math operations with safety checks that throw on error\n@dev Copy of SafeMath but for uint32 instead of uint256\n@dev Deleted functions we don't use", "fullyImplemented": true, "id": 2447, "linearizedBaseContracts": [ 2447 ], "name": "RealitioSafeMath32", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2445, "nodeType": "Block", "src": "319:61:4", "statements": [ { "assignments": [ 2432 ], "declarations": [ { "constant": false, "id": 2432, "name": "c", "nodeType": "VariableDeclaration", "scope": 2446, "src": "325:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2431, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "325:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "id": 2436, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 2435, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2433, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2424, "src": "336:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2434, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2426, "src": "340:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "336:5:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "VariableDeclarationStatement", "src": "325:16:4" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 2440, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2438, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2432, "src": "354:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2439, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2424, "src": "359:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "354:6:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 2437, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2451, "src": "347:6:4", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 2441, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "347:14:4", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2442, "nodeType": "ExpressionStatement", "src": "347:14:4" }, { "expression": { "argumentTypes": null, "id": 2443, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2432, "src": "374:1:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 2430, "id": 2444, "nodeType": "Return", "src": "367:8:4" } ] }, "documentation": null, "id": 2446, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 2427, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2424, "name": "a", "nodeType": "VariableDeclaration", "scope": 2446, "src": "268:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2423, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "268:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2426, "name": "b", "nodeType": "VariableDeclaration", "scope": 2446, "src": "278:8:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2425, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "278:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "267:20:4" }, "payable": false, "returnParameters": { "id": 2430, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2429, "name": "", "nodeType": "VariableDeclaration", "scope": 2446, "src": "311:6:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 2428, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "311:6:4", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "310:8:4" }, "scope": 2447, "src": "255:125:4", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2448, "src": "224:158:4" } ], "src": "0:383:4" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang" }, "networks": {}, "schemaVersion": "2.0.2", "updatedAt": "2019-06-07T22:14:37.029Z" }