{ "contractName": "SignedMath", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Standard signed math utilities missing in the Solidity language.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/utils/math/SignedMath.sol\":\"SignedMath\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/utils/math/SignedMath.sol\":{\"keccak256\":\"0xf92515413956f529d95977adc9b0567d583c6203fc31ab1c23824c35187e3ddc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://c50fcc459e49a9858b6d8ad5f911295cb7c9ab57567845a250bf0153f84a95c7\",\"dweb:/ipfs/QmcEW85JRzvDkQggxiBBLVAasXWdkhEysqypj9EaB6H2g6\"]}},\"version\":1}", "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ecc55b2e1208d2c71df0f53ec7abb56ed1f8f1f97da9d4c4938f6523450c090764736f6c634300080a0033", "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ecc55b2e1208d2c71df0f53ec7abb56ed1f8f1f97da9d4c4938f6523450c090764736f6c634300080a0033", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "215:1047:38:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;", "deployedSourceMap": "215:1047:38:-:0;;;;;;;;", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard signed math utilities missing in the Solidity language.\n */\nlibrary SignedMath {\n /**\n * @dev Returns the largest of two signed numbers.\n */\n function max(int256 a, int256 b) internal pure returns (int256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two signed numbers.\n */\n function min(int256 a, int256 b) internal pure returns (int256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two signed numbers without overflow.\n * The result is rounded towards zero.\n */\n function average(int256 a, int256 b) internal pure returns (int256) {\n // Formula from the book \"Hacker's Delight\"\n int256 x = (a & b) + ((a ^ b) >> 1);\n return x + (int256(uint256(x) >> 255) & (a ^ b));\n }\n\n /**\n * @dev Returns the absolute unsigned value of a signed value.\n */\n function abs(int256 n) internal pure returns (uint256) {\n unchecked {\n // must be unchecked in order to support `n = type(int256).min`\n return uint256(n >= 0 ? n : -n);\n }\n }\n}\n", "sourcePath": "@openzeppelin/contracts/utils/math/SignedMath.sol", "ast": { "absolutePath": "@openzeppelin/contracts/utils/math/SignedMath.sol", "exportedSymbols": { "SignedMath": [ 8458 ] }, "id": 8459, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 8355, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "109:23:38" }, { "abstract": false, "baseContracts": [], "canonicalName": "SignedMath", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 8356, "nodeType": "StructuredDocumentation", "src": "134:80:38", "text": " @dev Standard signed math utilities missing in the Solidity language." }, "fullyImplemented": true, "id": 8458, "linearizedBaseContracts": [ 8458 ], "name": "SignedMath", "nameLocation": "223:10:38", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 8373, "nodeType": "Block", "src": "375:37:38", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8368, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8366, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8359, "src": "392:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 8367, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8361, "src": "396:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "392:5:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8370, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8361, "src": "404:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8371, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "392:13:38", "trueExpression": { "id": 8369, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8359, "src": "400:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8365, "id": 8372, "nodeType": "Return", "src": "385:20:38" } ] }, "documentation": { "id": 8357, "nodeType": "StructuredDocumentation", "src": "240:66:38", "text": " @dev Returns the largest of two signed numbers." }, "id": 8374, "implemented": true, "kind": "function", "modifiers": [], "name": "max", "nameLocation": "320:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8362, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8359, "mutability": "mutable", "name": "a", "nameLocation": "331:1:38", "nodeType": "VariableDeclaration", "scope": 8374, "src": "324:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8358, "name": "int256", "nodeType": "ElementaryTypeName", "src": "324:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8361, "mutability": "mutable", "name": "b", "nameLocation": "341:1:38", "nodeType": "VariableDeclaration", "scope": 8374, "src": "334:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8360, "name": "int256", "nodeType": "ElementaryTypeName", "src": "334:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "323:20:38" }, "returnParameters": { "id": 8365, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8364, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8374, "src": "367:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8363, "name": "int256", "nodeType": "ElementaryTypeName", "src": "367:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "366:8:38" }, "scope": 8458, "src": "311:101:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8391, "nodeType": "Block", "src": "554:37:38", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8386, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8384, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8377, "src": "571:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 8385, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8379, "src": "575:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "571:5:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8388, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8379, "src": "583:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8389, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "571:13:38", "trueExpression": { "id": 8387, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8377, "src": "579:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8383, "id": 8390, "nodeType": "Return", "src": "564:20:38" } ] }, "documentation": { "id": 8375, "nodeType": "StructuredDocumentation", "src": "418:67:38", "text": " @dev Returns the smallest of two signed numbers." }, "id": 8392, "implemented": true, "kind": "function", "modifiers": [], "name": "min", "nameLocation": "499:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8380, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8377, "mutability": "mutable", "name": "a", "nameLocation": "510:1:38", "nodeType": "VariableDeclaration", "scope": 8392, "src": "503:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8376, "name": "int256", "nodeType": "ElementaryTypeName", "src": "503:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8379, "mutability": "mutable", "name": "b", "nameLocation": "520:1:38", "nodeType": "VariableDeclaration", "scope": 8392, "src": "513:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8378, "name": "int256", "nodeType": "ElementaryTypeName", "src": "513:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "502:20:38" }, "returnParameters": { "id": 8383, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8382, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8392, "src": "546:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8381, "name": "int256", "nodeType": "ElementaryTypeName", "src": "546:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "545:8:38" }, "scope": 8458, "src": "490:101:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8435, "nodeType": "Block", "src": "796:162:38", "statements": [ { "assignments": [ 8403 ], "declarations": [ { "constant": false, "id": 8403, "mutability": "mutable", "name": "x", "nameLocation": "865:1:38", "nodeType": "VariableDeclaration", "scope": 8435, "src": "858:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8402, "name": "int256", "nodeType": "ElementaryTypeName", "src": "858:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "id": 8416, "initialValue": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8415, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8406, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8404, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "870:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "id": 8405, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "874:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "870:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8407, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "869:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8413, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8410, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8408, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "881:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "id": 8409, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "885:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "881:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8411, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "880:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 8412, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "891:1:38", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "880:12:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8414, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "879:14:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "869:24:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "VariableDeclarationStatement", "src": "858:35:38" }, { "expression": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8417, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8403, "src": "910:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8431, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 8425, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 8422, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8403, "src": "930:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_int256", "typeString": "int256" } ], "id": 8421, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "922:7:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 8420, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "922:7:38", "typeDescriptions": {} } }, "id": 8423, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "922:10:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "323535", "id": 8424, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "936:3:38", "typeDescriptions": { "typeIdentifier": "t_rational_255_by_1", "typeString": "int_const 255" }, "value": "255" }, "src": "922:17:38", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 8419, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "915:6:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_int256_$", "typeString": "type(int256)" }, "typeName": { "id": 8418, "name": "int256", "nodeType": "ElementaryTypeName", "src": "915:6:38", "typeDescriptions": {} } }, "id": 8426, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "915:25:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8429, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8427, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "944:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "id": 8428, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "948:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "944:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8430, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "943:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "915:35:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8432, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "914:37:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "910:41:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8401, "id": 8434, "nodeType": "Return", "src": "903:48:38" } ] }, "documentation": { "id": 8393, "nodeType": "StructuredDocumentation", "src": "597:126:38", "text": " @dev Returns the average of two signed numbers without overflow.\n The result is rounded towards zero." }, "id": 8436, "implemented": true, "kind": "function", "modifiers": [], "name": "average", "nameLocation": "737:7:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8398, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8395, "mutability": "mutable", "name": "a", "nameLocation": "752:1:38", "nodeType": "VariableDeclaration", "scope": 8436, "src": "745:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8394, "name": "int256", "nodeType": "ElementaryTypeName", "src": "745:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8397, "mutability": "mutable", "name": "b", "nameLocation": "762:1:38", "nodeType": "VariableDeclaration", "scope": 8436, "src": "755:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8396, "name": "int256", "nodeType": "ElementaryTypeName", "src": "755:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "744:20:38" }, "returnParameters": { "id": 8401, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8400, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8436, "src": "788:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8399, "name": "int256", "nodeType": "ElementaryTypeName", "src": "788:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "787:8:38" }, "scope": 8458, "src": "728:230:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8456, "nodeType": "Block", "src": "1102:158:38", "statements": [ { "id": 8455, "nodeType": "UncheckedBlock", "src": "1112:142:38", "statements": [ { "expression": { "arguments": [ { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8448, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8446, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1227:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "hexValue": "30", "id": 8447, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1232:1:38", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1227:6:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8451, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "-", "prefix": true, "src": "1240:2:38", "subExpression": { "id": 8450, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1241:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8452, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "1227:15:38", "trueExpression": { "id": 8449, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1236:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_int256", "typeString": "int256" } ], "id": 8445, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1219:7:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 8444, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1219:7:38", "typeDescriptions": {} } }, "id": 8453, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1219:24:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 8443, "id": 8454, "nodeType": "Return", "src": "1212:31:38" } ] } ] }, "documentation": { "id": 8437, "nodeType": "StructuredDocumentation", "src": "964:78:38", "text": " @dev Returns the absolute unsigned value of a signed value." }, "id": 8457, "implemented": true, "kind": "function", "modifiers": [], "name": "abs", "nameLocation": "1056:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8440, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8439, "mutability": "mutable", "name": "n", "nameLocation": "1067:1:38", "nodeType": "VariableDeclaration", "scope": 8457, "src": "1060:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8438, "name": "int256", "nodeType": "ElementaryTypeName", "src": "1060:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "1059:10:38" }, "returnParameters": { "id": 8443, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8442, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8457, "src": "1093:7:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 8441, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1093:7:38", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1092:9:38" }, "scope": 8458, "src": "1047:213:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 8459, "src": "215:1047:38", "usedErrors": [] } ], "src": "109:1154:38" }, "legacyAST": { "absolutePath": "@openzeppelin/contracts/utils/math/SignedMath.sol", "exportedSymbols": { "SignedMath": [ 8458 ] }, "id": 8459, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 8355, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "109:23:38" }, { "abstract": false, "baseContracts": [], "canonicalName": "SignedMath", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 8356, "nodeType": "StructuredDocumentation", "src": "134:80:38", "text": " @dev Standard signed math utilities missing in the Solidity language." }, "fullyImplemented": true, "id": 8458, "linearizedBaseContracts": [ 8458 ], "name": "SignedMath", "nameLocation": "223:10:38", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 8373, "nodeType": "Block", "src": "375:37:38", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8368, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8366, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8359, "src": "392:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "id": 8367, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8361, "src": "396:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "392:5:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8370, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8361, "src": "404:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8371, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "392:13:38", "trueExpression": { "id": 8369, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8359, "src": "400:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8365, "id": 8372, "nodeType": "Return", "src": "385:20:38" } ] }, "documentation": { "id": 8357, "nodeType": "StructuredDocumentation", "src": "240:66:38", "text": " @dev Returns the largest of two signed numbers." }, "id": 8374, "implemented": true, "kind": "function", "modifiers": [], "name": "max", "nameLocation": "320:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8362, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8359, "mutability": "mutable", "name": "a", "nameLocation": "331:1:38", "nodeType": "VariableDeclaration", "scope": 8374, "src": "324:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8358, "name": "int256", "nodeType": "ElementaryTypeName", "src": "324:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8361, "mutability": "mutable", "name": "b", "nameLocation": "341:1:38", "nodeType": "VariableDeclaration", "scope": 8374, "src": "334:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8360, "name": "int256", "nodeType": "ElementaryTypeName", "src": "334:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "323:20:38" }, "returnParameters": { "id": 8365, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8364, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8374, "src": "367:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8363, "name": "int256", "nodeType": "ElementaryTypeName", "src": "367:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "366:8:38" }, "scope": 8458, "src": "311:101:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8391, "nodeType": "Block", "src": "554:37:38", "statements": [ { "expression": { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8386, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8384, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8377, "src": "571:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "<", "rightExpression": { "id": 8385, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8379, "src": "575:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "571:5:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8388, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8379, "src": "583:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8389, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "571:13:38", "trueExpression": { "id": 8387, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8377, "src": "579:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8383, "id": 8390, "nodeType": "Return", "src": "564:20:38" } ] }, "documentation": { "id": 8375, "nodeType": "StructuredDocumentation", "src": "418:67:38", "text": " @dev Returns the smallest of two signed numbers." }, "id": 8392, "implemented": true, "kind": "function", "modifiers": [], "name": "min", "nameLocation": "499:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8380, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8377, "mutability": "mutable", "name": "a", "nameLocation": "510:1:38", "nodeType": "VariableDeclaration", "scope": 8392, "src": "503:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8376, "name": "int256", "nodeType": "ElementaryTypeName", "src": "503:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8379, "mutability": "mutable", "name": "b", "nameLocation": "520:1:38", "nodeType": "VariableDeclaration", "scope": 8392, "src": "513:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8378, "name": "int256", "nodeType": "ElementaryTypeName", "src": "513:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "502:20:38" }, "returnParameters": { "id": 8383, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8382, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8392, "src": "546:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8381, "name": "int256", "nodeType": "ElementaryTypeName", "src": "546:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "545:8:38" }, "scope": 8458, "src": "490:101:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8435, "nodeType": "Block", "src": "796:162:38", "statements": [ { "assignments": [ 8403 ], "declarations": [ { "constant": false, "id": 8403, "mutability": "mutable", "name": "x", "nameLocation": "865:1:38", "nodeType": "VariableDeclaration", "scope": 8435, "src": "858:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8402, "name": "int256", "nodeType": "ElementaryTypeName", "src": "858:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "id": 8416, "initialValue": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8415, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8406, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8404, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "870:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "id": 8405, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "874:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "870:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8407, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "869:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8413, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8410, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8408, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "881:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "id": 8409, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "885:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "881:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8411, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "880:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "31", "id": 8412, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "891:1:38", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "880:12:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8414, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "879:14:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "869:24:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "VariableDeclarationStatement", "src": "858:35:38" }, { "expression": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8433, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8417, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8403, "src": "910:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8431, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 8425, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 8422, "name": "x", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8403, "src": "930:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_int256", "typeString": "int256" } ], "id": 8421, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "922:7:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 8420, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "922:7:38", "typeDescriptions": {} } }, "id": 8423, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "922:10:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">>", "rightExpression": { "hexValue": "323535", "id": 8424, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "936:3:38", "typeDescriptions": { "typeIdentifier": "t_rational_255_by_1", "typeString": "int_const 255" }, "value": "255" }, "src": "922:17:38", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 8419, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "915:6:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_int256_$", "typeString": "type(int256)" }, "typeName": { "id": 8418, "name": "int256", "nodeType": "ElementaryTypeName", "src": "915:6:38", "typeDescriptions": {} } }, "id": 8426, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "915:25:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "&", "rightExpression": { "components": [ { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8429, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8427, "name": "a", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8395, "src": "944:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": "^", "rightExpression": { "id": 8428, "name": "b", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8397, "src": "948:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "944:5:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8430, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "943:7:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "915:35:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "id": 8432, "isConstant": false, "isInlineArray": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "TupleExpression", "src": "914:37:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "src": "910:41:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "functionReturnParameters": 8401, "id": 8434, "nodeType": "Return", "src": "903:48:38" } ] }, "documentation": { "id": 8393, "nodeType": "StructuredDocumentation", "src": "597:126:38", "text": " @dev Returns the average of two signed numbers without overflow.\n The result is rounded towards zero." }, "id": 8436, "implemented": true, "kind": "function", "modifiers": [], "name": "average", "nameLocation": "737:7:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8398, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8395, "mutability": "mutable", "name": "a", "nameLocation": "752:1:38", "nodeType": "VariableDeclaration", "scope": 8436, "src": "745:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8394, "name": "int256", "nodeType": "ElementaryTypeName", "src": "745:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" }, { "constant": false, "id": 8397, "mutability": "mutable", "name": "b", "nameLocation": "762:1:38", "nodeType": "VariableDeclaration", "scope": 8436, "src": "755:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8396, "name": "int256", "nodeType": "ElementaryTypeName", "src": "755:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "744:20:38" }, "returnParameters": { "id": 8401, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8400, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8436, "src": "788:6:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8399, "name": "int256", "nodeType": "ElementaryTypeName", "src": "788:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "787:8:38" }, "scope": 8458, "src": "728:230:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 8456, "nodeType": "Block", "src": "1102:158:38", "statements": [ { "id": 8455, "nodeType": "UncheckedBlock", "src": "1112:142:38", "statements": [ { "expression": { "arguments": [ { "condition": { "commonType": { "typeIdentifier": "t_int256", "typeString": "int256" }, "id": 8448, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 8446, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1227:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "nodeType": "BinaryOperation", "operator": ">=", "rightExpression": { "hexValue": "30", "id": 8447, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1232:1:38", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1227:6:38", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 8451, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "-", "prefix": true, "src": "1240:2:38", "subExpression": { "id": 8450, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1241:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "id": 8452, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "1227:15:38", "trueExpression": { "id": 8449, "name": "n", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 8439, "src": "1236:1:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_int256", "typeString": "int256" } ], "id": 8445, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1219:7:38", "typeDescriptions": { "typeIdentifier": "t_type$_t_uint256_$", "typeString": "type(uint256)" }, "typeName": { "id": 8444, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1219:7:38", "typeDescriptions": {} } }, "id": 8453, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1219:24:38", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "functionReturnParameters": 8443, "id": 8454, "nodeType": "Return", "src": "1212:31:38" } ] } ] }, "documentation": { "id": 8437, "nodeType": "StructuredDocumentation", "src": "964:78:38", "text": " @dev Returns the absolute unsigned value of a signed value." }, "id": 8457, "implemented": true, "kind": "function", "modifiers": [], "name": "abs", "nameLocation": "1056:3:38", "nodeType": "FunctionDefinition", "parameters": { "id": 8440, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8439, "mutability": "mutable", "name": "n", "nameLocation": "1067:1:38", "nodeType": "VariableDeclaration", "scope": 8457, "src": "1060:8:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" }, "typeName": { "id": 8438, "name": "int256", "nodeType": "ElementaryTypeName", "src": "1060:6:38", "typeDescriptions": { "typeIdentifier": "t_int256", "typeString": "int256" } }, "visibility": "internal" } ], "src": "1059:10:38" }, "returnParameters": { "id": 8443, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 8442, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 8457, "src": "1093:7:38", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 8441, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1093:7:38", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1092:9:38" }, "scope": 8458, "src": "1047:213:38", "stateMutability": "pure", "virtual": false, "visibility": "internal" } ], "scope": 8459, "src": "215:1047:38", "usedErrors": [] } ], "src": "109:1154:38" }, "compiler": { "name": "solc", "version": "0.8.10+commit.fc410830.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.4", "updatedAt": "2023-11-28T07:46:31.031Z", "devdoc": { "details": "Standard signed math utilities missing in the Solidity language.", "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }