UNPKG

@etherisc/gif-contracts

Version:

This repository holds the GIF core contracts and tools to develop, test and deploy GIF instances.

831 lines 35.9 kB
{ "abi": [ { "stateMutability": "payable", "type": "fallback" }, { "stateMutability": "payable", "type": "receive" } ], "allSourcePaths": { "8": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/proxy/Proxy.sol" }, "ast": { "absolutePath": "/home/vscode/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.7.3/contracts/proxy/Proxy.sol", "exportedSymbols": { "Proxy": [ 27573 ] }, "id": 27574, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 27523, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "99:23:8" }, { "abstract": true, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 27524, "nodeType": "StructuredDocumentation", "src": "124:598:8", "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": 27573, "linearizedBaseContracts": [ 27573 ], "name": "Proxy", "nameLocation": "741:5:8", "nodeType": "ContractDefinition", "nodes": [ { "body": { "id": 27531, "nodeType": "Block", "src": "1008:835:8", "statements": [ { "AST": { "nodeType": "YulBlock", "src": "1027:810:8", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1280:1:8", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1283:1:8", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "calldatasize", "nodeType": "YulIdentifier", "src": "1286:12:8" }, "nodeType": "YulFunctionCall", "src": "1286:14:8" } ], "functionName": { "name": "calldatacopy", "nodeType": "YulIdentifier", "src": "1267:12:8" }, "nodeType": "YulFunctionCall", "src": "1267:34:8" }, "nodeType": "YulExpressionStatement", "src": "1267:34:8" }, { "nodeType": "YulVariableDeclaration", "src": "1428:74:8", "value": { "arguments": [ { "arguments": [], "functionName": { "name": "gas", "nodeType": "YulIdentifier", "src": "1455:3:8" }, "nodeType": "YulFunctionCall", "src": "1455:5:8" }, { "name": "implementation", "nodeType": "YulIdentifier", "src": "1462:14:8" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1478:1:8", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "calldatasize", "nodeType": "YulIdentifier", "src": "1481:12:8" }, "nodeType": "YulFunctionCall", "src": "1481:14:8" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1497:1:8", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1500:1:8", "type": "", "value": "0" } ], "functionName": { "name": "delegatecall", "nodeType": "YulIdentifier", "src": "1442:12:8" }, "nodeType": "YulFunctionCall", "src": "1442:60:8" }, "variables": [ { "name": "result", "nodeType": "YulTypedName", "src": "1432:6:8", "type": "" } ] }, { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1570:1:8", "type": "", "value": "0" }, { "kind": "number", "nodeType": "YulLiteral", "src": "1573:1:8", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1576:14:8" }, "nodeType": "YulFunctionCall", "src": "1576:16:8" } ], "functionName": { "name": "returndatacopy", "nodeType": "YulIdentifier", "src": "1555:14:8" }, "nodeType": "YulFunctionCall", "src": "1555:38:8" }, "nodeType": "YulExpressionStatement", "src": "1555:38:8" }, { "cases": [ { "body": { "nodeType": "YulBlock", "src": "1688:59:8", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1713:1:8", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1716:14:8" }, "nodeType": "YulFunctionCall", "src": "1716:16:8" } ], "functionName": { "name": "revert", "nodeType": "YulIdentifier", "src": "1706:6:8" }, "nodeType": "YulFunctionCall", "src": "1706:27:8" }, "nodeType": "YulExpressionStatement", "src": "1706:27:8" } ] }, "nodeType": "YulCase", "src": "1681:66:8", "value": { "kind": "number", "nodeType": "YulLiteral", "src": "1686:1:8", "type": "", "value": "0" } }, { "body": { "nodeType": "YulBlock", "src": "1768:59:8", "statements": [ { "expression": { "arguments": [ { "kind": "number", "nodeType": "YulLiteral", "src": "1793:1:8", "type": "", "value": "0" }, { "arguments": [], "functionName": { "name": "returndatasize", "nodeType": "YulIdentifier", "src": "1796:14:8" }, "nodeType": "YulFunctionCall", "src": "1796:16:8" } ], "functionName": { "name": "return", "nodeType": "YulIdentifier", "src": "1786:6:8" }, "nodeType": "YulFunctionCall", "src": "1786:27:8" }, "nodeType": "YulExpressionStatement", "src": "1786:27:8" } ] }, "nodeType": "YulCase", "src": "1760:67:8", "value": "default" } ], "expression": { "name": "result", "nodeType": "YulIdentifier", "src": "1614:6:8" }, "nodeType": "YulSwitch", "src": "1607:220:8" } ] }, "evmVersion": "istanbul", "externalReferences": [ { "declaration": 27527, "isOffset": false, "isSlot": false, "src": "1462:14:8", "valueSize": 1 } ], "id": 27530, "nodeType": "InlineAssembly", "src": "1018:819:8" } ] }, "documentation": { "id": 27525, "nodeType": "StructuredDocumentation", "src": "753:190:8", "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": 27532, "implemented": true, "kind": "function", "modifiers": [], "name": "_delegate", "nameLocation": "957:9:8", "nodeType": "FunctionDefinition", "parameters": { "id": 27528, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27527, "mutability": "mutable", "name": "implementation", "nameLocation": "975:14:8", "nodeType": "VariableDeclaration", "scope": 27532, "src": "967:22:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 27526, "name": "address", "nodeType": "ElementaryTypeName", "src": "967:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "966:24:8" }, "returnParameters": { "id": 27529, "nodeType": "ParameterList", "parameters": [], "src": "1008:0:8" }, "scope": 27573, "src": "948:895:8", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" }, { "documentation": { "id": 27533, "nodeType": "StructuredDocumentation", "src": "1849:173:8", "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": 27538, "implemented": false, "kind": "function", "modifiers": [], "name": "_implementation", "nameLocation": "2036:15:8", "nodeType": "FunctionDefinition", "parameters": { "id": 27534, "nodeType": "ParameterList", "parameters": [], "src": "2051:2:8" }, "returnParameters": { "id": 27537, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 27536, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 27538, "src": "2085:7:8", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 27535, "name": "address", "nodeType": "ElementaryTypeName", "src": "2085:7:8", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "2084:9:8" }, "scope": 27573, "src": "2027:67:8", "stateMutability": "view", "virtual": true, "visibility": "internal" }, { "body": { "id": 27550, "nodeType": "Block", "src": "2360:72:8", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 27542, "name": "_beforeFallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27572, "src": "2370:15:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 27543, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2370:17:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 27544, "nodeType": "ExpressionStatement", "src": "2370:17:8" }, { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 27546, "name": "_implementation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27538, "src": "2407:15:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 27547, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2407:17:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 27545, "name": "_delegate", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27532, "src": "2397:9:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 27548, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2397:28:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 27549, "nodeType": "ExpressionStatement", "src": "2397:28:8" } ] }, "documentation": { "id": 27539, "nodeType": "StructuredDocumentation", "src": "2100:217:8", "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": 27551, "implemented": true, "kind": "function", "modifiers": [], "name": "_fallback", "nameLocation": "2331:9:8", "nodeType": "FunctionDefinition", "parameters": { "id": 27540, "nodeType": "ParameterList", "parameters": [], "src": "2340:2:8" }, "returnParameters": { "id": 27541, "nodeType": "ParameterList", "parameters": [], "src": "2360:0:8" }, "scope": 27573, "src": "2322:110:8", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" }, { "body": { "id": 27558, "nodeType": "Block", "src": "2665:28:8", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 27555, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27551, "src": "2675:9:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 27556, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2675:11:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 27557, "nodeType": "ExpressionStatement", "src": "2675:11:8" } ] }, "documentation": { "id": 27552, "nodeType": "StructuredDocumentation", "src": "2438:186:8", "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": 27559, "implemented": true, "kind": "fallback", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 27553, "nodeType": "ParameterList", "parameters": [], "src": "2637:2:8" }, "returnParameters": { "id": 27554, "nodeType": "ParameterList", "parameters": [], "src": "2665:0:8" }, "scope": 27573, "src": "2629:64:8", "stateMutability": "payable", "virtual": true, "visibility": "external" }, { "body": { "id": 27566, "nodeType": "Block", "src": "2888:28:8", "statements": [ { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 27563, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 27551, "src": "2898:9:8", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 27564, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2898:11:8", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 27565, "nodeType": "ExpressionStatement", "src": "2898:11:8" } ] }, "documentation": { "id": 27560, "nodeType": "StructuredDocumentation", "src": "2699:149:8", "text": " @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n is empty." }, "id": 27567, "implemented": true, "kind": "receive", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 27561, "nodeType": "ParameterList", "parameters": [], "src": "2860:2:8" }, "returnParameters": { "id": 27562, "nodeType": "ParameterList", "parameters": [], "src": "2888:0:8" }, "scope": 27573, "src": "2853:63:8", "stateMutability": "payable", "virtual": true, "visibility": "external" }, { "body": { "id": 27571, "nodeType": "Block", "src": "3242:2:8", "statements": [] }, "documentation": { "id": 27568, "nodeType": "StructuredDocumentation", "src": "2922:271:8", "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": 27572, "implemented": true, "kind": "function", "modifiers": [], "name": "_beforeFallback", "nameLocation": "3207:15:8", "nodeType": "FunctionDefinition", "parameters": { "id": 27569, "nodeType": "ParameterList", "parameters": [], "src": "3222:2:8" }, "returnParameters": { "id": 27570, "nodeType": "ParameterList", "parameters": [], "src": "3242:0:8" }, "scope": 27573, "src": "3198:46:8", "stateMutability": "nonpayable", "virtual": true, "visibility": "internal" } ], "scope": 27574, "src": "723:2523:8" } ], "src": "99:3148:8" }, "bytecode": "", "bytecodeSha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709", "compiler": { "evm_version": "istanbul", "optimizer": { "enabled": true, "runs": 200 }, "version": "0.8.2+commit.661d1103" }, "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.7.3/contracts/proxy/Proxy.sol", "type": "contract" }