kleros-interaction-2
Version:
Smart contracts interacting with Kleros.
1,273 lines (1,272 loc) • 91.9 kB
JSON
{
"contractName": "SafeMath",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bd385704a7cdeeee49ba5e7c584a3197d8d330e17874d1f7883d1a03624e51460029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bd385704a7cdeeee49ba5e7c584a3197d8d330e17874d1f7883d1a03624e51460029",
"sourceMap": "117:1251:61:-;;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": "117:1251:61:-;;;;;;;;",
"source": "pragma solidity ^0.4.24;\n\n\n/**\n * @title SafeMath\n * @dev Math operations with safety checks that throw on error\n */\nlibrary SafeMath {\n\n /**\n * @dev Multiplies two numbers, throws on overflow.\n */\n function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\n // Gas optimization: this is cheaper than asserting 'a' not being zero, but the\n // benefit is lost if 'b' is also tested.\n // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522\n if (_a == 0) {\n return 0;\n }\n\n c = _a * _b;\n assert(c / _a == _b);\n return c;\n }\n\n /**\n * @dev Integer division of two numbers, truncating the quotient.\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 _a / _b;\n }\n\n /**\n * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {\n assert(_b <= _a);\n return _a - _b;\n }\n\n /**\n * @dev Adds two numbers, throws on overflow.\n */\n function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {\n c = _a + _b;\n assert(c >= _a);\n return c;\n }\n}\n",
"sourcePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"ast": {
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"exportedSymbols": {
"SafeMath": [
19846
]
},
"id": 19847,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 19754,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:61"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeMath\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 19846,
"linearizedBaseContracts": [
19846
],
"name": "SafeMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 19786,
"nodeType": "Block",
"src": "274:309:61",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19765,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19763,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19756,
"src": "489:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 19764,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "495:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "489:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 19769,
"nodeType": "IfStatement",
"src": "485:36:61",
"trueBody": {
"id": 19768,
"nodeType": "Block",
"src": "498:23:61",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 19766,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "513:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 19762,
"id": 19767,
"nodeType": "Return",
"src": "506:8:61"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 19774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 19770,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19761,
"src": "527:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19773,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19771,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19756,
"src": "531:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 19772,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19758,
"src": "536:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "531:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "527:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 19775,
"nodeType": "ExpressionStatement",
"src": "527:11:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19781,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19779,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19777,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19761,
"src": "551:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 19778,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19756,
"src": "555:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "551:6:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 19780,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19758,
"src": "561:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "551:12:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 19776,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20628,
"src": "544:6:61",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 19782,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "544:20:61",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 19783,
"nodeType": "ExpressionStatement",
"src": "544:20:61"
},
{
"expression": {
"argumentTypes": null,
"id": 19784,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19761,
"src": "577:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 19762,
"id": 19785,
"nodeType": "Return",
"src": "570:8:61"
}
]
},
"documentation": "@dev Multiplies two numbers, throws on overflow.",
"id": 19787,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "mul",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 19759,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19756,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 19787,
"src": "216:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19755,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "216:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 19758,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 19787,
"src": "228:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19757,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "228:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "215:24:61"
},
"payable": false,
"returnParameters": {
"id": 19762,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19761,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 19787,
"src": "263:9:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19760,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "263:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "262:11:61"
},
"scope": 19846,
"src": "203:380:61",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 19800,
"nodeType": "Block",
"src": "734:214:61",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19798,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19796,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19789,
"src": "936:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 19797,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19791,
"src": "941:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "936:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 19795,
"id": 19799,
"nodeType": "Return",
"src": "929:14:61"
}
]
},
"documentation": "@dev Integer division of two numbers, truncating the quotient.",
"id": 19801,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "div",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 19792,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19789,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 19801,
"src": "678:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19788,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "678:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 19791,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 19801,
"src": "690:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19790,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "690:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "677:24:61"
},
"payable": false,
"returnParameters": {
"id": 19795,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19794,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 19801,
"src": "725:7:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19793,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "725:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "724:9:61"
},
"scope": 19846,
"src": "665:283:61",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 19820,
"nodeType": "Block",
"src": "1129:47:61",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19813,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19811,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19805,
"src": "1142:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 19812,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19803,
"src": "1148:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1142:8:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 19810,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20628,
"src": "1135:6:61",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 19814,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1135:16:61",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 19815,
"nodeType": "ExpressionStatement",
"src": "1135:16:61"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19818,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19816,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19803,
"src": "1164:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 19817,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19805,
"src": "1169:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1164:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 19809,
"id": 19819,
"nodeType": "Return",
"src": "1157:14:61"
}
]
},
"documentation": "@dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).",
"id": 19821,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "sub",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 19806,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19803,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 19821,
"src": "1073:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19802,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1073:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 19805,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 19821,
"src": "1085:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19804,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1085:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1072:24:61"
},
"payable": false,
"returnParameters": {
"id": 19809,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19808,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 19821,
"src": "1120:7:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19807,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1120:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1119:9:61"
},
"scope": 19846,
"src": "1060:116:61",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 19844,
"nodeType": "Block",
"src": "1309:57:61",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 19834,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 19830,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19828,
"src": "1315:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19833,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19831,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19823,
"src": "1319:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 19832,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19825,
"src": "1324:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1319:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1315:11:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 19835,
"nodeType": "ExpressionStatement",
"src": "1315:11:61"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19839,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19837,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19828,
"src": "1339:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 19838,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19823,
"src": "1344:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1339:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 19836,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 20628,
"src": "1332:6:61",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 19840,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1332:15:61",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 19841,
"nodeType": "ExpressionStatement",
"src": "1332:15:61"
},
{
"expression": {
"argumentTypes": null,
"id": 19842,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19828,
"src": "1360:1:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 19829,
"id": 19843,
"nodeType": "Return",
"src": "1353:8:61"
}
]
},
"documentation": "@dev Adds two numbers, throws on overflow.",
"id": 19845,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 19826,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19823,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 19845,
"src": "1251:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19822,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1251:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 19825,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 19845,
"src": "1263:10:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19824,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1263:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1250:24:61"
},
"payable": false,
"returnParameters": {
"id": 19829,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 19828,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 19845,
"src": "1298:9:61",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 19827,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1298:7:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1297:11:61"
},
"scope": 19846,
"src": "1238:128:61",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 19847,
"src": "117:1251:61"
}
],
"src": "0:1369:61"
},
"legacyAST": {
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"exportedSymbols": {
"SafeMath": [
19846
]
},
"id": 19847,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 19754,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:61"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeMath\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 19846,
"linearizedBaseContracts": [
19846
],
"name": "SafeMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 19786,
"nodeType": "Block",
"src": "274:309:61",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19765,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 19763,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 19756,
"src": "489:2:61",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 19764,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "495:1:61",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "489:7:61",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"