@daostack/access_control
Version:
Capability-based access control for Ethereum smart contracts.
1,277 lines • 91.6 kB
JSON
{
"contractName": "SafeMath",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820726bae57dfa7c6c715fec1add37a263b1026fd7842ffff096c939c004d5ed93b0029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820726bae57dfa7c6c715fec1add37a263b1026fd7842ffff096c939c004d5ed93b0029",
"sourceMap": "117:1251:10:-;;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:10:-;;;;;;;;",
"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": [
1447
]
},
"id": 1448,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1355,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:10"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeMath\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 1447,
"linearizedBaseContracts": [
1447
],
"name": "SafeMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1387,
"nodeType": "Block",
"src": "274:309:10",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1364,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1357,
"src": "489:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1365,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "495:1:10",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "489:7:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1370,
"nodeType": "IfStatement",
"src": "485:36:10",
"trueBody": {
"id": 1369,
"nodeType": "Block",
"src": "498:23:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1367,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "513:1:10",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 1363,
"id": 1368,
"nodeType": "Return",
"src": "506:8:10"
}
]
}
},
{
"expression": {
"argumentTypes": null,
"id": 1375,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1371,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1362,
"src": "527:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1374,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1372,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1357,
"src": "531:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 1373,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1359,
"src": "536:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "531:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "527:11:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1376,
"nodeType": "ExpressionStatement",
"src": "527:11:10"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1382,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1380,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1378,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1362,
"src": "551:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 1379,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1357,
"src": "555:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "551:6:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 1381,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1359,
"src": "561:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "551:12:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1377,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1451,
"src": "544:6:10",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1383,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "544:20:10",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1384,
"nodeType": "ExpressionStatement",
"src": "544:20:10"
},
{
"expression": {
"argumentTypes": null,
"id": 1385,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1362,
"src": "577:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1363,
"id": 1386,
"nodeType": "Return",
"src": "570:8:10"
}
]
},
"documentation": "@dev Multiplies two numbers, throws on overflow.",
"id": 1388,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "mul",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1360,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1357,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 1388,
"src": "216:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1356,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "216:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1359,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 1388,
"src": "228:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1358,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "228:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "215:24:10"
},
"payable": false,
"returnParameters": {
"id": 1363,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1362,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 1388,
"src": "263:9:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1361,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "263:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "262:11:10"
},
"scope": 1447,
"src": "203:380:10",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1401,
"nodeType": "Block",
"src": "734:214:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1399,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1397,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1390,
"src": "936:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 1398,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1392,
"src": "941:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "936:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1396,
"id": 1400,
"nodeType": "Return",
"src": "929:14:10"
}
]
},
"documentation": "@dev Integer division of two numbers, truncating the quotient.",
"id": 1402,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "div",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1393,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1390,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 1402,
"src": "678:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1389,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "678:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1392,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 1402,
"src": "690:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1391,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "690:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "677:24:10"
},
"payable": false,
"returnParameters": {
"id": 1396,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1395,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1402,
"src": "725:7:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1394,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "725:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "724:9:10"
},
"scope": 1447,
"src": "665:283:10",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1421,
"nodeType": "Block",
"src": "1129:47:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1414,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1412,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1406,
"src": "1142:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 1413,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1404,
"src": "1148:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1142:8:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1411,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1451,
"src": "1135:6:10",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1415,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1135:16:10",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1416,
"nodeType": "ExpressionStatement",
"src": "1135:16:10"
},
{
"expression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1419,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1417,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1404,
"src": "1164:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 1418,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1406,
"src": "1169:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1164:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1410,
"id": 1420,
"nodeType": "Return",
"src": "1157:14:10"
}
]
},
"documentation": "@dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).",
"id": 1422,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "sub",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1407,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1404,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 1422,
"src": "1073:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1403,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1073:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1406,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 1422,
"src": "1085:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1405,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1085:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1072:24:10"
},
"payable": false,
"returnParameters": {
"id": 1410,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1409,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1422,
"src": "1120:7:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1408,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1120:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1119:9:10"
},
"scope": 1447,
"src": "1060:116:10",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1445,
"nodeType": "Block",
"src": "1309:57:10",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1435,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 1431,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1429,
"src": "1315:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1434,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1432,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1424,
"src": "1319:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 1433,
"name": "_b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1426,
"src": "1324:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1319:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1315:11:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 1436,
"nodeType": "ExpressionStatement",
"src": "1315:11:10"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1440,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1438,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1429,
"src": "1339:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 1439,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1424,
"src": "1344:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1339:7:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1437,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1451,
"src": "1332:6:10",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1441,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1332:15:10",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1442,
"nodeType": "ExpressionStatement",
"src": "1332:15:10"
},
{
"expression": {
"argumentTypes": null,
"id": 1443,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1429,
"src": "1360:1:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 1430,
"id": 1444,
"nodeType": "Return",
"src": "1353:8:10"
}
]
},
"documentation": "@dev Adds two numbers, throws on overflow.",
"id": 1446,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1427,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1424,
"name": "_a",
"nodeType": "VariableDeclaration",
"scope": 1446,
"src": "1251:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1423,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1251:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1426,
"name": "_b",
"nodeType": "VariableDeclaration",
"scope": 1446,
"src": "1263:10:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1425,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1263:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1250:24:10"
},
"payable": false,
"returnParameters": {
"id": 1430,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1429,
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 1446,
"src": "1298:9:10",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 1428,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1298:7:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1297:11:10"
},
"scope": 1447,
"src": "1238:128:10",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 1448,
"src": "117:1251:10"
}
],
"src": "0:1369:10"
},
"legacyAST": {
"absolutePath": "openzeppelin-solidity/contracts/math/SafeMath.sol",
"exportedSymbols": {
"SafeMath": [
1447
]
},
"id": 1448,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1355,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:10"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title SafeMath\n@dev Math operations with safety checks that throw on error",
"fullyImplemented": true,
"id": 1447,
"linearizedBaseContracts": [
1447
],
"name": "SafeMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 1387,
"nodeType": "Block",
"src": "274:309:10",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 1366,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 1364,
"name": "_a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1357,
"src": "489:2:10",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 1365,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "495:1:10",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "489:7:10",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 1370,
"nodeType": "IfStatemen