@ethsub/sol
Version:
ethsub contracts
1,173 lines (1,172 loc) • 112 kB
JSON
{
"contractName": "SafeCast",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/utils/SafeCast.sol\":\"SafeCast\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/utils/SafeCast.sol\":{\"keccak256\":\"0x07a3b86654f9e1a2d49822e82c7b98b8fe68767c21968c95951079c3048e82dc\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://21e7bc82101b94d832601e5e2707e25ed93e788e1a363196221748090aafbf30\",\"dweb:/ipfs/QmWcjBuFMXvGsicL3DgegAR6BEt7HnuN9SbSSUHEFWzybk\"]}},\"version\":1}",
"bytecode": "0x60566023600b82828239805160001a607314601657fe5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122089fe74f51303a50e5390a734abf0a0a97c2bd2a6af95d77e843c6f4bc608266a64736f6c634300060c0033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122089fe74f51303a50e5390a734abf0a0a97c2bd2a6af95d77e843c6f4bc608266a64736f6c634300060c0033",
"immutableReferences": {},
"sourceMap": "59:712:55:-:0;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "59:712:55:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\n\npragma solidity 0.6.12;\n\n\nlibrary SafeCast {\n function toUint200(uint256 value) internal pure returns (uint200) {\n require(value < 2**200, \"value does not fit in 200 bits\");\n return uint200(value);\n }\n\n function toUint128(uint256 value) internal pure returns (uint128) {\n require(value < 2**128, \"value does not fit in 128 bits\");\n return uint128(value);\n }\n\n function toUint40(uint256 value) internal pure returns (uint40) {\n require(value < 2**40, \"value does not fit in 40 bits\");\n return uint40(value);\n }\n\n function toUint8(uint256 value) internal pure returns (uint8) {\n require(value < 2**8, \"value does not fit in 8 bits\");\n return uint8(value);\n }\n}\n",
"sourcePath": "/home/sigo/w/deer/ethsub/packages/sol/contracts/utils/SafeCast.sol",
"ast": {
"absolutePath": "project:/contracts/utils/SafeCast.sol",
"exportedSymbols": {
"SafeCast": [
10341
]
},
"id": 10342,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 10252,
"literals": [
"solidity",
"0.6",
".12"
],
"nodeType": "PragmaDirective",
"src": "33:23:55"
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": null,
"fullyImplemented": true,
"id": 10341,
"linearizedBaseContracts": [
10341
],
"name": "SafeCast",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 10273,
"nodeType": "Block",
"src": "148:105:55",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 10264,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 10260,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10254,
"src": "166:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_1606938044258990275541962092341162602522202993782792835301376_by_1",
"typeString": "int_const 1606...(53 digits omitted)...1376"
},
"id": 10263,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 10261,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "174:1:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "323030",
"id": 10262,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "177:3:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_200_by_1",
"typeString": "int_const 200"
},
"value": "200"
},
"src": "174:6:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_1606938044258990275541962092341162602522202993782792835301376_by_1",
"typeString": "int_const 1606...(53 digits omitted)...1376"
}
},
"src": "166:14:55",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "76616c756520646f6573206e6f742066697420696e203230302062697473",
"id": 10265,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "182:32:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_59e58ae7ab3a9ae814ea92465aea9521d3ac4a895bb563eae0a7e315c9c1e429",
"typeString": "literal_string \"value does not fit in 200 bits\""
},
"value": "value does not fit in 200 bits"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_59e58ae7ab3a9ae814ea92465aea9521d3ac4a895bb563eae0a7e315c9c1e429",
"typeString": "literal_string \"value does not fit in 200 bits\""
}
],
"id": 10259,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "158:7:55",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 10266,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "158:57:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 10267,
"nodeType": "ExpressionStatement",
"src": "158:57:55"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10270,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10254,
"src": "240:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10269,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "232:7:55",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint200_$",
"typeString": "type(uint200)"
},
"typeName": {
"id": 10268,
"name": "uint200",
"nodeType": "ElementaryTypeName",
"src": "232:7:55",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 10271,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "232:14:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint200",
"typeString": "uint200"
}
},
"functionReturnParameters": 10258,
"id": 10272,
"nodeType": "Return",
"src": "225:21:55"
}
]
},
"documentation": null,
"id": 10274,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toUint200",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10255,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10254,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10274,
"src": "101:13:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10253,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "101:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "100:15:55"
},
"returnParameters": {
"id": 10258,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10257,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10274,
"src": "139:7:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint200",
"typeString": "uint200"
},
"typeName": {
"id": 10256,
"name": "uint200",
"nodeType": "ElementaryTypeName",
"src": "139:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint200",
"typeString": "uint200"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "138:9:55"
},
"scope": 10341,
"src": "82:171:55",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 10295,
"nodeType": "Block",
"src": "325:105:55",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 10286,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 10282,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10276,
"src": "343:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1",
"typeString": "int_const 3402...(31 digits omitted)...1456"
},
"id": 10285,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 10283,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "351:1:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "313238",
"id": 10284,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "354:3:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_128_by_1",
"typeString": "int_const 128"
},
"value": "128"
},
"src": "351:6:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_340282366920938463463374607431768211456_by_1",
"typeString": "int_const 3402...(31 digits omitted)...1456"
}
},
"src": "343:14:55",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "76616c756520646f6573206e6f742066697420696e203132382062697473",
"id": 10287,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "359:32:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_151f3206c4f8ae714f4c8ff188c59ccf82367a7eb9996fd244eb22e73a441b52",
"typeString": "literal_string \"value does not fit in 128 bits\""
},
"value": "value does not fit in 128 bits"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_151f3206c4f8ae714f4c8ff188c59ccf82367a7eb9996fd244eb22e73a441b52",
"typeString": "literal_string \"value does not fit in 128 bits\""
}
],
"id": 10281,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "335:7:55",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 10288,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "335:57:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 10289,
"nodeType": "ExpressionStatement",
"src": "335:57:55"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10292,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10276,
"src": "417:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10291,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "409:7:55",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint128_$",
"typeString": "type(uint128)"
},
"typeName": {
"id": 10290,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "409:7:55",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 10293,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "409:14:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"functionReturnParameters": 10280,
"id": 10294,
"nodeType": "Return",
"src": "402:21:55"
}
]
},
"documentation": null,
"id": 10296,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toUint128",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10277,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10276,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10296,
"src": "278:13:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10275,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "278:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "277:15:55"
},
"returnParameters": {
"id": 10280,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10279,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10296,
"src": "316:7:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
},
"typeName": {
"id": 10278,
"name": "uint128",
"nodeType": "ElementaryTypeName",
"src": "316:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint128",
"typeString": "uint128"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "315:9:55"
},
"scope": 10341,
"src": "259:171:55",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 10317,
"nodeType": "Block",
"src": "500:102:55",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 10308,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 10304,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10298,
"src": "518:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_1099511627776_by_1",
"typeString": "int_const 1099511627776"
},
"id": 10307,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 10305,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "526:1:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "3430",
"id": 10306,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "529:2:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_40_by_1",
"typeString": "int_const 40"
},
"value": "40"
},
"src": "526:5:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_1099511627776_by_1",
"typeString": "int_const 1099511627776"
}
},
"src": "518:13:55",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "76616c756520646f6573206e6f742066697420696e2034302062697473",
"id": 10309,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "533:31:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_172700490614e4dfe732cc281f73d181a1bd9e8d7b31c8a03ff282ea9d3cc656",
"typeString": "literal_string \"value does not fit in 40 bits\""
},
"value": "value does not fit in 40 bits"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_172700490614e4dfe732cc281f73d181a1bd9e8d7b31c8a03ff282ea9d3cc656",
"typeString": "literal_string \"value does not fit in 40 bits\""
}
],
"id": 10303,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "510:7:55",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 10310,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "510:55:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 10311,
"nodeType": "ExpressionStatement",
"src": "510:55:55"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10314,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10298,
"src": "589:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10313,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "582:6:55",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint40_$",
"typeString": "type(uint40)"
},
"typeName": {
"id": 10312,
"name": "uint40",
"nodeType": "ElementaryTypeName",
"src": "582:6:55",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 10315,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "582:13:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"functionReturnParameters": 10302,
"id": 10316,
"nodeType": "Return",
"src": "575:20:55"
}
]
},
"documentation": null,
"id": 10318,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "toUint40",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 10299,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10298,
"mutability": "mutable",
"name": "value",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10318,
"src": "454:13:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 10297,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "454:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "453:15:55"
},
"returnParameters": {
"id": 10302,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 10301,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 10318,
"src": "492:6:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
},
"typeName": {
"id": 10300,
"name": "uint40",
"nodeType": "ElementaryTypeName",
"src": "492:6:55",
"typeDescriptions": {
"typeIdentifier": "t_uint40",
"typeString": "uint40"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "491:8:55"
},
"scope": 10341,
"src": "436:166:55",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 10339,
"nodeType": "Block",
"src": "670:99:55",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 10330,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 10326,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10320,
"src": "688:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "<",
"rightExpression": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
},
"id": 10329,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"hexValue": "32",
"id": 10327,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "696:1:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_2_by_1",
"typeString": "int_const 2"
},
"value": "2"
},
"nodeType": "BinaryOperation",
"operator": "**",
"rightExpression": {
"argumentTypes": null,
"hexValue": "38",
"id": 10328,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "699:1:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_8_by_1",
"typeString": "int_const 8"
},
"value": "8"
},
"src": "696:4:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_256_by_1",
"typeString": "int_const 256"
}
},
"src": "688:12:55",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "76616c756520646f6573206e6f742066697420696e20382062697473",
"id": 10331,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "702:30:55",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_4e9c69b01191ff3a3d7ad79085f3da33cdc24596180720b08161130c17fa0258",
"typeString": "literal_string \"value does not fit in 8 bits\""
},
"value": "value does not fit in 8 bits"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_4e9c69b01191ff3a3d7ad79085f3da33cdc24596180720b08161130c17fa0258",
"typeString": "literal_string \"value does not fit in 8 bits\""
}
],
"id": 10325,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "680:7:55",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 10332,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "680:53:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 10333,
"nodeType": "ExpressionStatement",
"src": "680:53:55"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 10336,
"name": "value",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 10320,
"src": "756:5:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 10335,
"isConstant": false,