@sonicxchain/soxswap-periphery
Version:
Peripheral smart contracts for interacting with Soxswap
1,174 lines (1,173 loc) • 89.5 kB
JSON
{
"contractName": "SafeMath2",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058201bacdf96954541afb65ad7912ebce5f3576fb25fe8f1771c6f762fcd30ed1a210029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea165627a7a723058201bacdf96954541afb65ad7912ebce5f3576fb25fe8f1771c6f762fcd30ed1a210029",
"sourceMap": "144:443: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": "144:443:4:-;;;;;;;;",
"source": "pragma solidity >=0.4.23 <0.6.0;\r\n\r\n// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)\r\n\r\nlibrary SafeMath2 {\r\n function add(uint x, uint y) internal pure returns (uint z) {\r\n require((z = x + y) >= x, 'ds-math-add-overflow');\r\n }\r\n\r\n function sub(uint x, uint y) internal pure returns (uint z) {\r\n require((z = x - y) <= x, 'ds-math-sub-underflow');\r\n }\r\n\r\n function mul(uint x, uint y) internal pure returns (uint z) {\r\n require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');\r\n }\r\n}\r\n",
"sourcePath": "D:\\40_SonicX_DEX\\soxswap-periphery\\contracts\\libraries\\SafeMath2.sol",
"ast": {
"absolutePath": "/D/40_SonicX_DEX/soxswap-periphery/contracts/libraries/SafeMath2.sol",
"exportedSymbols": {
"SafeMath2": [
2579
]
},
"id": 2580,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2506,
"literals": [
"solidity",
">=",
"0.4",
".23",
"<",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:32:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 2579,
"linearizedBaseContracts": [
2579
],
"name": "SafeMath2",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2527,
"nodeType": "Block",
"src": "229:68:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 2520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2516,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2513,
"src": "249:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2519,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2517,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2508,
"src": "253:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 2518,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2510,
"src": "257:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "253:5:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "249:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 2521,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "248:11:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"argumentTypes": null,
"id": 2522,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2508,
"src": "263:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "248:16:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64732d6d6174682d6164642d6f766572666c6f77",
"id": 2524,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "266:22:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_3903056b84ed2aba2be78662dc6c5c99b160cebe9af9bd9493d0fc28ff16f6db",
"typeString": "literal_string \"ds-math-add-overflow\""
},
"value": "ds-math-add-overflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_3903056b84ed2aba2be78662dc6c5c99b160cebe9af9bd9493d0fc28ff16f6db",
"typeString": "literal_string \"ds-math-add-overflow\""
}
],
"id": 2515,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4577,
4578
],
"referencedDeclaration": 4578,
"src": "240:7:4",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 2525,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "240:49:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2526,
"nodeType": "ExpressionStatement",
"src": "240:49:4"
}
]
},
"documentation": null,
"id": 2528,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2511,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2508,
"name": "x",
"nodeType": "VariableDeclaration",
"scope": 2528,
"src": "182:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2507,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "182:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2510,
"name": "y",
"nodeType": "VariableDeclaration",
"scope": 2528,
"src": "190:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2509,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "190:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "181:16:4"
},
"returnParameters": {
"id": 2514,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2513,
"name": "z",
"nodeType": "VariableDeclaration",
"scope": 2528,
"src": "221:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2512,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "221:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "220:8:4"
},
"scope": 2579,
"src": "169:128:4",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2549,
"nodeType": "Block",
"src": "365:69:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2545,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 2542,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2538,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2535,
"src": "385:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2541,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2539,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2530,
"src": "389:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"id": 2540,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2532,
"src": "393:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "389:5:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "385:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 2543,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "384:11:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<=",
"rightExpression": {
"argumentTypes": null,
"id": 2544,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2530,
"src": "399:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "384:16:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64732d6d6174682d7375622d756e646572666c6f77",
"id": 2546,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "402:23:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_03b20b9f6e6e7905f077509fd420fb44afc685f254bcefe49147296e1ba25590",
"typeString": "literal_string \"ds-math-sub-underflow\""
},
"value": "ds-math-sub-underflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_03b20b9f6e6e7905f077509fd420fb44afc685f254bcefe49147296e1ba25590",
"typeString": "literal_string \"ds-math-sub-underflow\""
}
],
"id": 2537,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4577,
4578
],
"referencedDeclaration": 4578,
"src": "376:7:4",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 2547,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "376:50:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2548,
"nodeType": "ExpressionStatement",
"src": "376:50:4"
}
]
},
"documentation": null,
"id": 2550,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "sub",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2533,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2530,
"name": "x",
"nodeType": "VariableDeclaration",
"scope": 2550,
"src": "318:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2529,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "318:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2532,
"name": "y",
"nodeType": "VariableDeclaration",
"scope": 2550,
"src": "326:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2531,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "326:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "317:16:4"
},
"returnParameters": {
"id": 2536,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2535,
"name": "z",
"nodeType": "VariableDeclaration",
"scope": 2550,
"src": "357:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2534,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "357:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "356:8:4"
},
"scope": 2579,
"src": "305:129:4",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 2577,
"nodeType": "Block",
"src": "502:82:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"id": 2573,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2562,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2560,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2554,
"src": "521:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 2561,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "526:1:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "521:6:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "BinaryOperation",
"operator": "||",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2572,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2570,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 2567,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2563,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2557,
"src": "532:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2566,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2564,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2552,
"src": "536:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "*",
"rightExpression": {
"argumentTypes": null,
"id": 2565,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2554,
"src": "540:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "536:5:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "532:9:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"id": 2568,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "531:11:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "/",
"rightExpression": {
"argumentTypes": null,
"id": 2569,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2554,
"src": "545:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "531:15:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"id": 2571,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2552,
"src": "550:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "531:20:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"src": "521:30:4",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "64732d6d6174682d6d756c2d6f766572666c6f77",
"id": 2574,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "553:22:4",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_25a0ef6406c6af6852555433653ce478274cd9f03a5dec44d001868a76b3bfdd",
"typeString": "literal_string \"ds-math-mul-overflow\""
},
"value": "ds-math-mul-overflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_25a0ef6406c6af6852555433653ce478274cd9f03a5dec44d001868a76b3bfdd",
"typeString": "literal_string \"ds-math-mul-overflow\""
}
],
"id": 2559,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4577,
4578
],
"referencedDeclaration": 4578,
"src": "513:7:4",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 2575,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "513:63:4",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2576,
"nodeType": "ExpressionStatement",
"src": "513:63:4"
}
]
},
"documentation": null,
"id": 2578,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "mul",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2555,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2552,
"name": "x",
"nodeType": "VariableDeclaration",
"scope": 2578,
"src": "455:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2551,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "455:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2554,
"name": "y",
"nodeType": "VariableDeclaration",
"scope": 2578,
"src": "463:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2553,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "463:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "454:16:4"
},
"returnParameters": {
"id": 2558,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2557,
"name": "z",
"nodeType": "VariableDeclaration",
"scope": 2578,
"src": "494:6:4",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2556,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "494:4:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "493:8:4"
},
"scope": 2579,
"src": "442:142:4",
"stateMutability": "pure",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 2580,
"src": "144:443:4"
}
],
"src": "0:589:4"
},
"legacyAST": {
"absolutePath": "/D/40_SonicX_DEX/soxswap-periphery/contracts/libraries/SafeMath2.sol",
"exportedSymbols": {
"SafeMath2": [
2579
]
},
"id": 2580,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2506,
"literals": [
"solidity",
">=",
"0.4",
".23",
"<",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:32:4"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 2579,
"linearizedBaseContracts": [
2579
],
"name": "SafeMath2",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2527,
"nodeType": "Block",
"src": "229:68:4",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2523,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 2520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 2516,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2513,
"src": "249:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2519,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2517,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2508,
"src": "253:1:4",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"argumentTypes": null,
"id": 2518,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2510,