2022-08-17 17:21:15 +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\":\"0x137247f9f248803d3163e93d37120ebc2c848c45af4733b82f417a56b93d1ad2\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e5e99614dd7cdcce84a664837ed5db44f81e56ddf6f288a905e56c93e7c9a2d5\",\"dweb:/ipfs/QmWhiM1isqnFyvjzSqZD6qs7gYayHEpszG8CV1CUjBdC3u\"]}},\"version\":1}",
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ba2c95fc026962092e83d6add832bf3663ad167c96158affa3769e24358a33dd64736f6c634300080a0033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220ba2c95fc026962092e83d6add832bf3663ad167c96158affa3769e24358a33dd64736f6c634300080a0033",
"immutableReferences": {},
"generatedSources": [],
"deployedGeneratedSources": [],
"sourceMap": "57:197:55:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "57:197:55:-:0;;;;;;;;",
"source": "// SPDX-License-Identifier: MIT\npragma solidity 0.8.10;\n\nlibrary UInt{\n\n function asSingletonArray(uint256 element) internal pure returns (uint256[] memory) {\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": [
12021
]
},
"id": 12022,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 11992,
"literals": [
"solidity",
"0.8",
".10"
],
"nodeType": "PragmaDirective",
"src": "32:23:55"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "UInt",
"contractDependencies": [],
"contractKind": "library",
"fullyImplemented": true,
"id": 12021,
"linearizedBaseContracts": [
12021
],
"name": "UInt",
"nameLocation": "65:4:55",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 12019,
"nodeType": "Block",
"src": "158:94:55",
"statements": [
{
"assignments": [
12004
],
"declarations": [
{
"constant": false,
"id": 12004,
"mutability": "mutable",
"name": "array",
"nameLocation": "181:5:55",
"nodeType": "VariableDeclaration",
"scope": 12019,
"src": "164:22:55",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 12002,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "164:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12003,
"nodeType": "ArrayTypeName",
"src": "164:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"id": 12010,
"initialValue": {
"arguments": [
{
"hexValue": "31",
"id": 12008,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "203:1:55",
"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": 12007,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "189:13:55",
"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": 12005,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "193:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12006,
"nodeType": "ArrayTypeName",
"src": "193:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 12009,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "189:16:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "164:41:55"
},
{
"expression": {
"id": 12015,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 12011,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12004,
"src": "211:5:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 12013,
"indexExpression": {
"hexValue": "30",
"id": 12012,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "217:1:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "211:8:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 12014,
"name": "element",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11994,
"src": "222:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "211:18:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12016,
"nodeType": "ExpressionStatement",
"src": "211:18:55"
},
{
"expression": {
"id": 12017,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12004,
"src": "242:5:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 11999,
"id": 12018,
"nodeType": "Return",
"src": "235:12:55"
}
]
},
"id": 12020,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "asSingletonArray",
"nameLocation": "83:16:55",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 11995,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11994,
"mutability": "mutable",
"name": "element",
"nameLocation": "108:7:55",
"nodeType": "VariableDeclaration",
"scope": 12020,
"src": "100:15:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11993,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "100:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "99:17:55"
},
"returnParameters": {
"id": 11999,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11998,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 12020,
"src": "140:16:55",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11996,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "140:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11997,
"nodeType": "ArrayTypeName",
"src": "140:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"src": "139:18:55"
},
"scope": 12021,
"src": "74:178:55",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 12022,
"src": "57:197:55",
"usedErrors": []
}
],
"src": "32:223:55"
},
"legacyAST": {
"absolutePath": "project:/contracts/utils/UInt.sol",
"exportedSymbols": {
"UInt": [
12021
]
},
"id": 12022,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 11992,
"literals": [
"solidity",
"0.8",
".10"
],
"nodeType": "PragmaDirective",
"src": "32:23:55"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "UInt",
"contractDependencies": [],
"contractKind": "library",
"fullyImplemented": true,
"id": 12021,
"linearizedBaseContracts": [
12021
],
"name": "UInt",
"nameLocation": "65:4:55",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 12019,
"nodeType": "Block",
"src": "158:94:55",
"statements": [
{
"assignments": [
12004
],
"declarations": [
{
"constant": false,
"id": 12004,
"mutability": "mutable",
"name": "array",
"nameLocation": "181:5:55",
"nodeType": "VariableDeclaration",
"scope": 12019,
"src": "164:22:55",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 12002,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "164:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12003,
"nodeType": "ArrayTypeName",
"src": "164:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"id": 12010,
"initialValue": {
"arguments": [
{
"hexValue": "31",
"id": 12008,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "203:1:55",
"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": 12007,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "NewExpression",
"src": "189:13:55",
"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": 12005,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "193:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12006,
"nodeType": "ArrayTypeName",
"src": "193:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
}
},
"id": 12009,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "189:16:55",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "164:41:55"
},
{
"expression": {
"id": 12015,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"baseExpression": {
"id": 12011,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12004,
"src": "211:5:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"id": 12013,
"indexExpression": {
"hexValue": "30",
"id": 12012,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "217:1:55",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "211:8:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 12014,
"name": "element",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11994,
"src": "222:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "211:18:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 12016,
"nodeType": "ExpressionStatement",
"src": "211:18:55"
},
{
"expression": {
"id": 12017,
"name": "array",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 12004,
"src": "242:5:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[] memory"
}
},
"functionReturnParameters": 11999,
"id": 12018,
"nodeType": "Return",
"src": "235:12:55"
}
]
},
"id": 12020,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "asSingletonArray",
"nameLocation": "83:16:55",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 11995,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11994,
"mutability": "mutable",
"name": "element",
"nameLocation": "108:7:55",
"nodeType": "VariableDeclaration",
"scope": 12020,
"src": "100:15:55",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 11993,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "100:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "99:17:55"
},
"returnParameters": {
"id": 11999,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 11998,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 12020,
"src": "140:16:55",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_memory_ptr",
"typeString": "uint256[]"
},
"typeName": {
"baseType": {
"id": 11996,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "140:7:55",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"id": 11997,
"nodeType": "ArrayTypeName",
"src": "140:9:55",
"typeDescriptions": {
"typeIdentifier": "t_array$_t_uint256_$dyn_storage_ptr",
"typeString": "uint256[]"
}
},
"visibility": "internal"
}
],
"src": "139:18:55"
},
"scope": 12021,
"src": "74:178:55",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
}
],
"scope": 12022,
"src": "57:197:55",
"usedErrors": []
}
],
"src": "32:223:55"
},
"compiler": {
"name": "solc",
"version": "0.8.10+commit.fc410830.Emscripten.clang"
},
"networks": {},
"schemaVersion": "3.4.4",
"updatedAt": "2022-08-17T06:09:48.455Z",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}