open-dex/contracts/libraries/artifacts/build-info/0233d1735aa4c11198935600c91f7e81.json
2024-08-24 12:08:46 +03:00

1303 lines
40 KiB
JSON

{
"id": "0233d1735aa4c11198935600c91f7e81",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.26",
"solcLongVersion": "0.8.26+commit.8a97fa7a",
"input": {
"language": "Solidity",
"sources": {
"contracts/libraries/SafeCast.sol": {
"content": "// SPDX-License-Identifier: GPL-2.0-or-later\r\npragma solidity >=0.5.0;\r\n\r\n/// @title Safe casting methods\r\n/// @notice Contains methods for safely casting between types\r\nlibrary SafeCast {\r\n /// @notice Cast a uint256 to a uint160, revert on overflow\r\n /// @param y The uint256 to be downcasted\r\n /// @return z The downcasted integer, now type uint160\r\n function toUint160(uint256 y) internal pure returns (uint160 z) {\r\n require((z = uint160(y)) == y);\r\n }\r\n\r\n /// @notice Cast a int256 to a int128, revert on overflow or underflow\r\n /// @param y The int256 to be downcasted\r\n /// @return z The downcasted integer, now type int128\r\n function toInt128(int256 y) internal pure returns (int128 z) {\r\n require((z = int128(y)) == y);\r\n }\r\n\r\n /// @notice Cast a uint256 to a int256, revert on overflow\r\n /// @param y The uint256 to be casted\r\n /// @return z The casted integer, now type int256\r\n function toInt256(uint256 y) internal pure returns (int256 z) {\r\n require(y < 2**255);\r\n z = int256(y);\r\n }\r\n}\r\n"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
},
"remappings": []
}
},
"output": {
"contracts": {
"contracts/libraries/SafeCast.sol": {
"SafeCast": {
"abi": [],
"devdoc": {
"kind": "dev",
"methods": {},
"title": "Safe casting methods",
"version": 1
},
"evm": {
"assembly": " /* \"contracts/libraries/SafeCast.sol\":170:1074 library SafeCast {... */\n dataSize(sub_0)\n dataOffset(sub_0)\n 0x0b\n dup3\n dup3\n dup3\n codecopy\n dup1\n mload\n 0x00\n byte\n 0x73\n eq\n tag_1\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x00)\n revert(0x00, 0x24)\ntag_1:\n mstore(0x00, address)\n 0x73\n dup2\n mstore8\n dup3\n dup2\n return\nstop\n\nsub_0: assembly {\n /* \"contracts/libraries/SafeCast.sol\":170:1074 library SafeCast {... */\n eq(address, deployTimeAddress())\n mstore(0x40, 0x80)\n 0x00\n dup1\n revert\n\n auxdata: 0xa264697066735822122063cfdcef889fbdb07d2e35040ce55808bbfd5e3a43b5466fbdd0415210d5c59364736f6c634300081a0033\n}\n",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f80fdfea264697066735822122063cfdcef889fbdb07d2e35040ce55808bbfd5e3a43b5466fbdd0415210d5c59364736f6c634300081a0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH4 0xCFDCEF88 SWAP16 0xBD 0xB0 PUSH30 0x2E35040CE55808BBFD5E3A43B5466FBDD0415210D5C59364736F6C634300 ADDMOD BYTE STOP CALLER ",
"sourceMap": "170:904:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f80fdfea264697066735822122063cfdcef889fbdb07d2e35040ce55808bbfd5e3a43b5466fbdd0415210d5c59364736f6c634300081a0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 DUP1 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH4 0xCFDCEF88 SWAP16 0xBD 0xB0 PUSH30 0x2E35040CE55808BBFD5E3A43B5466FBDD0415210D5C59364736F6C634300 ADDMOD BYTE STOP CALLER ",
"sourceMap": "170:904:0:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"toInt128(int256)": "infinite",
"toInt256(uint256)": "infinite",
"toUint160(uint256)": "infinite"
}
},
"legacyAssembly": {
".code": [
{
"begin": 170,
"end": 1074,
"name": "PUSH #[$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH [$]",
"source": 0,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "B"
},
{
"begin": 170,
"end": 1074,
"name": "DUP3",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "DUP3",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "DUP3",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "CODECOPY",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "DUP1",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "MLOAD",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "BYTE",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "73"
},
{
"begin": 170,
"end": 1074,
"name": "EQ",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH [tag]",
"source": 0,
"value": "1"
},
{
"begin": 170,
"end": 1074,
"name": "JUMPI",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "4E487B7100000000000000000000000000000000000000000000000000000000"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "MSTORE",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "4"
},
{
"begin": 170,
"end": 1074,
"name": "MSTORE",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "24"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "REVERT",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "tag",
"source": 0,
"value": "1"
},
{
"begin": 170,
"end": 1074,
"name": "JUMPDEST",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "ADDRESS",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "MSTORE",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "73"
},
{
"begin": 170,
"end": 1074,
"name": "DUP2",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "MSTORE8",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "DUP3",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "DUP2",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "RETURN",
"source": 0
}
],
".data": {
"0": {
".auxdata": "a264697066735822122063cfdcef889fbdb07d2e35040ce55808bbfd5e3a43b5466fbdd0415210d5c59364736f6c634300081a0033",
".code": [
{
"begin": 170,
"end": 1074,
"name": "PUSHDEPLOYADDRESS",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "ADDRESS",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "EQ",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "80"
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "40"
},
{
"begin": 170,
"end": 1074,
"name": "MSTORE",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "PUSH",
"source": 0,
"value": "0"
},
{
"begin": 170,
"end": 1074,
"name": "DUP1",
"source": 0
},
{
"begin": 170,
"end": 1074,
"name": "REVERT",
"source": 0
}
]
}
},
"sourceList": [
"contracts/libraries/SafeCast.sol",
"#utility.yul"
]
},
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.26+commit.8a97fa7a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"title\":\"Safe casting methods\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"Contains methods for safely casting between types\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/libraries/SafeCast.sol\":\"SafeCast\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/libraries/SafeCast.sol\":{\"keccak256\":\"0x2ce167ecfd192faccc43e6ab3eadf5dcaa4b57bc53215abea354e55b9149bd08\",\"license\":\"GPL-2.0-or-later\",\"urls\":[\"bzz-raw://7b2699166ead0922ec7ef5c15aa0f931d9211e98f5d23408e5565a1539c7fd13\",\"dweb:/ipfs/QmURByWGxXgSydaC5KdkCyef8twwZRMTAS1WQv2uJBoAL6\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"notice": "Contains methods for safely casting between types",
"version": 1
}
}
}
},
"sources": {
"contracts/libraries/SafeCast.sol": {
"ast": {
"absolutePath": "contracts/libraries/SafeCast.sol",
"exportedSymbols": {
"SafeCast": [
69
]
},
"id": 70,
"license": "GPL-2.0-or-later",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
">=",
"0.5",
".0"
],
"nodeType": "PragmaDirective",
"src": "46:24:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "SafeCast",
"contractDependencies": [],
"contractKind": "library",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "74:96:0",
"text": "@title Safe casting methods\n @notice Contains methods for safely casting between types"
},
"fullyImplemented": true,
"id": 69,
"linearizedBaseContracts": [
69
],
"name": "SafeCast",
"nameLocation": "178:8:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 22,
"nodeType": "Block",
"src": "430:49:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 19,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"id": 16,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 11,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 8,
"src": "450:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 14,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "462:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 13,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "454:7:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint160_$",
"typeString": "type(uint160)"
},
"typeName": {
"id": 12,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "454:7:0",
"typeDescriptions": {}
}
},
"id": 15,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "454:10:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"src": "450:14:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
}
],
"id": 17,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "449:16:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 18,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5,
"src": "469:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "449:21:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 10,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "441:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 20,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "441:30:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 21,
"nodeType": "ExpressionStatement",
"src": "441:30:0"
}
]
},
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "194:166:0",
"text": "@notice Cast a uint256 to a uint160, revert on overflow\n @param y The uint256 to be downcasted\n @return z The downcasted integer, now type uint160"
},
"id": 23,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toUint160",
"nameLocation": "375:9:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "y",
"nameLocation": "393:1:0",
"nodeType": "VariableDeclaration",
"scope": 23,
"src": "385:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 4,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "385:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "384:11:0"
},
"returnParameters": {
"id": 9,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 8,
"mutability": "mutable",
"name": "z",
"nameLocation": "427:1:0",
"nodeType": "VariableDeclaration",
"scope": 23,
"src": "419:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
},
"typeName": {
"id": 7,
"name": "uint160",
"nodeType": "ElementaryTypeName",
"src": "419:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint160",
"typeString": "uint160"
}
},
"visibility": "internal"
}
],
"src": "418:11:0"
},
"scope": 69,
"src": "366:113:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 43,
"nodeType": "Block",
"src": "729:48:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"id": 40,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"components": [
{
"id": 37,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 32,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 29,
"src": "749:1:0",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 35,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "760:1:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_int256",
"typeString": "int256"
}
],
"id": 34,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "753:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int128_$",
"typeString": "type(int128)"
},
"typeName": {
"id": 33,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "753:6:0",
"typeDescriptions": {}
}
},
"id": 36,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "753:9:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"src": "749:13:0",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
}
],
"id": 38,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "748:15:0",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"id": 39,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 26,
"src": "767:1:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "748:20:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 31,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "740:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 41,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "740:29:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 42,
"nodeType": "ExpressionStatement",
"src": "740:29:0"
}
]
},
"documentation": {
"id": 24,
"nodeType": "StructuredDocumentation",
"src": "487:175:0",
"text": "@notice Cast a int256 to a int128, revert on overflow or underflow\n @param y The int256 to be downcasted\n @return z The downcasted integer, now type int128"
},
"id": 44,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toInt128",
"nameLocation": "677:8:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 27,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 26,
"mutability": "mutable",
"name": "y",
"nameLocation": "693:1:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "686:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 25,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "686:6:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "685:10:0"
},
"returnParameters": {
"id": 30,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29,
"mutability": "mutable",
"name": "z",
"nameLocation": "726:1:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "719:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
},
"typeName": {
"id": 28,
"name": "int128",
"nodeType": "ElementaryTypeName",
"src": "719:6:0",
"typeDescriptions": {
"typeIdentifier": "t_int128",
"typeString": "int128"
}
},
"visibility": "internal"
}
],
"src": "718:10:0"
},
"scope": 69,
"src": "668:109:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 67,
"nodeType": "Block",
"src": "1009:62:0",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 57,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 53,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 47,
"src": "1028:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"commonType": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
},
"id": 56,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"hexValue": "32",
"id": 54,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1032:1:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"hexValue": "323535",
"id": 55,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1035:3:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_255_by_1",
"typeString": "int_const 255"
},
"value": "255"
},
"src": "1032:6:0",
"typeDescriptions": {
"typeIdentifier": "t_rational_57896044618658097711785492504343953926634992332820282019728792003956564819968_by_1",
"typeString": "int_const 5789...(69 digits omitted)...9968"
}
},
"src": "1028:10:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 52,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1020:7:0",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 58,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1020:19:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 59,
"nodeType": "ExpressionStatement",
"src": "1020:19:0"
},
{
"expression": {
"id": 65,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 60,
"name": "z",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 50,
"src": "1050:1:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"arguments": [
{
"id": 63,
"name": "y",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 47,
"src": "1061:1:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 62,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1054:6:0",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_int256_$",
"typeString": "type(int256)"
},
"typeName": {
"id": 61,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "1054:6:0",
"typeDescriptions": {}
}
},
"id": 64,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1054:9:0",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"src": "1050:13:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"id": 66,
"nodeType": "ExpressionStatement",
"src": "1050:13:0"
}
]
},
"documentation": {
"id": 45,
"nodeType": "StructuredDocumentation",
"src": "785:156:0",
"text": "@notice Cast a uint256 to a int256, revert on overflow\n @param y The uint256 to be casted\n @return z The casted integer, now type int256"
},
"id": 68,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toInt256",
"nameLocation": "956:8:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 48,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 47,
"mutability": "mutable",
"name": "y",
"nameLocation": "973:1:0",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "965:9:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 46,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "965:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "964:11:0"
},
"returnParameters": {
"id": 51,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 50,
"mutability": "mutable",
"name": "z",
"nameLocation": "1006:1:0",
"nodeType": "VariableDeclaration",
"scope": 68,
"src": "999:8:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
},
"typeName": {
"id": 49,
"name": "int256",
"nodeType": "ElementaryTypeName",
"src": "999:6:0",
"typeDescriptions": {
"typeIdentifier": "t_int256",
"typeString": "int256"
}
},
"visibility": "internal"
}
],
"src": "998:10:0"
},
"scope": 69,
"src": "947:124:0",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 70,
"src": "170:904:0",
"usedErrors": [],
"usedEvents": []
}
],
"src": "46:1030:0"
},
"id": 0
}
}
}
}