UNPKG

@etherisc/registry-contracts

Version:

Etherisc's smart contracts for the registry.

838 lines 36.3 kB
{ "abi": [ { "stateMutability": "payable", "type": "fallback" }, { "stateMutability": "payable", "type": "receive" } ], "allSourcePaths": { "10": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/proxy/Proxy.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/proxy/Proxy.sol", "exportedSymbols": { "Proxy": [ 18082 ] }, "id": 18083, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 18032, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "99:23:10" }, { "abstract": true, "baseContracts": [], "canonicalName": "Proxy", "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 18033, "nodeType": "StructuredDocumentation", "src": "124:598:10", "text": " @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n be specified by overriding the virtual {_implementation} function.\n Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n different contract through the {_delegate} function.\n The success and return data of the delegated call will be returned back to the caller of the proxy." }, "fullyImplemented": false, "id": 18082, "linearizedBaseContracts": [ 18082 ], "name": "Proxy", "nameLocation": "741:5:10", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 18040, "nodeType": "Block", "src": "1008:835:10", "statements": [ { "AST": { "nodeType": "YulBlock", "src": "1027:810:10", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1280:1:10", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1283:1:10", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "calldatasize", "nodeType": "YulIdentifier", "src": "1286:12:10" }, "nodeType": "YulFunctionCall", "src": "1286:14:10" } ], "functionName": { "name": "calldatacopy", "nodeType": "YulIdentifier", "src": "1267:12:10" }, "nodeType": "YulFunctionCall", "src": "1267:34:10" }, "nodeType": "YulExpressionStatement", "src": "1267:34:10" }, { "nodeType": "YulVariableDeclaration", "src": "1428:74:10", "value": { "arguments": [ { "arguments": [], "functionName": { "name": "gas", "nodeType": "YulIdentifier", "src": "1455:3:10" }, "nodeType": "YulFunctionCall", "src": "1455:5:10" }, { "name": "implementation", "nodeType": "YulIdentifier", "src": "1462:14:10" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1478:1:10", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "calldatasize", "nodeType": "YulIdentifier", "src": "1481:12:10" }, "nodeType": "YulFunctionCall", "src": "1481:14:10" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1497:1:10", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1500:1:10", "type": "", "value": "0" } ], "functionName": { "name": "delegatecall", "nodeType": "YulIdentifier", "src": "1442:12:10" }, "nodeType": "YulFunctionCall", "src": "1442:60:10" }, "variables": [ { "name": "result", "nodeType": "YulTypedName", "src": "1432:6:10", "type": "" } ] }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1570:1:10", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1573:1:10", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1576:14:10" }, "nodeType": "YulFunctionCall", "src": "1576:16:10" } ], "functionName": { "name": "returndatacopy", "nodeType": "YulIdentifier", "src": "1555:14:10" }, "nodeType": "YulFunctionCall", "src": "1555:38:10" }, "nodeType": "YulExpressionStatement", "src": "1555:38:10" }, { "cases": [ { "body": { "nodeType": "YulBlock", "src": "1688:59:10", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1713:1:10", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1716:14:10" }, "nodeType": "YulFunctionCall", "src": "1716:16:10" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "1706:6:10" }, "nodeType": "YulFunctionCall", "src": "1706:27:10" }, "nodeType": "YulExpressionStatement", "src": "1706:27:10" } ] }, "nodeType": "YulCase", "src": "1681:66:10", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "1686:1:10", "type": "", "value": "0" } }, { "body": { "nodeType": "YulBlock", "src": "1768:59:10", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1793:1:10", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1796:14:10" }, "nodeType": "YulFunctionCall", "src": "1796:16:10" } ], "functionName": { "name": "return", "nodeType": "YulIdentifier", "src": "1786:6:10" }, "nodeType": "YulFunctionCall", "src": "1786:27:10" }, "nodeType": "YulExpressionStatement", "src": "1786:27:10" } ] }, "nodeType": "YulCase", "src": "1760:67:10", "value": "default" } ], "expression": { "name": "result", "nodeType": "YulIdentifier", "src": "1614:6:10" }, "nodeType": "YulSwitch", "src": "1607:220:10" } ] }, "evmVersion": "istanbul", "externalReferences": [ { "declaration": 18036, "isOffset": false, "isSlot": false, "src": "1462:14:10", "valueSize": 1 } ], "id": 18039, "nodeType": "InlineAssembly", "src": "1018:819:10" } ] }, "documentation": { "id": 18034, "nodeType": "StructuredDocumentation", "src": "753:190:10", "text": " @dev Delegates the current call to `implementation`.\n This function does not return to its internal call site, it will return directly to the external caller." }, "id": 18041, "implemented": true, "kind": "function", "modifiers": [], "name": "_delegate", "nameLocation": "957:9:10", "nodeType": "FunctionDefinition", "parameters": { "id": 18037, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 18036, "mutability": "mutable", "name": "implementation", "nameLocation": "975:14:10", "nodeType": "VariableDeclaration", "scope": 18041, "src": "967:22:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 18035, "name": "address", "nodeType": "ElementaryTypeName", "src": "967:7:10", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "966:24:10" }, "returnParameters": { "id": 18038, "nodeType": "ParameterList", "parameters": [], "src": "1008:0:10" }, "scope": 18082, "src": "948:895:10", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" }, { "documentation": { "id": 18042, "nodeType": "StructuredDocumentation", "src": "1849:173:10", "text": " @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n and {_fallback} should delegate." }, "id": 18047, "implemented": false, "kind": "function", "modifiers": [], "name": "_implementation", "nameLocation": "2036:15:10", "nodeType": "FunctionDefinition", "parameters": { "id": 18043, "nodeType": "ParameterList", "parameters": [], "src": "2051:2:10" }, "returnParameters": { "id": 18046, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 18045, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 18047, "src": "2085:7:10", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 18044, "name": "address", "nodeType": "ElementaryTypeName", "src": "2085:7:10", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "2084:9:10" }, "scope": 18082, "src": "2027:67:10", "stateMutability": "view", "virtual": true, "visibility": "internal" }, { "body": { "id": 18059, "nodeType": "Block", "src": "2360:72:10", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 18051, "name": "_beforeFallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18081, "src": "2370:15:10", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 18052, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2370:17:10", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 18053, "nodeType": "ExpressionStatement", "src": "2370:17:10" }, { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 18055, "name": "_implementation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18047, "src": "2407:15:10", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 18056, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2407:17:10", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 18054, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18041, "src": "2397:9:10", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 18057, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2397:28:10", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 18058, "nodeType": "ExpressionStatement", "src": "2397:28:10" } ] }, "documentation": { "id": 18048, "nodeType": "StructuredDocumentation", "src": "2100:217:10", "text": " @dev Delegates the current call to the address returned by `_implementation()`.\n This function does not return to its internal call site, it will return directly to the external caller." }, "id": 18060, "implemented": true, "kind": "function", "modifiers": [], "name": "_fallback", "nameLocation": "2331:9:10", "nodeType": "FunctionDefinition", "parameters": { "id": 18049, "nodeType": "ParameterList", "parameters": [], "src": "2340:2:10" }, "returnParameters": { "id": 18050, "nodeType": "ParameterList", "parameters": [], "src": "2360:0:10" }, "scope": 18082, "src": "2322:110:10", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" }, { "body": { "id": 18067, "nodeType": "Block", "src": "2665:28:10", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 18064, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18060, "src": "2675:9:10", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 18065, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2675:11:10", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 18066, "nodeType": "ExpressionStatement", "src": "2675:11:10" } ] }, "documentation": { "id": 18061, "nodeType": "StructuredDocumentation", "src": "2438:186:10", "text": " @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n function in the contract matches the call data." }, "id": 18068, "implemented": true, "kind": "fallback", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 18062, "nodeType": "ParameterList", "parameters": [], "src": "2637:2:10" }, "returnParameters": { "id": 18063, "nodeType": "ParameterList", "parameters": [], "src": "2665:0:10" }, "scope": 18082, "src": "2629:64:10", "stateMutability": "payable", "virtual": true, "visibility": "external" }, { "body": { "id": 18075, "nodeType": "Block", "src": "2888:28:10", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 18072, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18060, "src": "2898:9:10", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 18073, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "2898:11:10", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 18074, "nodeType": "ExpressionStatement", "src": "2898:11:10" } ] }, "documentation": { "id": 18069, "nodeType": "StructuredDocumentation", "src": "2699:149:10", "text": " @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n is empty." }, "id": 18076, "implemented": true, "kind": "receive", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 18070, "nodeType": "ParameterList", "parameters": [], "src": "2860:2:10" }, "returnParameters": { "id": 18071, "nodeType": "ParameterList", "parameters": [], "src": "2888:0:10" }, "scope": 18082, "src": "2853:63:10", "stateMutability": "payable", "virtual": true, "visibility": "external" }, { "body": { "id": 18080, "nodeType": "Block", "src": "3242:2:10", "statements": [] }, "documentation": { "id": 18077, "nodeType": "StructuredDocumentation", "src": "2922:271:10", "text": " @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n call, or as part of the Solidity `fallback` or `receive` functions.\n If overridden should call `super._beforeFallback()`." }, "id": 18081, "implemented": true, "kind": "function", "modifiers": [], "name": "_beforeFallback", "nameLocation": "3207:15:10", "nodeType": "FunctionDefinition", "parameters": { "id": 18078, "nodeType": "ParameterList", "parameters": [], "src": "3222:2:10" }, "returnParameters": { "id": 18079, "nodeType": "ParameterList", "parameters": [], "src": "3242:0:10" }, "scope": 18082, "src": "3198:46:10", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" } ], "scope": 18083, "src": "723:2523:10", "usedErrors": [] } ], "src": "99:3148:10" }, "bytecode": "", "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "compiler": { "evm_version": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "version": "0.8.19+commit.7dd6d404" }, "contractName": "Proxy", "coverageMap": { "branches": {}, "statements": {} }, "dependencies": [], "deployedBytecode": "", "deployedSourceMap": "", "language": "Solidity", "natspec": { "details": "This abstract contract provides a fallback function that delegates all calls to another contract using the EVM instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to be specified by overriding the virtual {_implementation} function. Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a different contract through the {_delegate} function. The success and return data of the delegated call will be returned back to the caller of the proxy.", "kind": "dev", "methods": {}, "version": 1 }, "offset": [ 723, 3246 ], "opcodes": "", "pcMap": {}, "sha1": "dfd76ede2d2027ab1645b30f2f29052939505195", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n", "sourceMap": "", "sourcePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.8.2/contracts/proxy/Proxy.sol", "type": "contract" }