UNPKG

@valueswap/v2-core

Version:
1,182 lines (1,181 loc) • 94.9 kB
{ "contractName": "SafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"methods\":{}},\"userdoc\":{\"methods\":{}}},\"settings\":{\"compilationTarget\":{\"/Users/second/Documents/work/valueswap-v2-core/contracts/libraries/SafeMath.sol\":\"SafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"/Users/second/Documents/work/valueswap-v2-core/contracts/libraries/SafeMath.sol\":{\"keccak256\":\"0x9c8465de751317860b623cd77f7f53f41a84b6624c0580ee526dcf7a2b7cb80c\",\"urls\":[\"bzz-raw://9b371b3eb0649b486f76cd628cc060354d1ac11fa8baed1170567271655f05d7\",\"dweb:/ipfs/QmTUg31wK9UyX6o1Q1mxE4DQhuc1rWGBanNTu1uagNVQB6\"]}},\"version\":1}", "bytecode": "0x60556023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582009aff82d25b2acc00ad8d156a0dc2f793ee3b5296b5b048c993ff41f4945e9af64736f6c63430005100032", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea265627a7a7231582009aff82d25b2acc00ad8d156a0dc2f793ee3b5296b5b048c993ff41f4945e9af64736f6c63430005100032", "sourceMap": "132:430:10:-;;:2:-1;166:7;155:9;146:7;137:37;255:7;249:14;246:1;241:23;235:4;232:33;222:2;;269:9;222:2;293:9;290:1;283:20;323:4;314:7;306:22;347:7;338;331:24", "deployedSourceMap": "132:430:10:-;;;;;;;;", "source": "pragma solidity =0.5.16;\n\n// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)\n\nlibrary SafeMath {\n function add(uint x, uint y) internal pure returns (uint z) {\n require((z = x + y) >= x, 'ds-math-add-overflow');\n }\n\n function sub(uint x, uint y) internal pure returns (uint z) {\n require((z = x - y) <= x, 'ds-math-sub-underflow');\n }\n\n function mul(uint x, uint y) internal pure returns (uint z) {\n require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');\n }\n}\n", "sourcePath": "/Users/second/Documents/work/valueswap-v2-core/contracts/libraries/SafeMath.sol", "ast": { "absolutePath": "/Users/second/Documents/work/valueswap-v2-core/contracts/libraries/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 2325 ] }, "id": 2326, "nodeType": "SourceUnit", "nodes": [ { "id": 2252, "literals": [ "solidity", "=", "0.5", ".16" ], "nodeType": "PragmaDirective", "src": "0:24:10" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": null, "fullyImplemented": true, "id": 2325, "linearizedBaseContracts": [ 2325 ], "name": "SafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 2273, "nodeType": "Block", "src": "215:66:10", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2269, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 2266, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2262, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2259, "src": "234:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2265, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2263, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2254, "src": "238:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "argumentTypes": null, "id": 2264, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2256, "src": "242:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "238:5:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "234:9:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2267, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "233:11:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "argumentTypes": null, "id": 2268, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2254, "src": "248:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "233:16:10", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d6164642d6f766572666c6f77", "id": 2270, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "251:22:10", "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": 2261, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2403, 2404 ], "referencedDeclaration": 2404, "src": "225:7:10", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2271, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "225:49:10", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2272, "nodeType": "ExpressionStatement", "src": "225:49:10" } ] }, "documentation": null, "id": 2274, "implemented": true, "kind": "function", "modifiers": [], "name": "add", "nodeType": "FunctionDefinition", "parameters": { "id": 2257, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2254, "name": "x", "nodeType": "VariableDeclaration", "scope": 2274, "src": "168:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2253, "name": "uint", "nodeType": "ElementaryTypeName", "src": "168:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2256, "name": "y", "nodeType": "VariableDeclaration", "scope": 2274, "src": "176:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2255, "name": "uint", "nodeType": "ElementaryTypeName", "src": "176:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "167:16:10" }, "returnParameters": { "id": 2260, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2259, "name": "z", "nodeType": "VariableDeclaration", "scope": 2274, "src": "207:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2258, "name": "uint", "nodeType": "ElementaryTypeName", "src": "207:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "206:8:10" }, "scope": 2325, "src": "155:126:10", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2295, "nodeType": "Block", "src": "347:67:10", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2291, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 2288, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2284, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2281, "src": "366:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2287, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2285, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2276, "src": "370:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "-", "rightExpression": { "argumentTypes": null, "id": 2286, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2278, "src": "374:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "370:5:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "366:9:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2289, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "365:11:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "<=", "rightExpression": { "argumentTypes": null, "id": 2290, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2276, "src": "380:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "365:16:10", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d7375622d756e646572666c6f77", "id": 2292, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "383:23:10", "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": 2283, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2403, 2404 ], "referencedDeclaration": 2404, "src": "357:7:10", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2293, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "357:50:10", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2294, "nodeType": "ExpressionStatement", "src": "357:50:10" } ] }, "documentation": null, "id": 2296, "implemented": true, "kind": "function", "modifiers": [], "name": "sub", "nodeType": "FunctionDefinition", "parameters": { "id": 2279, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2276, "name": "x", "nodeType": "VariableDeclaration", "scope": 2296, "src": "300:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2275, "name": "uint", "nodeType": "ElementaryTypeName", "src": "300:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2278, "name": "y", "nodeType": "VariableDeclaration", "scope": 2296, "src": "308:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2277, "name": "uint", "nodeType": "ElementaryTypeName", "src": "308:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "299:16:10" }, "returnParameters": { "id": 2282, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2281, "name": "z", "nodeType": "VariableDeclaration", "scope": 2296, "src": "339:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2280, "name": "uint", "nodeType": "ElementaryTypeName", "src": "339:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "338:8:10" }, "scope": 2325, "src": "287:127:10", "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, { "body": { "id": 2323, "nodeType": "Block", "src": "480:80:10", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bool", "typeString": "bool" }, "id": 2319, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2308, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2306, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2300, "src": "498:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 2307, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "503:1:10", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "498:6:10", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "BinaryOperation", "operator": "||", "rightExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2318, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2316, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "components": [ { "argumentTypes": null, "id": 2313, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 2309, "name": "z", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2303, "src": "509:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 2312, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 2310, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2298, "src": "513:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "*", "rightExpression": { "argumentTypes": null, "id": 2311, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2300, "src": "517:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "513:5:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "509:9:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "id": 2314, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "508:11:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "/", "rightExpression": { "argumentTypes": null, "id": 2315, "name": "y", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2300, "src": "522:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "508:15:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "id": 2317, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2298, "src": "527:1:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "src": "508:20:10", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "498:30:10", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "64732d6d6174682d6d756c2d6f766572666c6f77", "id": 2320, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "530:22:10", "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": 2305, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2403, 2404 ], "referencedDeclaration": 2404, "src": "490:7:10", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 2321, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "490:63:10", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 2322, "nodeType": "ExpressionStatement", "src": "490:63:10" } ] }, "documentation": null, "id": 2324, "implemented": true, "kind": "function", "modifiers": [], "name": "mul", "nodeType": "FunctionDefinition", "parameters": { "id": 2301, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2298, "name": "x", "nodeType": "VariableDeclaration", "scope": 2324, "src": "433:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2297, "name": "uint", "nodeType": "ElementaryTypeName", "src": "433:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 2300, "name": "y", "nodeType": "VariableDeclaration", "scope": 2324, "src": "441:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2299, "name": "uint", "nodeType": "ElementaryTypeName", "src": "441:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "432:16:10" }, "returnParameters": { "id": 2304, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 2303, "name": "z", "nodeType": "VariableDeclaration", "scope": 2324, "src": "472:6:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 2302, "name": "uint", "nodeType": "ElementaryTypeName", "src": "472:4:10", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "internal" } ], "src": "471:8:10" }, "scope": 2325, "src": "420:140:10", "stateMutability": "pure", "superFunction": null, "visibility": "internal" } ], "scope": 2326, "src": "132:430:10" } ], "src": "0:563:10" }, "legacyAST": { "attributes": { "absolutePath": "/Users/second/Documents/work/valueswap-v2-core/contracts/libraries/SafeMath.sol", "exportedSymbols": { "SafeMath": [ 2325 ] } }, "children": [ { "attributes": { "literals": [ "solidity", "=", "0.5", ".16" ] }, "id": 2252, "name": "PragmaDirective", "src": "0:24:10" }, { "attributes": { "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "library", "documentation": null, "fullyImplemented": true, "linearizedBaseContracts": [ 2325 ], "name": "SafeMath", "scope": 2326 }, "children": [ { "attributes": { "documentation": null, "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "add", "scope": 2325, "stateMutability": "pure", "superFunction": null, "visibility": "internal" }, "children": [ { "children": [ { "attributes": { "constant": false, "name": "x", "scope": 2274, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 2253, "name": "ElementaryTypeName", "src": "168:4:10" } ], "id": 2254, "name": "VariableDeclaration", "src": "168:6:10" }, { "attributes": { "constant": false, "name": "y", "scope": 2274, "stateVariable": false, "storageLocation": "default", "type": "uint256", "value": null, "visibility": "internal" }, "children": [ { "attributes": { "name": "uint", "type": "uint256" }, "id": 2255, "name": "ElementaryTypeName", "src": "176:4:10" } ], "id": 2256, "name": "VariableDeclaration", "src": "176:6:10" } ], "id": 2257, "name": "ParameterList", "src": "167:16:10" }, { "children": [ { "attributes": { "constant": false, "name": "z", "scope": 2274, "stateVariable": false, "storageLocation": "default", "type": "uint256",