UNPKG

@josojo/realitytoken-contracts

Version:
699 lines 26.4 kB
{ "contractName": "RealitioSafeMath32", "abi": [], "bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a7230582018ebde31f8855e51cd6d304f97f471ad092f1f1329897ce1b6008fc452bee8550029", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a7230582018ebde31f8855e51cd6d304f97f471ad092f1f1329897ce1b6008fc452bee8550029", "sourceMap": "223:158:23:-;;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": "223:158:23:-;;;;;;;;", "source": "pragma solidity 0.4.25;\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": "@realitio/realitio-contracts/truffle/contracts/RealitioSafeMath32.sol", "ast": { "absolutePath": "@realitio/realitio-contracts/truffle/contracts/RealitioSafeMath32.sol", "exportedSymbols": { "RealitioSafeMath32": [ 9071 ] }, "id": 9072, "nodeType": "SourceUnit", "nodes": [ { "id": 9046, "literals": [ "solidity", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:23:23" }, { "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": 9071, "linearizedBaseContracts": [ 9071 ], "name": "RealitioSafeMath32", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 9069, "nodeType": "Block", "src": "318:61:23", "statements": [ { "assignments": [ 9056 ], "declarations": [ { "constant": false, "id": 9056, "name": "c", "nodeType": "VariableDeclaration", "scope": 9070, "src": "324:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9055, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "324:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "id": 9060, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 9059, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 9057, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9048, "src": "335:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 9058, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9050, "src": "339:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "335:5:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "VariableDeclarationStatement", "src": "324:16:23" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 9064, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 9062, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9056, "src": "353:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 9063, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9048, "src": "358:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "353:6:23", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 9061, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9169, "src": "346:6:23", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 9065, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "346:14:23", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 9066, "nodeType": "ExpressionStatement", "src": "346:14:23" }, { "expression": { "argumentTypes": null, "id": 9067, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9056, "src": "373:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 9054, "id": 9068, "nodeType": "Return", "src": "366:8:23" } ] }, "documentation": null, "id": 9070, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 9051, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 9048, "name": "a", "nodeType": "VariableDeclaration", "scope": 9070, "src": "267:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9047, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "267:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 9050, "name": "b", "nodeType": "VariableDeclaration", "scope": 9070, "src": "277:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9049, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "277:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "266:20:23" }, "payable": false, "returnParameters": { "id": 9054, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 9053, "name": "", "nodeType": "VariableDeclaration", "scope": 9070, "src": "310:6:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9052, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "310:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "309:8:23" }, "scope": 9071, "src": "254:125:23", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 9072, "src": "223:158:23" } ], "src": "0:382:23" }, "legacyAST": { "absolutePath": "@realitio/realitio-contracts/truffle/contracts/RealitioSafeMath32.sol", "exportedSymbols": { "RealitioSafeMath32": [ 9071 ] }, "id": 9072, "nodeType": "SourceUnit", "nodes": [ { "id": 9046, "literals": [ "solidity", "0.4", ".25" ], "nodeType": "PragmaDirective", "src": "0:23:23" }, { "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": 9071, "linearizedBaseContracts": [ 9071 ], "name": "RealitioSafeMath32", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 9069, "nodeType": "Block", "src": "318:61:23", "statements": [ { "assignments": [ 9056 ], "declarations": [ { "constant": false, "id": 9056, "name": "c", "nodeType": "VariableDeclaration", "scope": 9070, "src": "324:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9055, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "324:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "id": 9060, "initialValue": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 9059, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 9057, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9048, "src": "335:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 9058, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9050, "src": "339:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "335:5:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "VariableDeclarationStatement", "src": "324:16:23" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "id": 9064, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 9062, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9056, "src": "353:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 9063, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9048, "src": "358:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "src": "353:6:23", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 9061, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9169, "src": "346:6:23", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 9065, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "346:14:23", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 9066, "nodeType": "ExpressionStatement", "src": "346:14:23" }, { "expression": { "argumentTypes": null, "id": 9067, "name": "c", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 9056, "src": "373:1:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "functionReturnParameters": 9054, "id": 9068, "nodeType": "Return", "src": "366:8:23" } ] }, "documentation": null, "id": 9070, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 9051, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 9048, "name": "a", "nodeType": "VariableDeclaration", "scope": 9070, "src": "267:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9047, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "267:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 9050, "name": "b", "nodeType": "VariableDeclaration", "scope": 9070, "src": "277:8:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9049, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "277:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "266:20:23" }, "payable": false, "returnParameters": { "id": 9054, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 9053, "name": "", "nodeType": "VariableDeclaration", "scope": 9070, "src": "310:6:23", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" }, "typeName": { "id": 9052, "name": "uint32", "nodeType": "ElementaryTypeName", "src": "310:6:23", "typeDescriptions": { "typeIdentifier": "t_uint32", "typeString": "uint32" } }, "value": null, "visibility": "internal" } ], "src": "309:8:23" }, "scope": 9071, "src": "254:125:23", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 9072, "src": "223:158:23" } ], "src": "0:382:23" }, "compiler": { "name": "solc", "version": "0.4.25+commit.59dbf8f1.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.0-beta.1", "updatedAt": "2018-10-27T21:23:29.125Z" }