2022-10-14 13:50:00 +08:00

731 lines
28 KiB
JSON

{
"contractName": "UInt",
"abi": [],
"metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/utils/UInt.sol\":\"UInt\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"project:/contracts/utils/UInt.sol\":{\"keccak256\":\"0xabf10d6f1fd47ffe04ab44b8b2f6638eece2276c3a8ba170d0c660e8212a7a8c\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b2b1d61926fb315a771d8fd0d5d9a85ea58a154cd976a7500e12a1e2b3e14083\",\"dweb:/ipfs/QmbJkytTjjABgWbYLJBHv3uoLEAcbF7pWig71sd2rjGG2M\"]}},\"version\":1}",
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208156151ef9e5b8327b18cf43951d7332c0b736ac0952004fb55f15c80962d93864736f6c634300080a0033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212208156151ef9e5b8327b18cf43951d7332c0b736ac0952004fb55f15c80962d93864736f6c634300080a0033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "57:211:48:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "57:211:48:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nlibrary UInt {\n function asSingletonArray(uint256 element)\n internal\n pure\n returns (uint256[] memory)\n {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n return array;\n }\n}\n",
"sourcePath": "/Users/zhl/Documents/workspace/game/becrypto/contracts/utils/UInt.sol",
"ast": {
"absolutePath": "project:/contracts/utils/UInt.sol",
"exportedSymbols": {
"UInt": [
11488
]
},
"id": 11489,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 11459,
"literals": [
"solidity",
"0.8",
".10"
],
"nodeType": "PragmaDirective",
"src": "32:23:48"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "UInt",
"contractDependencies": [],
"contractKind": "library",
"fullyImplemented": true,
"id": 11488,
"linearizedBaseContracts": [
11488
],
"name": "UInt",
"nameLocation": "65:4:48",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 11486,
"nodeType": "Block",
"src": "172:94:48",
"statements": [
{
"assignments": [
11471
],
"declarations": [
{
"constant": false,
"id": 11471,
"mutability": "mutable",
"name": "array",
"nameLocation": "195:5:48",
"nodeType": "VariableDeclaration",
"scope": 11486,
"src": "178:22:48",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11469,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "178:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11470,
"nodeType": "ArrayTypeName",
"src": "178:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"id": 11477,
"initialValue": {
"arguments": [
{
"hexValue": "31",
"id": 11475,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "217:1:48",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"id": 11474,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "203:13:48",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 11472,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "207:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11473,
"nodeType": "ArrayTypeName",
"src": "207:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 11476,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "203:16:48",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "178:41:48"
},
{
"expression": {
"id": 11482,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 11478,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11471,
"src": "225:5:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 11480,
"indexExpression": {
"hexValue": "30",
"id": 11479,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "231:1:48",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "225:8:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 11481,
"name": "element",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11461,
"src": "236:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "225:18:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11483,
"nodeType": "ExpressionStatement",
"src": "225:18:48"
},
{
"expression": {
"id": 11484,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11471,
"src": "256:5:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 11466,
"id": 11485,
"nodeType": "Return",
"src": "249:12:48"
}
]
},
"id": 11487,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "asSingletonArray",
"nameLocation": "83:16:48",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 11462,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11461,
"mutability": "mutable",
"name": "element",
"nameLocation": "108:7:48",
"nodeType": "VariableDeclaration",
"scope": 11487,
"src": "100:15:48",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11460,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "100:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "99:17:48"
},
"returnParameters": {
"id": 11466,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11465,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 11487,
"src": "152:16:48",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11463,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "152:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11464,
"nodeType": "ArrayTypeName",
"src": "152:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"src": "151:18:48"
},
"scope": 11488,
"src": "74:192:48",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 11489,
"src": "57:211:48",
"usedErrors": []
}
],
"src": "32:237:48"
},
"legacyAST": {
"absolutePath": "project:/contracts/utils/UInt.sol",
"exportedSymbols": {
"UInt": [
11488
]
},
"id": 11489,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 11459,
"literals": [
"solidity",
"0.8",
".10"
],
"nodeType": "PragmaDirective",
"src": "32:23:48"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "UInt",
"contractDependencies": [],
"contractKind": "library",
"fullyImplemented": true,
"id": 11488,
"linearizedBaseContracts": [
11488
],
"name": "UInt",
"nameLocation": "65:4:48",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 11486,
"nodeType": "Block",
"src": "172:94:48",
"statements": [
{
"assignments": [
11471
],
"declarations": [
{
"constant": false,
"id": 11471,
"mutability": "mutable",
"name": "array",
"nameLocation": "195:5:48",
"nodeType": "VariableDeclaration",
"scope": 11486,
"src": "178:22:48",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11469,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "178:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11470,
"nodeType": "ArrayTypeName",
"src": "178:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"id": 11477,
"initialValue": {
"arguments": [
{
"hexValue": "31",
"id": 11475,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "217:1:48",
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
}
],
"id": 11474,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "203:13:48",
"typeDescriptions": {
"typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_array$_t_uint256_$dyn_memory_ptr_$",
"typeString": "function (uint256) pure returns (uint256[] memory)"
},
"typeName": {
"baseType": {
"id": 11472,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "207:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11473,
"nodeType": "ArrayTypeName",
"src": "207:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 11476,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "203:16:48",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "178:41:48"
},
{
"expression": {
"id": 11482,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 11478,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11471,
"src": "225:5:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 11480,
"indexExpression": {
"hexValue": "30",
"id": 11479,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "231:1:48",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "225:8:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 11481,
"name": "element",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11461,
"src": "236:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "225:18:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11483,
"nodeType": "ExpressionStatement",
"src": "225:18:48"
},
{
"expression": {
"id": 11484,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11471,
"src": "256:5:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 11466,
"id": 11485,
"nodeType": "Return",
"src": "249:12:48"
}
]
},
"id": 11487,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "asSingletonArray",
"nameLocation": "83:16:48",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 11462,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11461,
"mutability": "mutable",
"name": "element",
"nameLocation": "108:7:48",
"nodeType": "VariableDeclaration",
"scope": 11487,
"src": "100:15:48",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11460,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "100:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "99:17:48"
},
"returnParameters": {
"id": 11466,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11465,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 11487,
"src": "152:16:48",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11463,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "152:7:48",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11464,
"nodeType": "ArrayTypeName",
"src": "152:9:48",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"src": "151:18:48"
},
"scope": 11488,
"src": "74:192:48",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 11489,
"src": "57:211:48",
"usedErrors": []
}
],
"src": "32:237:48"
},
"compiler": {
"name": "solc",
"version": "0.8.10+commit.fc410830.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2022-10-14T05:18:29.972Z",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}