UNPKG

@etherisc/registry-contracts

Version:

Etherisc's smart contracts for the registry.

1,175 lines (1,174 loc) 107 kB
{ "abi": [], "allSourcePaths": { "4": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts-upgradeable@4.8.2/contracts/utils/StringsUpgradeable.sol", "5": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts-upgradeable@4.8.2/contracts/utils/math/MathUpgradeable.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts-upgradeable@4.8.2/contracts/utils/StringsUpgradeable.sol", "exportedSymbols": { "MathUpgradeable": [ 16662 ], "StringsUpgradeable": [ 12263 ] }, "id": 12264, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 12090, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "101:23:4" }, { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts-upgradeable@4.8.2/contracts/utils/math/MathUpgradeable.sol", "file": "./math/MathUpgradeable.sol", "id": 12091, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 12264, "sourceUnit": 16663, "src": "126:36:4", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "canonicalName": "StringsUpgradeable", "contractDependencies": [], "contractKind": "library", "documentation": { "id": 12092, "nodeType": "StructuredDocumentation", "src": "164:34:4", "text": " @dev String operations." }, "fullyImplemented": true, "id": 12263, "linearizedBaseContracts": [ 12263 ], "name": "StringsUpgradeable", "nameLocation": "207:18:4", "nodeType": "ContractDefinition", "nodes": [ { "constant": true, "id": 12095, "mutability": "constant", "name": "_SYMBOLS", "nameLocation": "257:8:4", "nodeType": "VariableDeclaration", "scope": 12263, "src": "232:54:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" }, "typeName": { "id": 12093, "name": "bytes16", "nodeType": "ElementaryTypeName", "src": "232:7:4", "typeDescriptions": { "typeIdentifier": "t_bytes16", "typeString": "bytes16" } }, "value": { "hexValue": "30313233343536373839616263646566", "id": 12094, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "268:18:4", "typeDescriptions": { "typeIdentifier": "t_stringliteral_cb29997ed99ead0db59ce4d12b7d3723198c827273e5796737c926d78019c39f", "typeString": "literal_string \"0123456789abcdef\"" }, "value": "0123456789abcdef" }, "visibility": "private" }, { "constant": true, "id": 12098, "mutability": "constant", "name": "_ADDRESS_LENGTH", "nameLocation": "315:15:4", "nodeType": "VariableDeclaration", "scope": 12263, "src": "292:43:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" }, "typeName": { "id": 12096, "name": "uint8", "nodeType": "ElementaryTypeName", "src": "292:5:4", "typeDescriptions": { "typeIdentifier": "t_uint8", "typeString": "uint8" } }, "value": { "hexValue": "3230", "id": 12097, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "333:2:4", "typeDescriptions": { "typeIdentifier": "t_rational_20_by_1", "typeString": "int_const 20" }, "value": "20" }, "visibility": "private" }, { "body": { "id": 12145, "nodeType": "Block", "src": "508:636:4", "statements": [ { "id": 12144, "nodeType": "UncheckedBlock", "src": "518:620:4", "statements": [ { "assignments": [ 12107 ], "declarations": [ { "constant": false, "id": 12107, "mutability": "mutable", "name": "length", "nameLocation": "550:6:4", "nodeType": "VariableDeclaration", "scope": 12144, "src": "542:14:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 12106, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "542:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 12114, "initialValue": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12113, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 12110, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12101, "src": "581:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "id": 12108, "name": "MathUpgradeable", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16662, "src": "559:15:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_MathUpgradeable_$16662_$", "typeString": "type(library MathUpgradeable)" } }, "id": 12109, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "575:5:4", "memberName": "log10", "nodeType": "MemberAccess", "referencedDeclaration": 16499, "src": "559:21:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 12111, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "559:28:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 12112, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "590:1:4", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "559:32:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "VariableDeclarationStatement", "src": "542:49:4" }, { "assignments": [ 12116 ], "declarations": [ { "constant": false, "id": 12116, "mutability": "mutable", "name": "buffer", "nameLocation": "619:6:4", "nodeType": "VariableDeclaration", "scope": 12144, "src": "605:20:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 12115, "name": "string", "nodeType": "ElementaryTypeName", "src": "605:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "id": 12121, "initialValue": { "arguments": [ { "id": 12119, "name": "length", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12107, "src": "639:6:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 12118, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "NewExpression", "src": "628:10:4", "typeDescriptions": { "typeIdentifier": "t_function_objectcreation_pure$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256) pure returns (string memory)" }, "typeName": { "id": 12117, "name": "string", "nodeType": "ElementaryTypeName", "src": "632:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } } }, "id": 12120, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "628:18:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "nodeType": "VariableDeclarationStatement", "src": "605:41:4" }, { "assignments": [ 12123 ], "declarations": [ { "constant": false, "id": 12123, "mutability": "mutable", "name": "ptr", "nameLocation": "668:3:4", "nodeType": "VariableDeclaration", "scope": 12144, "src": "660:11:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 12122, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "660:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "id": 12124, "nodeType": "VariableDeclarationStatement", "src": "660:11:4" }, { "AST": { "nodeType": "YulBlock", "src": "741:67:4", "statements": [ { "nodeType": "YulAssignment", "src": "759:35:4", "value": { "arguments": [ { "name": "buffer", "nodeType": "YulIdentifier", "src": "770:6:4" }, { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "782:2:4", "type": "", "value": "32" }, { "name": "length", "nodeType": "YulIdentifier", "src": "786:6:4" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "778:3:4" }, "nodeType": "YulFunctionCall", "src": "778:15:4" } ], "functionName": { "name": "add", "nodeType": "YulIdentifier", "src": "766:3:4" }, "nodeType": "YulFunctionCall", "src": "766:28:4" }, "variableNames": [ { "name": "ptr", "nodeType": "YulIdentifier", "src": "759:3:4" } ] } ] }, "documentation": "@solidity memory-safe-assembly", "evmVersion": "istanbul", "externalReferences": [ { "declaration": 12116, "isOffset": false, "isSlot": false, "src": "770:6:4", "valueSize": 1 }, { "declaration": 12107, "isOffset": false, "isSlot": false, "src": "786:6:4", "valueSize": 1 }, { "declaration": 12123, "isOffset": false, "isSlot": false, "src": "759:3:4", "valueSize": 1 } ], "id": 12125, "nodeType": "InlineAssembly", "src": "732:76:4" }, { "body": { "id": 12140, "nodeType": "Block", "src": "834:267:4", "statements": [ { "expression": { "id": 12128, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "--", "prefix": false, "src": "852:5:4", "subExpression": { "id": 12127, "name": "ptr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12123, "src": "852:3:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 12129, "nodeType": "ExpressionStatement", "src": "852:5:4" }, { "AST": { "nodeType": "YulBlock", "src": "935:84:4", "statements": [ { "expression": { "arguments": [ { "name": "ptr", "nodeType": "YulIdentifier", "src": "965:3:4" }, { "arguments": [ { "arguments": [ { "name": "value", "nodeType": "YulIdentifier", "src": "979:5:4" }, { "kind": "number", "nodeType": "YulLiteral", "src": "986:2:4", "type": "", "value": "10" } ], "functionName": { "name": "mod", "nodeType": "YulIdentifier", "src": "975:3:4" }, "nodeType": "YulFunctionCall", "src": "975:14:4" }, { "name": "_SYMBOLS", "nodeType": "YulIdentifier", "src": "991:8:4" } ], "functionName": { "name": "byte", "nodeType": "YulIdentifier", "src": "970:4:4" }, "nodeType": "YulFunctionCall", "src": "970:30:4" } ], "functionName": { "name": "mstore8", "nodeType": "YulIdentifier", "src": "957:7:4" }, "nodeType": "YulFunctionCall", "src": "957:44:4" }, "nodeType": "YulExpressionStatement", "src": "957:44:4" } ] }, "documentation": "@solidity memory-safe-assembly", "evmVersion": "istanbul", "externalReferences": [ { "declaration": 12095, "isOffset": false, "isSlot": false, "src": "991:8:4", "valueSize": 1 }, { "declaration": 12123, "isOffset": false, "isSlot": false, "src": "965:3:4", "valueSize": 1 }, { "declaration": 12101, "isOffset": false, "isSlot": false, "src": "979:5:4", "valueSize": 1 } ], "id": 12130, "nodeType": "InlineAssembly", "src": "926:93:4" }, { "expression": { "id": 12133, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 12131, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12101, "src": "1036:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "Assignment", "operator": "/=", "rightHandSide": { "hexValue": "3130", "id": 12132, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1045:2:4", "typeDescriptions": { "typeIdentifier": "t_rational_10_by_1", "typeString": "int_const 10" }, "value": "10" }, "src": "1036:11:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 12134, "nodeType": "ExpressionStatement", "src": "1036:11:4" }, { "condition": { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12137, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "id": 12135, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12101, "src": "1069:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "hexValue": "30", "id": 12136, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1078:1:4", "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1069:10:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 12139, "nodeType": "IfStatement", "src": "1065:21:4", "trueBody": { "id": 12138, "nodeType": "Break", "src": "1081:5:4" } } ] }, "condition": { "hexValue": "74727565", "id": 12126, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "828:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "id": 12141, "nodeType": "WhileStatement", "src": "821:280:4" }, { "expression": { "id": 12142, "name": "buffer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12116, "src": "1121:6:4", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 12105, "id": 12143, "nodeType": "Return", "src": "1114:13:4" } ] } ] }, "documentation": { "id": 12099, "nodeType": "StructuredDocumentation", "src": "342:90:4", "text": " @dev Converts a `uint256` to its ASCII `string` decimal representation." }, "id": 12146, "implemented": true, "kind": "function", "modifiers": [], "name": "toString", "nameLocation": "446:8:4", "nodeType": "FunctionDefinition", "parameters": { "id": 12102, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12101, "mutability": "mutable", "name": "value", "nameLocation": "463:5:4", "nodeType": "VariableDeclaration", "scope": 12146, "src": "455:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 12100, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "455:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "454:15:4" }, "returnParameters": { "id": 12105, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12104, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 12146, "src": "493:13:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 12103, "name": "string", "nodeType": "ElementaryTypeName", "src": "493:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "492:15:4" }, "scope": 12263, "src": "437:707:4", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 12165, "nodeType": "Block", "src": "1323:111:4", "statements": [ { "id": 12164, "nodeType": "UncheckedBlock", "src": "1333:95:4", "statements": [ { "expression": { "arguments": [ { "id": 12155, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12149, "src": "1376:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 12161, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 12158, "name": "value", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12149, "src": "1406:5:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "expression": { "id": 12156, "name": "MathUpgradeable", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 16662, "src": "1383:15:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_MathUpgradeable_$16662_$", "typeString": "type(library MathUpgradeable)" } }, "id": 12157, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberLocation": "1399:6:4", "memberName": "log256", "nodeType": "MemberAccess", "referencedDeclaration": 16622, "src": "1383:22:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$returns$_t_uint256_$", "typeString": "function (uint256) pure returns (uint256)" } }, "id": 12159, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1383:29:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": "+", "rightExpression": { "hexValue": "31", "id": 12160, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1415:1:4", "typeDescriptions": { "typeIdentifier": "t_rational_1_by_1", "typeString": "int_const 1" }, "value": "1" }, "src": "1383:33:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_uint256", "typeString": "uint256" }, { "typeIdentifier": "t_uint256", "typeString": "uint256" } ], "id": 12154, "name": "toHexString", "nodeType": "Identifier", "overloadedDeclarations": [ 12166, 12242, 12262 ], "referencedDeclaration": 12242, "src": "1364:11:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$_t_uint256_$_t_uint256_$returns$_t_string_memory_ptr_$", "typeString": "function (uint256,uint256) pure returns (string memory)" } }, "id": 12162, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1364:53:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "functionReturnParameters": 12153, "id": 12163, "nodeType": "Return", "src": "1357:60:4" } ] } ] }, "documentation": { "id": 12147, "nodeType": "StructuredDocumentation", "src": "1150:94:4", "text": " @dev Converts a `uint256` to its ASCII `string` hexadecimal representation." }, "id": 12166, "implemented": true, "kind": "function", "modifiers": [], "name": "toHexString", "nameLocation": "1258:11:4", "nodeType": "FunctionDefinition", "parameters": { "id": 12150, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12149, "mutability": "mutable", "name": "value", "nameLocation": "1278:5:4", "nodeType": "VariableDeclaration", "scope": 12166, "src": "1270:13:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 12148, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "1270:7:4", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "visibility": "internal" } ], "src": "1269:15:4" }, "returnParameters": { "id": 12153, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 12152, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 12166, "src": "1308:13:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 12151, "name": "string", "nodeType": "ElementaryTypeName", "src": "1308:6:4", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1307:15:4" }, "scope": 12263, "src": "1249:185:4", "stateMutability": "pure", "virtual": false, "visibility": "internal" }, { "body": { "id": 12241, "nodeType": "Block", "src": "1647:347:4", "statements": [ { "assignments": [ 12177 ], "declarations": [ { "constant": false, "id": 12177, "mutability": "mutable", "name": "buffer", "nameLocation": "1670:6:4", "nodeType": "VariableDeclaration", "scope": 12241, "src": "1657:19:4", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" },