Credit-Card-System-smartcon.../build/contracts/SignedMath.json
2023-06-04 19:59:46 +08:00

1355 lines
56 KiB
JSON

{
"contractName": "SignedMath",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.8.19+commit.7dd6d404\"},\"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\":\"paris\",\"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": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208033b5a6c324fdcc20d0911e83115e8bf3b22b861b07464c80cb392818b4cfcd64736f6c63430008130033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208033b5a6c324fdcc20d0911e83115e8bf3b22b861b07464c80cb392818b4cfcd64736f6c63430008130033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "215:1047:12:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "215:1047:12:-: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": [
2796
]
},
"id": 2797,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2693,
"literals": [
"solidity",
"^",
"0.8",
".0"
],
"nodeType": "PragmaDirective",
"src": "109:23:12"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "SignedMath",
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 2694,
"nodeType": "StructuredDocumentation",
"src": "134:80:12",
"text": " @dev Standard signed math utilities missing in the Solidity language."
},
"fullyImplemented": true,
"id": 2796,
"linearizedBaseContracts": [
2796
],
"name": "SignedMath",
"nameLocation": "223:10:12",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 2711,
"nodeType": "Block",
"src": "375:37:12",
"statements": [
{
"expression": {
"condition": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2706,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2704,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2697,
"src": "392:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"id": 2705,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2699,
"src": "396:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "392:5:12",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"id": 2708,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2699,
"src": "404:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 2709,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "392:13:12",
"trueExpression": {
"id": 2707,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2697,
"src": "400:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"functionReturnParameters": 2703,
"id": 2710,
"nodeType": "Return",
"src": "385:20:12"
}
]
},
"documentation": {
"id": 2695,
"nodeType": "StructuredDocumentation",
"src": "240:66:12",
"text": " @dev Returns the largest of two signed numbers."
},
"id": 2712,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "max",
"nameLocation": "320:3:12",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2700,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2697,
"mutability": "mutable",
"name": "a",
"nameLocation": "331:1:12",
"nodeType": "VariableDeclaration",
"scope": 2712,
"src": "324:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2696,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "324:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 2699,
"mutability": "mutable",
"name": "b",
"nameLocation": "341:1:12",
"nodeType": "VariableDeclaration",
"scope": 2712,
"src": "334:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2698,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "334:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "323:20:12"
},
"returnParameters": {
"id": 2703,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2702,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 2712,
"src": "367:6:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2701,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "367:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "366:8:12"
},
"scope": 2796,
"src": "311:101:12",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 2729,
"nodeType": "Block",
"src": "554:37:12",
"statements": [
{
"expression": {
"condition": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2724,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2722,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2715,
"src": "571:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"id": 2723,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2717,
"src": "575:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "571:5:12",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"id": 2726,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2717,
"src": "583:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 2727,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "571:13:12",
"trueExpression": {
"id": 2725,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2715,
"src": "579:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"functionReturnParameters": 2721,
"id": 2728,
"nodeType": "Return",
"src": "564:20:12"
}
]
},
"documentation": {
"id": 2713,
"nodeType": "StructuredDocumentation",
"src": "418:67:12",
"text": " @dev Returns the smallest of two signed numbers."
},
"id": 2730,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "min",
"nameLocation": "499:3:12",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2718,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2715,
"mutability": "mutable",
"name": "a",
"nameLocation": "510:1:12",
"nodeType": "VariableDeclaration",
"scope": 2730,
"src": "503:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2714,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "503:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 2717,
"mutability": "mutable",
"name": "b",
"nameLocation": "520:1:12",
"nodeType": "VariableDeclaration",
"scope": 2730,
"src": "513:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2716,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "513:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "502:20:12"
},
"returnParameters": {
"id": 2721,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2720,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 2730,
"src": "546:6:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2719,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "546:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "545:8:12"
},
"scope": 2796,
"src": "490:101:12",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 2773,
"nodeType": "Block",
"src": "796:162:12",
"statements": [
{
"assignments": [
2741
],
"declarations": [
{
"constant": false,
"id": 2741,
"mutability": "mutable",
"name": "x",
"nameLocation": "865:1:12",
"nodeType": "VariableDeclaration",
"scope": 2773,
"src": "858:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2740,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "858:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"id": 2754,
"initialValue": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2753,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2744,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2742,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2733,
"src": "870:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "&",
"rightExpression": {
"id": 2743,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2735,
"src": "874:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "870:5:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 2745,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "869:7:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2751,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2748,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2746,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2733,
"src": "881:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "^",
"rightExpression": {
"id": 2747,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2735,
"src": "885:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "881:5:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 2749,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "880:7:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": ">>",
"rightExpression": {
"hexValue": "31",
"id": 2750,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "891:1:12",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "880:12:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 2752,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "879:14:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "869:24:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "858:35:12"
},
{
"expression": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2771,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2755,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2741,
"src": "910:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2769,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2763,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [
{
"id": 2760,
"name": "x",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2741,
"src": "930:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 2759,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "922:7:12",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 2758,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "922:7:12",
"typeDescriptions": {}
}
},
"id": 2761,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "922:10:12",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">>",
"rightExpression": {
"hexValue": "323535",
"id": 2762,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "936:3:12",
"typeDescriptions": {
"typeIdentifier": "t_rational_255_by_1",
"typeString": "int_const 255"
},
"value": "255"
},
"src": "922:17:12",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 2757,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "915:6:12",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 2756,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "915:6:12",
"typeDescriptions": {}
}
},
"id": 2764,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "915:25:12",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "&",
"rightExpression": {
"components": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2767,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2765,
"name": "a",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2733,
"src": "944:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": "^",
"rightExpression": {
"id": 2766,
"name": "b",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2735,
"src": "948:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "944:5:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 2768,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "943:7:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "915:35:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"id": 2770,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "914:37:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "910:41:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"functionReturnParameters": 2739,
"id": 2772,
"nodeType": "Return",
"src": "903:48:12"
}
]
},
"documentation": {
"id": 2731,
"nodeType": "StructuredDocumentation",
"src": "597:126:12",
"text": " @dev Returns the average of two signed numbers without overflow.\n The result is rounded towards zero."
},
"id": 2774,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "average",
"nameLocation": "737:7:12",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2736,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2733,
"mutability": "mutable",
"name": "a",
"nameLocation": "752:1:12",
"nodeType": "VariableDeclaration",
"scope": 2774,
"src": "745:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2732,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "745:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 2735,
"mutability": "mutable",
"name": "b",
"nameLocation": "762:1:12",
"nodeType": "VariableDeclaration",
"scope": 2774,
"src": "755:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2734,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "755:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "744:20:12"
},
"returnParameters": {
"id": 2739,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2738,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 2774,
"src": "788:6:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2737,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "788:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "787:8:12"
},
"scope": 2796,
"src": "728:230:12",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 2794,
"nodeType": "Block",
"src": "1102:158:12",
"statements": [
{
"id": 2793,
"nodeType": "UncheckedBlock",
"src": "1112:142:12",
"statements": [
{
"expression": {
"arguments": [
{
"condition": {
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 2786,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 2784,
"name": "n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2777,
"src": "1227:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"hexValue": "30",
"id": 2785,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1232:1:12",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1227:6:12",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseExpression": {
"id": 2789,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "UnaryOperation",
"operator": "-",
"prefix": true,
"src": "1240:2:12",
"subExpression": {
"id": 2788,
"name": "n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2777,
"src": "1241:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 2790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "Conditional",
"src": "1227:15:12",
"trueExpression": {
"id": 2787,
"name": "n",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2777,
"src": "1236:1:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 2783,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1219:7:12",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 2782,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1219:7:12",
"typeDescriptions": {}
}
},
"id": 2791,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1219:24:12",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"functionReturnParameters": 2781,
"id": 2792,
"nodeType": "Return",
"src": "1212:31:12"
}
]
}
]
},
"documentation": {
"id": 2775,
"nodeType": "StructuredDocumentation",
"src": "964:78:12",
"text": " @dev Returns the absolute unsigned value of a signed value."
},
"id": 2795,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "abs",
"nameLocation": "1056:3:12",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2778,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2777,
"mutability": "mutable",
"name": "n",
"nameLocation": "1067:1:12",
"nodeType": "VariableDeclaration",
"scope": 2795,
"src": "1060:8:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 2776,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "1060:6:12",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "1059:10:12"
},
"returnParameters": {
"id": 2781,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2780,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 2795,
"src": "1093:7:12",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 2779,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1093:7:12",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1092:9:12"
},
"scope": 2796,
"src": "1047:213:12",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 2797,
"src": "215:1047:12",
"usedErrors": []
}
],
"src": "109:1154:12"
},
"compiler": {
"name": "solc",
"version": "0.8.19+commit.7dd6d404.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.13",
"updatedAt": "2023-06-04T09:28:33.990Z",
"devdoc": {
"details": "Standard signed math utilities missing in the Solidity language.",
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}