UNPKG

moonwalkerswap-v1-core

Version:
564 lines 21.9 kB
{ "contractName": "UnsafeMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.7.6+commit.7338295f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"Math functions that do not check inputs or outputs\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Contains methods that perform common math functions but do not do any overflow or underflow checks\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/libraries/UnsafeMath.sol\":\"UnsafeMath\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/libraries/UnsafeMath.sol\":{\"keccak256\":\"0x5f36d7d16348d8c37fe64fda932018d6e5e8acecd054f0f97d32db62d20c6c88\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://4bd4e817ea3d2c26bb2be7e58db3eaa403119562c18d4c09cc92fb31aa231496\",\"dweb:/ipfs/QmbpjgL8Hf1mhmUyf9hpuPk4noGAggCdTqaRBFKqNF3AQw\"]}},\"version\":1}", "bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220917454945980669aa7a1e8366bc88d8b3d36493aec77569015529c799c65885164736f6c63430007060033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220917454945980669aa7a1e8366bc88d8b3d36493aec77569015529c799c65885164736f6c63430007060033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "244:415:32:-:0;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "244:415:32:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: GPL-2.0-or-later\npragma solidity >=0.5.0;\n\n/// @title Math functions that do not check inputs or outputs\n/// @notice Contains methods that perform common math functions but do not do any overflow or underflow checks\nlibrary UnsafeMath {\n /// @notice Returns ceil(x / y)\n /// @dev division by 0 has unspecified behavior, and must be checked externally\n /// @param x The dividend\n /// @param y The divisor\n /// @return z The quotient, ceil(x / y)\n function divRoundingUp(uint256 x, uint256 y) internal pure returns (uint256 z) {\n assembly {\n z := add(div(x, y), gt(mod(x, y), 0))\n }\n }\n}\n", "sourcePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/libraries/UnsafeMath.sol", "ast": { "absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/libraries/UnsafeMath.sol", "exportedSymbols": { "UnsafeMath": [ 7237 ] }, "id": 7238, "license": "GPL-2.0-or-later", "nodeType": "SourceUnit", "nodes": [ { "id": 7223, "literals": [ "solidity", ">=", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "45:24:32" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "library", "documentation": { "id": 7224, "nodeType": "StructuredDocumentation", "src": "71:173:32", "text": "@title Math functions that do not check inputs or outputs\n @notice Contains methods that perform common math functions but do not do any overflow or underflow checks" }, "fullyImplemented": true, "id": 7237, "linearizedBaseContracts": [ 7237 ], "name": "UnsafeMath", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 7235, "nodeType": "Block", "src": "571:86:32", "statements": [ { "AST": { "nodeType": "YulBlock", "src": "590:61:32", "statements": [ { "nodeType": "YulAssignment", "src": "604:37:32", "value": { "arguments": [ { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "617:1:32" }, { "name": "y", "nodeType": "YulIdentifier", "src": "620:1:32" } ], "functionName": { "name": "div", "nodeType": "YulIdentifier", "src": "613:3:32" }, "nodeType": "YulFunctionCall", "src": "613:9:32" }, { "arguments": [ { "arguments": [ { "name": "x", "nodeType": "YulIdentifier", "src": "631:1:32" }, { "name": "y", "nodeType": "YulIdentifier", "src": "634:1:32" } ], "functionName": { "name": "mod", "nodeType": "YulIdentifier", "src": "627:3:32" }, "nodeType": "YulFunctionCall", "src": "627:9:32" }, { "kind": "number", "nodeType": "YulLiteral", "src": "638:1:32", "type": "", "value": "0" } ], "functionName": { "name": "gt", "nodeType": "YulIdentifier", "src": "624:2:32" }, "nodeType": "YulFunctionCall", "src": "624:16:32" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "609:3:32" }, "nodeType": "YulFunctionCall", "src": "609:32:32" }, "variableNames": [ { "name": "z", "nodeType": "YulIdentifier", "src": "604:1:32" } ] } ] }, "evmVersion": "istanbul", "externalReferences": [ { "declaration": 7227, "isOffset": false, "isSlot": false, "src": "617:1:32", "valueSize": 1 }, { "declaration": 7227, "isOffset": false, "isSlot": false, "src": "631:1:32", "valueSize": 1 }, { "declaration": 7229, "isOffset": false, "isSlot": false, "src": "620:1:32", "valueSize": 1 }, { "declaration": 7229, "isOffset": false, "isSlot": false, "src": "634:1:32", "valueSize": 1 }, { "declaration": 7232, "isOffset": false, "isSlot": false, "src": "604:1:32", "valueSize": 1 } ], "id": 7234, "nodeType": "InlineAssembly", "src": "581:70:32" } ] }, "documentation": { "id": 7225, "nodeType": "StructuredDocumentation", "src": "269:218:32", "text": "@notice Returns ceil(x / y)\n @dev division by 0 has unspecified behavior, and must be checked externally\n @param x The dividend\n @param y The divisor\n @return z The quotient, ceil(x / y)" }, "id": 7236, "implemented": true, "kind": "function", "modifiers": [], "name": "divRoundingUp", "nodeType": "FunctionDefinition", "parameters": { "id": 7230, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7227, "mutability": "mutable", "name": "x", "nodeType": "VariableDeclaration", "scope": 7236, "src": "515:9:32", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7226, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "515:7:32", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" }, { "constant": false, "id": 7229, "mutability": "mutable", "name": "y", "nodeType": "VariableDeclaration", "scope": 7236, "src": "526:9:32", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7228, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "526:7:32", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "514:22:32" }, "returnParameters": { "id": 7233, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 7232, "mutability": "mutable", "name": "z", "nodeType": "VariableDeclaration", "scope": 7236, "src": "560:9:32", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 7231, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "560:7:32", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "559:11:32" }, "scope": 7237, "src": "492:165:32", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 7238, "src": "244:415:32" } ], "src": "45:615:32" }, "legacyAST": { "attributes": { "absolutePath": "/Users/warrenmason/Documents/UniswapV3Contracts/Core/LiveContracts/MoonwalkerSwap-v1-Core/contracts/libraries/UnsafeMath.sol", "exportedSymbols": { "UnsafeMath": [ 7237 ] }, "license": "GPL-2.0-or-later" }, "children": [ { "attributes": { "literals": [ "solidity", ">=", "0.5", ".0" ] }, "id": 7223, "name": "PragmaDirective", "src": "45:24:32" }, { "attributes": { "abstract": false, "baseContracts": [ null ], "contractDependencies": [ null ], "contractKind": "library", "fullyImplemented": true, "linearizedBaseContracts": [ 7237 ], "name": "UnsafeMath", "scope": 7238 }, "children": [ { "attributes": { "text": "@title Math functions that do not check inputs or outputs\n @notice Contains methods that perform common math functions but do not do any overflow or underflow checks" }, "id": 7224, "name": "StructuredDocumentation", "src": "71:173:32" }, { "attributes": { "implemented": true, "isConstructor": false, "kind": "function", "modifiers": [ null ], "name": "divRoundingUp", "scope": 7237, "stateMutability": "pure", "virtual": false, "visibility": "internal" }, "children": [ { "attributes": { "text": "@notice Returns ceil(x / y)\n @dev division by 0 has unspecified behavior, and must be checked externally\n @param x The dividend\n @param y The divisor\n @return z The quotient, ceil(x / y)" }, "id": 7225, "name": "StructuredDocumentation", "src": "269:218:32" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "x", "scope": 7236, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 7226, "name": "ElementaryTypeName", "src": "515:7:32" } ], "id": 7227, "name": "VariableDeclaration", "src": "515:9:32" }, { "attributes": { "constant": false, "mutability": "mutable", "name": "y", "scope": 7236, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 7228, "name": "ElementaryTypeName", "src": "526:7:32" } ], "id": 7229, "name": "VariableDeclaration", "src": "526:9:32" } ], "id": 7230, "name": "ParameterList", "src": "514:22:32" }, { "children": [ { "attributes": { "constant": false, "mutability": "mutable", "name": "z", "scope": 7236, "stateVariable": false, "storageLocation": "default", "type": "uint256", "visibility": "internal" }, "children": [ { "attributes": { "name": "uint256", "type": "uint256" }, "id": 7231, "name": "ElementaryTypeName", "src": "560:7:32" } ], "id": 7232, "name": "VariableDeclaration", "src": "560:9:32" } ], "id": 7233, "name": "ParameterList", "src": "559:11:32" }, { "children": [ { "attributes": { "evmVersion": "istanbul", "externalReferences": [ { "declaration": 7227, "isOffset": false, "isSlot": false, "src": "617:1:32", "valueSize": 1 }, { "declaration": 7227, "isOffset": false, "isSlot": false, "src": "631:1:32", "valueSize": 1 }, { "declaration": 7229, "isOffset": false, "isSlot": false, "src": "620:1:32", "valueSize": 1 }, { "declaration": 7229, "isOffset": false, "isSlot": false, "src": "634:1:32", "valueSize": 1 }, { "declaration": 7232, "isOffset": false, "isSlot": false, "src": "604:1:32", "valueSize": 1 } ], "operations": "{\n z := add(div(x, y), gt(mod(x, y), 0))\n}" }, "children": [], "id": 7234, "name": "InlineAssembly", "src": "581:70:32" } ], "id": 7235, "name": "Block", "src": "571:86:32" } ], "id": 7236, "name": "FunctionDefinition", "src": "492:165:32" } ], "id": 7237, "name": "ContractDefinition", "src": "244:415:32" } ], "id": 7238, "name": "SourceUnit", "src": "45:615:32" }, "compiler": { "name": "solc", "version": "0.7.6+commit.7338295f.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.1", "updatedAt": "2022-01-17T20:05:41.820Z", "devdoc": { "kind": "dev", "methods": {}, "title": "Math functions that do not check inputs or outputs", "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "notice": "Contains methods that perform common math functions but do not do any overflow or underflow checks", "version": 1 } }