niftyswap
Version:
AMM exchange for ERC-1155 tokens, inspired by Uniswap
1,195 lines • 53.7 kB
JSON
{
"id": "7700ede6aa753d2f95296e3687a2325f",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.7.4",
"solcLongVersion": "0.7.4+commit.3f05b770",
"input": {
"language": "Solidity",
"sources": {
"contracts/utils/SafeMath.sol": {
"content": "// SPDX-License-Identifier: Apache-2.0\npragma solidity 0.7.4;\npragma experimental ABIEncoderV2;\n\n\n/**\n * @title SafeMath\n * @dev Unsigned math operations with safety checks that revert on error\n */\nlibrary SafeMath {\n\n /**\n * @dev Multiplies two unsigned integers, reverts on overflow.\n */\n function mul(uint256 a, uint256 b) internal pure returns (uint256) {\n // Gas optimization: this is cheaper than requiring '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 uint256 c = a * b;\n require(c / a == b, \"SafeMath#mul: OVERFLOW\");\n\n return c;\n }\n\n /**\n * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).\n */\n function sub(uint256 a, uint256 b) internal pure returns (uint256) {\n require(b <= a, \"SafeMath#sub: UNDERFLOW\");\n uint256 c = a - b;\n\n return c;\n }\n\n /**\n * @dev Adds two unsigned integers, reverts on overflow.\n */\n function add(uint256 a, uint256 b) internal pure returns (uint256) {\n uint256 c = a + b;\n require(c >= a, \"SafeMath#add: OVERFLOW\");\n\n return c;\n }\n\n}"
}
},
"settings": {
"optimizer": {
"enabled": true,
"runs": 100000,
"details": {
"yul": true
}
},
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers"
],
"": [
"ast"
]
}
}
}
},
"output": {
"contracts": {
"contracts/utils/SafeMath.sol": {
"SafeMath": {
"abi": [],
"evm": {
"bytecode": {
"generatedSources": [],
"linkReferences": {},
"object": "60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122076874982bd236254f477ed68db035fc92bf1de4a1b98496abfef436291bed94f64736f6c63430007040033",
"opcodes": "PUSH1 0x56 PUSH1 0x23 PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH1 0x0 BYTE PUSH1 0x73 EQ PUSH1 0x16 JUMPI INVALID JUMPDEST ADDRESS PUSH1 0x0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH23 0x874982BD236254F477ED68DB035FC92BF1DE4A1B98496A 0xBF 0xEF NUMBER PUSH3 0x91BED9 0x4F PUSH5 0x736F6C6343 STOP SMOD DIV STOP CALLER ",
"sourceMap": "198:1024:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122076874982bd236254f477ed68db035fc92bf1de4a1b98496abfef436291bed94f64736f6c63430007040033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH23 0x874982BD236254F477ED68DB035FC92BF1DE4A1B98496A 0xBF 0xEF NUMBER PUSH3 0x91BED9 0x4F PUSH5 0x736F6C6343 STOP SMOD DIV STOP CALLER ",
"sourceMap": "198:1024:0:-:0;;;;;;;;"
},
"methodIdentifiers": {}
}
}
}
},
"sources": {
"contracts/utils/SafeMath.sol": {
"ast": {
"absolutePath": "contracts/utils/SafeMath.sol",
"exportedSymbols": {
"SafeMath": [
91
]
},
"id": 92,
"license": "Apache-2.0",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"0.7",
".4"
],
"nodeType": "PragmaDirective",
"src": "39:22:0"
},
{
"id": 2,
"literals": [
"experimental",
"ABIEncoderV2"
],
"nodeType": "PragmaDirective",
"src": "62:33:0"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "98:99:0",
"text": " @title SafeMath\n @dev Unsigned math operations with safety checks that revert on error"
},
"fullyImplemented": true,
"id": 91,
"linearizedBaseContracts": [
91
],
"name": "SafeMath",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 37,
"nodeType": "Block",
"src": "364:340:0",
"statements": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 15,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 13,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "579:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"hexValue": "30",
"id": 14,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "584:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "579:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 19,
"nodeType": "IfStatement",
"src": "575:35:0",
"trueBody": {
"id": 18,
"nodeType": "Block",
"src": "587:23:0",
"statements": [
{
"expression": {
"hexValue": "30",
"id": 16,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "602:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"functionReturnParameters": 12,
"id": 17,
"nodeType": "Return",
"src": "595:8:0"
}
]
}
},
{
"assignments": [
21
],
"declarations": [
{
"constant": false,
"id": 21,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 37,
"src": "616:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 20,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "616:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 25,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 24,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 22,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "628:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"id": 23,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "632:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "628:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "616:17:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 31,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 29,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 27,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21,
"src": "647:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"id": 28,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6,
"src": "651:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "647:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 30,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "656:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "647:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "536166654d617468236d756c3a204f564552464c4f57",
"id": 32,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "659:24:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_6631eab3c1c1ec7659f8ce75290ab9f7fbbc49ae8d385122e795162bad662acd",
"typeString": "literal_string \"SafeMath#mul: OVERFLOW\""
},
"value": "SafeMath#mul: OVERFLOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_6631eab3c1c1ec7659f8ce75290ab9f7fbbc49ae8d385122e795162bad662acd",
"typeString": "literal_string \"SafeMath#mul: OVERFLOW\""
}
],
"id": 26,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "639:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 33,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "639:45:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 34,
"nodeType": "ExpressionStatement",
"src": "639:45:0"
},
{
"expression": {
"id": 35,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 21,
"src": "698:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 12,
"id": 36,
"nodeType": "Return",
"src": "691:8:0"
}
]
},
"documentation": {
"id": 4,
"nodeType": "StructuredDocumentation",
"src": "220:74:0",
"text": " @dev Multiplies two unsigned integers, reverts on overflow."
},
"id": 38,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "mul",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 38,
"src": "310:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 5,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "310:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 8,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 38,
"src": "321:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 7,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "321:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "309:22:0"
},
"returnParameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 38,
"src": "355:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "355:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "354:9:0"
},
"scope": 91,
"src": "297:407:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 63,
"nodeType": "Block",
"src": "896:91:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 51,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 49,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43,
"src": "910:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"id": 50,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "915:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "910:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "536166654d617468237375623a20554e444552464c4f57",
"id": 52,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "918:25:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_4c9bc0c7d77a5da304a056b5a05f28805364acf05afb77358700a2ddca1b6a79",
"typeString": "literal_string \"SafeMath#sub: UNDERFLOW\""
},
"value": "SafeMath#sub: UNDERFLOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_4c9bc0c7d77a5da304a056b5a05f28805364acf05afb77358700a2ddca1b6a79",
"typeString": "literal_string \"SafeMath#sub: UNDERFLOW\""
}
],
"id": 48,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "902:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 53,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "902:42:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 54,
"nodeType": "ExpressionStatement",
"src": "902:42:0"
},
{
"assignments": [
56
],
"declarations": [
{
"constant": false,
"id": 56,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 63,
"src": "950:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 55,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "950:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 60,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 59,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 57,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 41,
"src": "962:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"id": 58,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 43,
"src": "966:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "962:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "950:17:0"
},
{
"expression": {
"id": 61,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 56,
"src": "981:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 47,
"id": 62,
"nodeType": "Return",
"src": "974:8:0"
}
]
},
"documentation": {
"id": 39,
"nodeType": "StructuredDocumentation",
"src": "708:118:0",
"text": " @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend)."
},
"id": 64,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sub",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 44,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 41,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "842:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 40,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "842:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 43,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "853:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 42,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "853:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "841:22:0"
},
"returnParameters": {
"id": 47,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 46,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "887:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 45,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "887:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "886:9:0"
},
"scope": 91,
"src": "829:158:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 89,
"nodeType": "Block",
"src": "1129:90:0",
"statements": [
{
"assignments": [
75
],
"declarations": [
{
"constant": false,
"id": 75,
"mutability": "mutable",
"name": "c",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "1135:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 74,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1135:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"id": 79,
"initialValue": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 78,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 76,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "1147:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"id": 77,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 69,
"src": "1151:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1147:5:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1135:17:0"
},
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 83,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 81,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 75,
"src": "1166:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"id": 82,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 67,
"src": "1171:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "1166:6:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "536166654d617468236164643a204f564552464c4f57",
"id": 84,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1174:24:0",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_dfa65337becd76e1bb13ca279a5adb7e6d420bd3575b95dc9a0cf7916fd026a9",
"typeString": "literal_string \"SafeMath#add: OVERFLOW\""
},
"value": "SafeMath#add: OVERFLOW"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_dfa65337becd76e1bb13ca279a5adb7e6d420bd3575b95dc9a0cf7916fd026a9",
"typeString": "literal_string \"SafeMath#add: OVERFLOW\""
}
],
"id": 80,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1158:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 85,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1158:41:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 86,
"nodeType": "ExpressionStatement",
"src": "1158:41:0"
},
{
"expression": {
"id": 87,
"name": "c",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 75,
"src": "1213:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 73,
"id": 88,
"nodeType": "Return",
"src": "1206:8:0"
}
]
},
"documentation": {
"id": 65,
"nodeType": "StructuredDocumentation",
"src": "991:68:0",
"text": " @dev Adds two unsigned integers, reverts on overflow."
},
"id": 90,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 70,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 67,
"mutability": "mutable",
"name": "a",
"nodeType": "VariableDeclaration",
"scope": 90,
"src": "1075:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 66,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1075:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 69,
"mutability": "mutable",
"name": "b",
"nodeType": "VariableDeclaration",
"scope": 90,
"src": "1086:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 68,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1086:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1074:22:0"
},
"returnParameters": {
"id": 73,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 72,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"scope": 90,
"src": "1120:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 71,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1120:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1119:9:0"
},
"scope": 91,
"src": "1062:157:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 92,
"src": "198:1024:0"
}
],
"src": "39:1183:0"
},
"id": 0
}
}
}
}