UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,181 lines (1,180 loc) 63.6 kB
{ "contractName": "Upgradeable", "abi": [ { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" } ], "name": "Initialized", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "from", "type": "address" }, { "indexed": true, "internalType": "address", "name": "baseAddr", "type": "address" }, { "indexed": true, "internalType": "bytes32", "name": "baseCodehash", "type": "bytes32" }, { "indexed": false, "internalType": "string", "name": "versionTag", "type": "string" } ], "name": "Upgraded", "type": "event" }, { "inputs": [], "name": "proxiableUUID", "outputs": [ { "internalType": "bytes32", "name": "", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "base", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "codehash", "outputs": [ { "internalType": "bytes32", "name": "_codehash", "type": "bytes32" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "isUpgradable", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "from", "type": "address" } ], "name": "isUpgradableFrom", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes", "name": "", "type": "bytes" } ], "name": "initialize", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "version", "outputs": [ { "internalType": "string", "name": "", "type": "string" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.25+commit.b61c2a91\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"baseAddr\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"baseCodehash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"string\",\"name\":\"versionTag\",\"type\":\"string\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"base\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"codehash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"_codehash\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isUpgradable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"}],\"name\":\"isUpgradableFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"proxiableUUID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"errors\":{\"InvalidInitialization()\":[{\"details\":\"The contract is already initialized.\"}],\"NotInitializing()\":[{\"details\":\"The contract is not initializing.\"}]},\"events\":{\"Initialized(uint64)\":{\"details\":\"Triggered when the contract has been initialized or reinitialized.\"},\"Upgraded(address,address,bytes32,string)\":{\"params\":{\"baseAddr\":\"The address of the new implementation contract.\",\"baseCodehash\":\"The EVM-codehash of the new implementation contract.\",\"from\":\"The address who ordered the upgrading. Namely, the WRB operator in \\\"trustable\\\" implementations.\",\"versionTag\":\"Ascii-encoded version literal with which the implementation deployer decided to tag it.\"}}},\"kind\":\"dev\",\"methods\":{\"base()\":{\"details\":\"Retrieves base contract. Differs from address(this) when called via delegate-proxy pattern.\"},\"codehash()\":{\"details\":\"Retrieves the immutable codehash of this contract, even if invoked as delegatecall.\"},\"initialize(bytes)\":{\"details\":\"Must fail when trying to upgrade to same logic contract more than once.\"},\"isUpgradable()\":{\"details\":\"Determines whether the logic of this contract is potentially upgradable.\"},\"isUpgradableFrom(address)\":{\"details\":\"Tells whether provided address could eventually upgrade the contract.\"},\"proxiableUUID()\":{\"details\":\"Complying with EIP-1822: Universal Upgradeable Proxy Standard (UUPS)See https://eips.ethereum.org/EIPS/eip-1822.\"},\"version()\":{\"details\":\"Retrieves human-redable named version of current implementation.\"}},\"version\":1},\"userdoc\":{\"events\":{\"Upgraded(address,address,bytes32,string)\":{\"notice\":\"Emitted every time the contract gets upgraded.\"}},\"kind\":\"user\",\"methods\":{\"initialize(bytes)\":{\"notice\":\"Re-initialize contract's storage context upon a new upgrade from a proxy. \"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/patterns/Upgradeable.sol\":\"Upgradeable\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x631188737069917d2f909d29ce62c4d48611d326686ba6683e26b72a23bfac0b\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://7a61054ae84cd6c4d04c0c4450ba1d6de41e27e0a2c4f1bcdf58f796b401c609\",\"dweb:/ipfs/QmUvtdp7X1mRVyC3CsHrtPbgoqWaXHp3S1ZR24tpAQYJWM\"]},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"keccak256\":\"0xddce8e17e3d3f9ed818b4f4c4478a8262aab8b11ed322f1bf5ed705bb4bd97fa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://8084aa71a4cc7d2980972412a88fe4f114869faea3fefa5436431644eb5c0287\",\"dweb:/ipfs/Qmbqfs5dRdPvHVKY8kTaeyc65NdqXRQwRK7h9s5UJEhD1p\"]},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"keccak256\":\"0x79796192ec90263f21b464d5bc90b777a525971d3de8232be80d9c4f9fb353b8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f6fda447a62815e8064f47eff0dd1cf58d9207ad69b5d32280f8d7ed1d1e4621\",\"dweb:/ipfs/QmfDRc7pxfaXB2Dh9np5Uf29Na3pQ7tafRS684wd3GLjVL\"]},\"project:/contracts/patterns/Initializable.sol\":{\"keccak256\":\"0xaac470e87f361cf15d68d1618d6eb7d4913885d33ccc39c797841a9591d44296\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef3760b2039feda8715d4bd9f8de8e3885f25573d12ba92f52d626ba880a08bf\",\"dweb:/ipfs/QmP2mfHPBKkjTAKft95sPDb4PBsjfmAwc47Kdcv3xYSf3g\"]},\"project:/contracts/patterns/Proxiable.sol\":{\"keccak256\":\"0x86032205378fed9ed2bf155eed8ce4bdbb13b7f5960850c6d50954a38b61a3d8\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://f89978eda4244a13f42a6092a94ac829bb3e38c92d77d4978b9f32894b187a63\",\"dweb:/ipfs/Qmbc1XaFCvLm3Sxvh7tP29Ug32jBGy3avsCqBGAptxs765\"]},\"project:/contracts/patterns/Upgradeable.sol\":{\"keccak256\":\"0xbeb025c71f037acb1a668174eb6930631bf397129beb825f2660e5d8cf19614f\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://fe6ce4dcd500093ae069d35b91829ccb471e1ca33ed0851fb053fbfe76c78aba\",\"dweb:/ipfs/QmT7huvCFS6bHDxt7HhEogJmyvYNbeb6dFTJudsVSX6nEs\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", "source": "// SPDX-License-Identifier: MIT\r\n\r\n/* solhint-disable var-name-mixedcase */\r\n\r\npragma solidity >=0.6.0 <0.9.0;\r\n\r\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\r\n\r\nimport \"./Initializable.sol\";\r\nimport \"./Proxiable.sol\";\r\n\r\nabstract contract Upgradeable is Initializable, Proxiable {\r\n\r\n address internal immutable _BASE;\r\n bytes32 internal immutable _CODEHASH;\r\n bool internal immutable _UPGRADABLE;\r\n\r\n modifier onlyDelegateCalls virtual {\r\n require(\r\n address(this) != _BASE,\r\n \"Upgradeable: not a delegate call\"\r\n );\r\n _;\r\n }\r\n\r\n /// Emitted every time the contract gets upgraded.\r\n /// @param from The address who ordered the upgrading. Namely, the WRB operator in \"trustable\" implementations.\r\n /// @param baseAddr The address of the new implementation contract.\r\n /// @param baseCodehash The EVM-codehash of the new implementation contract.\r\n /// @param versionTag Ascii-encoded version literal with which the implementation deployer decided to tag it.\r\n event Upgraded(\r\n address indexed from,\r\n address indexed baseAddr,\r\n bytes32 indexed baseCodehash,\r\n string versionTag\r\n );\r\n\r\n constructor (bool _isUpgradable) {\r\n address _base = address(this);\r\n _BASE = _base;\r\n _UPGRADABLE = _isUpgradable;\r\n }\r\n\r\n /// @dev Retrieves base contract. Differs from address(this) when called via delegate-proxy pattern.\r\n function base() public view returns (address) {\r\n return _BASE;\r\n }\r\n\r\n /// @dev Retrieves the immutable codehash of this contract, even if invoked as delegatecall.\r\n function codehash() public view returns (bytes32 _codehash) {\r\n address _base = _BASE;\r\n assembly {\r\n _codehash := extcodehash(_base)\r\n }\r\n }\r\n\r\n /// @dev Determines whether the logic of this contract is potentially upgradable.\r\n function isUpgradable() public view returns (bool) {\r\n return _UPGRADABLE;\r\n }\r\n\r\n /// @dev Tells whether provided address could eventually upgrade the contract.\r\n function isUpgradableFrom(address from) virtual external view returns (bool);\r\n\r\n /// @notice Re-initialize contract's storage context upon a new upgrade from a proxy. \r\n /// @dev Must fail when trying to upgrade to same logic contract more than once.\r\n function initialize(bytes memory) virtual external;\r\n\r\n /// @dev Retrieves human-redable named version of current implementation.\r\n function version() virtual public view returns (string memory); \r\n}", "sourcePath": "C:\\Users\\guill\\github\\witnet\\witnet-solidity-bridge\\contracts\\patterns\\Upgradeable.sol", "ast": { "absolutePath": "project:/contracts/patterns/Upgradeable.sol", "exportedSymbols": { "ERC165": [ 602 ], "IERC165": [ 614 ], "Initializable": [ 253 ], "Proxiable": [ 24189 ], "Upgradeable": [ 24304 ] }, "id": 24305, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 24194, "literals": [ "solidity", ">=", "0.6", ".0", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "79:31:83" }, { "absolutePath": "@openzeppelin/contracts/utils/introspection/ERC165.sol", "file": "@openzeppelin/contracts/utils/introspection/ERC165.sol", "id": 24195, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 24305, "sourceUnit": 603, "src": "114:64:83", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/patterns/Initializable.sol", "file": "./Initializable.sol", "id": 24196, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 24305, "sourceUnit": 24007, "src": "182:29:83", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "project:/contracts/patterns/Proxiable.sol", "file": "./Proxiable.sol", "id": 24197, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 24305, "sourceUnit": 24190, "src": "213:25:83", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [ { "baseName": { "id": 24198, "name": "Initializable", "nameLocations": [ "275:13:83" ], "nodeType": "IdentifierPath", "referencedDeclaration": 253, "src": "275:13:83" }, "id": 24199, "nodeType": "InheritanceSpecifier", "src": "275:13:83" }, { "baseName": { "id": 24200, "name": "Proxiable", "nameLocations": [ "290:9:83" ], "nodeType": "IdentifierPath", "referencedDeclaration": 24189, "src": "290:9:83" }, "id": 24201, "nodeType": "InheritanceSpecifier", "src": "290:9:83" } ], "canonicalName": "Upgradeable", "contractDependencies": [], "contractKind": "contract", "fullyImplemented": false, "id": 24304, "linearizedBaseContracts": [ 24304, 24189, 253 ], "name": "Upgradeable", "nameLocation": "260:11:83", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 24203, "mutability": "immutable", "name": "_BASE", "nameLocation": "336:5:83", "nodeType": "VariableDeclaration", "scope": 24304, "src": "309:32:83", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24202, "name": "address", "nodeType": "ElementaryTypeName", "src": "309:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 24205, "mutability": "immutable", "name": "_CODEHASH", "nameLocation": "375:9:83", "nodeType": "VariableDeclaration", "scope": 24304, "src": "348:36:83", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 24204, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "348:7:83", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 24207, "mutability": "immutable", "name": "_UPGRADABLE", "nameLocation": "415:11:83", "nodeType": "VariableDeclaration", "scope": 24304, "src": "391:35:83", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 24206, "name": "bool", "nodeType": "ElementaryTypeName", "src": "391:4:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" }, { "body": { "id": 24220, "nodeType": "Block", "src": "470:135:83", "statements": [ { "expression": { "arguments": [ { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 24215, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 24212, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "511:4:83", "typeDescriptions": { "typeIdentifier": "t_contract$_Upgradeable_$24304", "typeString": "contract Upgradeable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Upgradeable_$24304", "typeString": "contract Upgradeable" } ], "id": 24211, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "503:7:83", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 24210, "name": "address", "nodeType": "ElementaryTypeName", "src": "503:7:83", "typeDescriptions": {} } }, "id": 24213, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "503:13:83", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "id": 24214, "name": "_BASE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24203, "src": "520:5:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "503:22:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "5570677261646561626c653a206e6f7420612064656c65676174652063616c6c", "id": 24216, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "540:34:83", "typeDescriptions": { "typeIdentifier": "t_stringliteral_90e095d6d6ca6b07be08fb15eec2b1209d1399dee84122827df7649f8a4c27cb", "typeString": "literal_string \"Upgradeable: not a delegate call\"" }, "value": "Upgradeable: not a delegate call" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_90e095d6d6ca6b07be08fb15eec2b1209d1399dee84122827df7649f8a4c27cb", "typeString": "literal_string \"Upgradeable: not a delegate call\"" } ], "id": 24209, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "481:7:83", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 24217, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "481:104:83", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 24218, "nodeType": "ExpressionStatement", "src": "481:104:83" }, { "id": 24219, "nodeType": "PlaceholderStatement", "src": "596:1:83" } ] }, "id": 24221, "name": "onlyDelegateCalls", "nameLocation": "444:17:83", "nodeType": "ModifierDefinition", "parameters": { "id": 24208, "nodeType": "ParameterList", "parameters": [], "src": "462:0:83" }, "src": "435:170:83", "virtual": true, "visibility": "internal" }, { "anonymous": false, "documentation": { "id": 24222, "nodeType": "StructuredDocumentation", "src": "613:437:83", "text": "Emitted every time the contract gets upgraded.\n @param from The address who ordered the upgrading. Namely, the WRB operator in \"trustable\" implementations.\n @param baseAddr The address of the new implementation contract.\n @param baseCodehash The EVM-codehash of the new implementation contract.\n @param versionTag Ascii-encoded version literal with which the implementation deployer decided to tag it." }, "eventSelector": "e73e754121f0bad1327816970101955bfffdf53d270ac509d777c25be070d7f6", "id": 24232, "name": "Upgraded", "nameLocation": "1062:8:83", "nodeType": "EventDefinition", "parameters": { "id": 24231, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24224, "indexed": true, "mutability": "mutable", "name": "from", "nameLocation": "1097:4:83", "nodeType": "VariableDeclaration", "scope": 24232, "src": "1081:20:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24223, "name": "address", "nodeType": "ElementaryTypeName", "src": "1081:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 24226, "indexed": true, "mutability": "mutable", "name": "baseAddr", "nameLocation": "1128:8:83", "nodeType": "VariableDeclaration", "scope": 24232, "src": "1112:24:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24225, "name": "address", "nodeType": "ElementaryTypeName", "src": "1112:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 24228, "indexed": true, "mutability": "mutable", "name": "baseCodehash", "nameLocation": "1163:12:83", "nodeType": "VariableDeclaration", "scope": 24232, "src": "1147:28:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 24227, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1147:7:83", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "visibility": "internal" }, { "constant": false, "id": 24230, "indexed": false, "mutability": "mutable", "name": "versionTag", "nameLocation": "1194:10:83", "nodeType": "VariableDeclaration", "scope": 24232, "src": "1186:18:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 24229, "name": "string", "nodeType": "ElementaryTypeName", "src": "1186:6:83", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "visibility": "internal" } ], "src": "1070:141:83" }, "src": "1056:156:83" }, { "body": { "id": 24252, "nodeType": "Block", "src": "1253:110:83", "statements": [ { "assignments": [ 24238 ], "declarations": [ { "constant": false, "id": 24238, "mutability": "mutable", "name": "_base", "nameLocation": "1272:5:83", "nodeType": "VariableDeclaration", "scope": 24252, "src": "1264:13:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24237, "name": "address", "nodeType": "ElementaryTypeName", "src": "1264:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "id": 24243, "initialValue": { "arguments": [ { "id": 24241, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "1288:4:83", "typeDescriptions": { "typeIdentifier": "t_contract$_Upgradeable_$24304", "typeString": "contract Upgradeable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Upgradeable_$24304", "typeString": "contract Upgradeable" } ], "id": 24240, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1280:7:83", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 24239, "name": "address", "nodeType": "ElementaryTypeName", "src": "1280:7:83", "typeDescriptions": {} } }, "id": 24242, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1280:13:83", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "VariableDeclarationStatement", "src": "1264:29:83" }, { "expression": { "id": 24246, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 24244, "name": "_BASE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24203, "src": "1304:5:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "id": 24245, "name": "_base", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24238, "src": "1312:5:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1304:13:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 24247, "nodeType": "ExpressionStatement", "src": "1304:13:83" }, { "expression": { "id": 24250, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 24248, "name": "_UPGRADABLE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24207, "src": "1328:11:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "id": 24249, "name": "_isUpgradable", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24234, "src": "1342:13:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "1328:27:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 24251, "nodeType": "ExpressionStatement", "src": "1328:27:83" } ] }, "id": 24253, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nameLocation": "-1:-1:-1", "nodeType": "FunctionDefinition", "parameters": { "id": 24235, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24234, "mutability": "mutable", "name": "_isUpgradable", "nameLocation": "1238:13:83", "nodeType": "VariableDeclaration", "scope": 24253, "src": "1233:18:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 24233, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1233:4:83", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "1232:20:83" }, "returnParameters": { "id": 24236, "nodeType": "ParameterList", "parameters": [], "src": "1253:0:83" }, "scope": 24304, "src": "1220:143:83", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 24261, "nodeType": "Block", "src": "1523:31:83", "statements": [ { "expression": { "id": 24259, "name": "_BASE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24203, "src": "1541:5:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 24258, "id": 24260, "nodeType": "Return", "src": "1534:12:83" } ] }, "documentation": { "id": 24254, "nodeType": "StructuredDocumentation", "src": "1371:100:83", "text": "@dev Retrieves base contract. Differs from address(this) when called via delegate-proxy pattern." }, "functionSelector": "5001f3b5", "id": 24262, "implemented": true, "kind": "function", "modifiers": [], "name": "base", "nameLocation": "1486:4:83", "nodeType": "FunctionDefinition", "parameters": { "id": 24255, "nodeType": "ParameterList", "parameters": [], "src": "1490:2:83" }, "returnParameters": { "id": 24258, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24257, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 24262, "src": "1514:7:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24256, "name": "address", "nodeType": "ElementaryTypeName", "src": "1514:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "1513:9:83" }, "scope": 24304, "src": "1477:77:83", "stateMutability": "view", "virtual": false, "visibility": "public" }, { "body": { "id": 24273, "nodeType": "Block", "src": "1720:116:83", "statements": [ { "assignments": [ 24269 ], "declarations": [ { "constant": false, "id": 24269, "mutability": "mutable", "name": "_base", "nameLocation": "1739:5:83", "nodeType": "VariableDeclaration", "scope": 24273, "src": "1731:13:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 24268, "name": "address", "nodeType": "ElementaryTypeName", "src": "1731:7:83", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "id": 24271, "initialValue": { "id": 24270, "name": "_BASE", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 24203, "src": "1747:5:83", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "VariableDeclarationStatement", "src": "1731:21:83" }, { "AST": { "nativeSrc": "1772:57:83", "nodeType": "YulBlock", "src": "1772:57:83", "statements": [ { "nativeSrc": "1787:31:83", "nodeType": "YulAssignment", "src": "1787:31:83", "value": { "arguments": [ { "name": "_base", "nativeSrc": "1812:5:83", "nodeType": "YulIdentifier", "src": "1812:5:83" } ], "functionName": { "name": "extcodehash", "nativeSrc": "1800:11:83", "nodeType": "YulIdentifier", "src": "1800:11:83" }, "nativeSrc": "1800:18:83", "nodeType": "YulFunctionCall", "src": "1800:18:83" }, "variableNames": [ { "name": "_codehash", "nativeSrc": "1787:9:83", "nodeType": "YulIdentifier", "src": "1787:9:83" } ] } ] }, "evmVersion": "paris", "externalReferences": [ { "declaration": 24269, "isOffset": false, "isSlot": false, "src": "1812:5:83", "valueSize": 1 }, { "declaration": 24266, "isOffset": false, "isSlot": false, "src": "1787:9:83", "valueSize": 1 } ], "id": 24272, "nodeType": "InlineAssembly", "src": "1763:66:83" } ] }, "documentation": { "id": 24263, "nodeType": "StructuredDocumentation", "src": "1562:92:83", "text": "@dev Retrieves the immutable codehash of this contract, even if invoked as delegatecall." }, "functionSelector": "a9e954b9", "id": 24274, "implemented": true, "kind": "function", "modifiers": [], "name": "codehash", "nameLocation": "1669:8:83", "nodeType": "FunctionDefinition", "parameters": { "id": 24264, "nodeType": "ParameterList", "parameters": [], "src": "1677:2:83" }, "returnParameters": { "id": 24267, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 24266, "mutability": "mutable", "name": "_codehash", "nameLocation": "1709:9:83", "nodeType": "VariableDeclaration", "scope": 24274, "src": "1701:17:83", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 24265, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "1701:7:83", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } },