UNPKG

@etherisc/registry-contracts

Version:

Etherisc's smart contracts for the registry.

1,177 lines 107 kB
{ "abi": [], "allSourcePaths": { "25": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/Strings.sol", "30": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/math/Math.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/Strings.sol", "exportedSymbols": { "Math": [ 13636 ], "Strings": [ 17301 ] }, "id": 17302, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 17128, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "101:23:25" }, { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/utils/math/Math.sol", "file": "./math/Math.sol", "id": 17129, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 17302, "sourceUnit": 13637, "src": "126:25:25", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "Strings", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 17130, "nodeType": "StructuredDocumentation", "src": "153:34:25", "text": " @dev String operations." }, "fullyImplemented": true, "id": 17301, "linearizedBaseContracts": [ 17301 ], "name": "Strings", "nameLocation": "196:7:25", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 17133, "mutability": "constant", "name": "_SYMBOLS", "nameLocation": "235:8:25", "nodeType": "VariableDeclaration", "scope": 17301, "src": "210:54:25", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 17131, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "210:7:25", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": { "hexValue": "30313233343536373839616263646566", "id": 17132, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "246:18:25", "typeDescriptions": { "typeIdentifier": "t_stringliteral_cb29997ed99ead0db59ce4d12b7d3723198c827273e5796737c926d78019c39f", "typeString": "literal_string \"0123456789abcdef\"" }, "value": "0123456789abcdef" }, "visibility": "private" }, { "constant": true, "id": 17136, "mutability": "constant", "name": "_ADDRESS_LENGTH", "nameLocation": "293:15:25", "nodeType": "VariableDeclaration", "scope": 17301, "src": "270:43:25", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 17134, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "270:5:25", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": { "hexValue": "3230", "id": 17135, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "311:2:25", "typeDescriptions": { "typeIdentifier": "t_rational_20_by_1", "typeString": "int_const 20" }, "value": "20" }, "visibility": "private" }, { "body": { "id": 17183, "nodeType": "Block", "src": "486:625:25", "statements": [ { "id": 17182, "nodeType": "UncheckedBlock", "src": "496:609:25", "statements": [ { "assignments": [ 17145 ], "declarations": [ { "constant": false, "id": 17145, "mutability": "mutable", "name": "length", "nameLocation": "528:6:25", "nodeType": "VariableDeclaration", "scope": 17182, "src": "520:14:25", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 17144, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "520:7:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 17152, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 17151, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 17148, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17139, "src": "548:5:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "id": 17146, "name": "Math", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13636, "src": "537:4:25", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Math_$13636_$", "typeString": "type(library Math)" } }, "id": 17147, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "542:5:25", "memberName": "log10", "nodeType": "MemberAccess", "referencedDeclaration": 13473, "src": "537:10:25", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 17149, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "537:17:25", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 17150, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "557:1:25", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "537:21:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "520:38:25" }, { "assignments": [ 17154 ], "declarations": [ { "constant": false, "id": 17154, "mutability": "mutable", "name": "buffer", "nameLocation": "586:6:25", "nodeType": "VariableDeclaration", "scope": 17182, "src": "572:20:25", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 17153, "name": "string", "nodeType": "ElementaryTypeName", "src": "572:6:25", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "id": 17159, "initialValue": { "arguments": [ { "id": 17157, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17145, "src": "606:6:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 17156, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "595:10:25", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256) pure returns (string memory)" }, "typeName": { "id": 17155, "name": "string", "nodeType": "ElementaryTypeName", "src": "599:6:25", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } } }, "id": 17158, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "595:18:25", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "nodeType": "VariableDeclarationStatement", "src": "572:41:25" }, { "assignments": [ 17161 ], "declarations": [ { "constant": false, "id": 17161, "mutability": "mutable", "name": "ptr", "nameLocation": "635:3:25", "nodeType": "VariableDeclaration", "scope": 17182, "src": "627:11:25", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 17160, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "627:7:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 17162, "nodeType": "VariableDeclarationStatement", "src": "627:11:25" }, { "AST": { "nodeType": "YulBlock", "src": "708:67:25", "statements": [ { "nodeType": "YulAssignment", "src": "726:35:25", "value": { "arguments": [ { "name": "buffer", "nodeType": "YulIdentifier", "src": "737:6:25" }, { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "749:2:25", "type": "", "value": "32" }, { "name": "length", "nodeType": "YulIdentifier", "src": "753:6:25" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "745:3:25" }, "nodeType": "YulFunctionCall", "src": "745:15:25" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "733:3:25" }, "nodeType": "YulFunctionCall", "src": "733:28:25" }, "variableNames": [ { "name": "ptr", "nodeType": "YulIdentifier", "src": "726:3:25" } ] } ] }, "documentation": "@solidity memory-safe-assembly", "evmVersion": "istanbul", "externalReferences": [ { "declaration": 17154, "isOffset": false, "isSlot": false, "src": "737:6:25", "valueSize": 1 }, { "declaration": 17145, "isOffset": false, "isSlot": false, "src": "753:6:25", "valueSize": 1 }, { "declaration": 17161, "isOffset": false, "isSlot": false, "src": "726:3:25", "valueSize": 1 } ], "id": 17163, "nodeType": "InlineAssembly", "src": "699:76:25" }, { "body": { "id": 17178, "nodeType": "Block", "src": "801:267:25", "statements": [ { "expression": { "id": 17166, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "--", "prefix": false, "src": "819:5:25", "subExpression": { "id": 17165, "name": "ptr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17161, "src": "819:3:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 17167, "nodeType": "ExpressionStatement", "src": "819:5:25" }, { "AST": { "nodeType": "YulBlock", "src": "902:84:25", "statements": [ { "expression": { "arguments": [ { "name": "ptr", "nodeType": "YulIdentifier", "src": "932:3:25" }, { "arguments": [ { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "946:5:25" }, { "kind": "number", "nodeType": "YulLiteral", "src": "953:2:25", "type": "", "value": "10" } ], "functionName": { "name": "mod", "nodeType": "YulIdentifier", "src": "942:3:25" }, "nodeType": "YulFunctionCall", "src": "942:14:25" }, { "name": "_SYMBOLS", "nodeType": "YulIdentifier", "src": "958:8:25" } ], "functionName": { "name": "byte", "nodeType": "YulIdentifier", "src": "937:4:25" }, "nodeType": "YulFunctionCall", "src": "937:30:25" } ], "functionName": { "name": "mstore8", "nodeType": "YulIdentifier", "src": "924:7:25" }, "nodeType": "YulFunctionCall", "src": "924:44:25" }, "nodeType": "YulExpressionStatement", "src": "924:44:25" } ] }, "documentation": "@solidity memory-safe-assembly", "evmVersion": "istanbul", "externalReferences": [ { "declaration": 17133, "isOffset": false, "isSlot": false, "src": "958:8:25", "valueSize": 1 }, { "declaration": 17161, "isOffset": false, "isSlot": false, "src": "932:3:25", "valueSize": 1 }, { "declaration": 17139, "isOffset": false, "isSlot": false, "src": "946:5:25", "valueSize": 1 } ], "id": 17168, "nodeType": "InlineAssembly", "src": "893:93:25" }, { "expression": { "id": 17171, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 17169, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17139, "src": "1003:5:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 17170, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1012:2:25", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "1003:11:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 17172, "nodeType": "ExpressionStatement", "src": "1003:11:25" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 17175, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 17173, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17139, "src": "1036:5:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 17174, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1045:1:25", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1036:10:25", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 17177, "nodeType": "IfStatement", "src": "1032:21:25", "trueBody": { "id": 17176, "nodeType": "Break", "src": "1048:5:25" } } ] }, "condition": { "hexValue": "74727565", "id": 17164, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "795:4:25", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "id": 17179, "nodeType": "WhileStatement", "src": "788:280:25" }, { "expression": { "id": 17180, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17154, "src": "1088:6:25", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 17143, "id": 17181, "nodeType": "Return", "src": "1081:13:25" } ] } ] }, "documentation": { "id": 17137, "nodeType": "StructuredDocumentation", "src": "320:90:25", "text": " @dev Converts a `uint256` to its ASCII `string` decimal representation." }, "id": 17184, "implemented": true, "kind": "function", "modifiers": [], "name": "toString", "nameLocation": "424:8:25", "nodeType": "FunctionDefinition", "parameters": { "id": 17140, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 17139, "mutability": "mutable", "name": "value", "nameLocation": "441:5:25", "nodeType": "VariableDeclaration", "scope": 17184, "src": "433:13:25", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 17138, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "433:7:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "432:15:25" }, "returnParameters": { "id": 17143, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 17142, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 17184, "src": "471:13:25", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 17141, "name": "string", "nodeType": "ElementaryTypeName", "src": "471:6:25", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "470:15:25" }, "scope": 17301, "src": "415:696:25", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 17203, "nodeType": "Block", "src": "1290:100:25", "statements": [ { "id": 17202, "nodeType": "UncheckedBlock", "src": "1300:84:25", "statements": [ { "expression": { "arguments": [ { "id": 17193, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17187, "src": "1343:5:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 17199, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 17196, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 17187, "src": "1362:5:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "id": 17194, "name": "Math", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 13636, "src": "1350:4:25", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Math_$13636_$", "typeString": "type(library Math)" } }, "id": 17195, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "1355:6:25", "memberName": "log256", "nodeType": "MemberAccess", "referencedDeclaration": 13596, "src": "1350:11:25", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 17197, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1350:18:25", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 17198, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1371:1:25", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1350:22:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 17192, "name": "toHexString", "nodeType": "Identifier", "overloadedDeclarations": [ 17204, 17280, 17300 ], "referencedDeclaration": 17280, "src": "1331:11:25", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256,uint256) pure returns (string memory)" } }, "id": 17200, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1331:42:25", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 17191, "id": 17201, "nodeType": "Return", "src": "1324:49:25" } ] } ] }, "documentation": { "id": 17185, "nodeType": "StructuredDocumentation", "src": "1117:94:25", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation." }, "id": 17204, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1225:11:25", "nodeType": "FunctionDefinition", "parameters": { "id": 17188, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 17187, "mutability": "mutable", "name": "value", "nameLocation": "1245:5:25", "nodeType": "VariableDeclaration", "scope": 17204, "src": "1237:13:25", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 17186, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1237:7:25", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1236:15:25" }, "returnParameters": { "id": 17191, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 17190, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 17204, "src": "1275:13:25", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 17189, "name": "string", "nodeType": "ElementaryTypeName", "src": "1275:6:25", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1274:15:25" }, "scope": 17301, "src": "1216:174:25", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 17279, "nodeType": "Block", "src": "1603:347:25", "statements": [ { "assignments": [ 17215 ], "declarations": [ { "constant": false, "id": 17215, "mutability": "mutable", "name": "buffer", "nameLocation": "1626:6:25", "nodeType": "VariableDeclaration", "scope": 17279, "src": "1613:19:25", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 17214, "name": "by