UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,151 lines 142 kB
{ "contractName": "Clonable2", "abi": [ { "inputs": [], "name": "InvalidInitialization", "type": "error" }, { "inputs": [], "name": "NotInitializing", "type": "error" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "by", "type": "address" }, { "indexed": true, "internalType": "address", "name": "master", "type": "address" }, { "indexed": true, "internalType": "address", "name": "clone", "type": "address" } ], "name": "Cloned", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "internalType": "uint64", "name": "version", "type": "uint64" } ], "name": "Initialized", "type": "event" }, { "inputs": [], "name": "base", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "cloned", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "initialized", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "master", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "target", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.8.30+commit.73712a01\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"InvalidInitialization\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotInitializing\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"by\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"master\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"clone\",\"type\":\"address\"}],\"name\":\"Cloned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"version\",\"type\":\"uint64\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"base\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"cloned\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"initialized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"master\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"target\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"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.\"}},\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"cloned()\":{\"notice\":\"Tells whether this contract is a clone of `self()`\"},\"initialized()\":{\"notice\":\"Tells whether this instance has been initialized.\"},\"master()\":{\"notice\":\"Master address from which this contract was cloned.\"},\"target()\":{\"notice\":\"Contract address to which clones will be re-directed.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/patterns/Clonable2.sol\":\"Clonable2\"},\"evmVersion\":\"prague\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"keccak256\":\"0xdb4d24ee2c087c391d587cd17adfe5b3f9d93b3110b1388c2ab6c7c0ad1dcd05\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ab7b6d5b9e2b88176312967fe0f0e78f3d9a1422fa5e4b64e2440c35869b5d08\",\"dweb:/ipfs/QmXKYWWyzcLg1B2k7Sb1qkEXgLCYfXecR9wYW5obRzWP1Q\"]},\"project:/contracts/patterns/Clonable2.sol\":{\"keccak256\":\"0x0d172b4ef56dd80035ceb74242fa4f6f21c2d5a7246972cc42b9e5cfb5429caa\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://51378ccc024a39b8b802165c65d6539f04534671263d97e61cc28fc1497186c6\",\"dweb:/ipfs/QmXGGY9bbJJ8gARfQkjtcueRNziC8Dop9XjUBnYj4RXLio\"]},\"project:/contracts/patterns/Initializable.sol\":{\"keccak256\":\"0xaac470e87f361cf15d68d1618d6eb7d4913885d33ccc39c797841a9591d44296\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://ef3760b2039feda8715d4bd9f8de8e3885f25573d12ba92f52d626ba880a08bf\",\"dweb:/ipfs/QmP2mfHPBKkjTAKft95sPDb4PBsjfmAwc47Kdcv3xYSf3g\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", "source": "// SPDX-License-Identifier: MIT\r\n\r\npragma solidity >=0.8.20 <0.9.0;\r\n\r\nimport \"./Initializable.sol\";\r\n\r\nabstract contract Clonable2\r\n is\r\n Initializable\r\n{\r\n address immutable internal __SELF = address(this);\r\n\r\n event Cloned(address indexed by, address indexed master, address indexed clone);\r\n\r\n modifier onlyOnClones virtual {\r\n require(cloned(), \"Clonable2: only on clones\");\r\n _;\r\n }\r\n\r\n modifier notOnClones virtual {\r\n require(!cloned(), \"Clonable2: not on clones\"); \r\n _;\r\n }\r\n\r\n modifier wasInitialized {\r\n require(initialized(), \"Clonable2: not initialized\");\r\n _;\r\n }\r\n\r\n function base() virtual public view returns (address) {\r\n return __SELF;\r\n }\r\n\r\n /// @notice Tells whether this contract is a clone of `self()`\r\n function cloned()\r\n virtual public view\r\n returns (bool)\r\n {\r\n return address(this) != __SELF;\r\n }\r\n\r\n /// @notice Tells whether this instance has been initialized.\r\n function initialized() virtual public view returns (bool);\r\n\r\n /// @notice Master address from which this contract was cloned.\r\n function master() virtual public view returns (address) {\r\n return __clonable2().master;\r\n }\r\n\r\n /// @notice Contract address to which clones will be re-directed.\r\n function target() virtual public view returns (address) {\r\n return cloned() ? address(0) : __SELF;\r\n }\r\n\r\n /// Virtual method to be called upon new cloned instances.\r\n function __initializeClone(address _master) virtual internal {\r\n __clonable2().master = _master; \r\n }\r\n\r\n /// Deploys and returns the address of a minimal proxy clone that replicates contract\r\n /// behaviour while using its own EVM storage.\r\n /// @dev This function should always provide a new address, no matter how many times \r\n /// @dev is actually called from the same `msg.sender`.\r\n /// @dev See https://eips.ethereum.org/EIPS/eip-1167.\r\n /// @dev See https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/.\r\n function __clone()\r\n internal\r\n returns (address _instance)\r\n {\r\n bytes memory ptr = _cloneBytecodePtr();\r\n assembly {\r\n // CREATE new instance:\r\n _instance := create(0, ptr, 0x37)\r\n } \r\n require(_instance != address(0), \"Clonable2: CREATE failed\");\r\n emit Cloned(msg.sender, target(), _instance);\r\n }\r\n\r\n /// Deploys and returns the address of a minimal proxy clone that replicates contract \r\n /// behaviour while using its own EVM storage.\r\n /// @dev This function uses the CREATE2 opcode and a `_salt` to deterministically deploy\r\n /// @dev the clone. Using the same `_salt` multiple times will revert, since\r\n /// @dev no contract can be deployed more than once at the same address.\r\n /// @dev See https://eips.ethereum.org/EIPS/eip-1167.\r\n /// @dev See https://blog.openzeppelin.com/deep-dive-into-the-minimal-proxy-contract/.\r\n function __cloneDeterministic(bytes32 _salt)\r\n internal\r\n notOnClones\r\n returns (address _instance)\r\n {\r\n bytes memory ptr = _cloneBytecodePtr();\r\n assembly {\r\n // CREATE2 new instance:\r\n _instance := create2(0, ptr, 0x37, _salt)\r\n }\r\n require(_instance != address(0), \"Clonable2: CREATE2 failed\");\r\n emit Cloned(msg.sender, target(), _instance);\r\n }\r\n\r\n /// @notice Returns minimal proxy's deploy bytecode.\r\n function _cloneBytecode()\r\n private view\r\n returns (bytes memory)\r\n {\r\n return abi.encodePacked(\r\n hex\"3d602d80600a3d3981f3363d3d373d3d3d363d73\",\r\n bytes20(target()),\r\n hex\"5af43d82803e903d91602b57fd5bf3\"\r\n );\r\n }\r\n\r\n /// @notice Returns mem pointer to minimal proxy's deploy bytecode.\r\n function _cloneBytecodePtr()\r\n private view\r\n returns (bytes memory ptr)\r\n {\r\n address _target = target();\r\n assembly {\r\n // ptr to free mem:\r\n ptr := mload(0x40)\r\n // begin minimal proxy construction bytecode:\r\n mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\r\n // make minimal proxy delegate all calls to `target()`:\r\n mstore(add(ptr, 0x14), shl(0x60, _target))\r\n // end minimal proxy construction bytecode:\r\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\r\n }\r\n }\r\n\r\n struct Storage {\r\n address master;\r\n }\r\n\r\n function __clonable2() internal pure returns (Storage storage clonable) {\r\n assembly {\r\n // bytes32(uint256(keccak256('eip1967.clonable.master')) & ~bytes32(uint256(0xff)\r\n clonable.slot := 0x033dcaf396f361642869bf1bdf9c3454888f3e9bbf7939acdd2e40c3833fef00\r\n }\r\n }\r\n}", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\patterns\\Clonable2.sol", "ast": { "absolutePath": "project:/contracts/patterns/Clonable2.sol", "exportedSymbols": { "Clonable2": [ 45417 ], "Initializable": [ 267 ] }, "id": 45418, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 45192, "literals": [ "solidity", ">=", "0.8", ".20", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:32:124" }, { "absolutePath": "project:/contracts/patterns/Initializable.sol", "file": "./Initializable.sol", "id": 45193, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 45418, "sourceUnit": 45521, "src": "71:29:124", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [ { "baseName": { "id": 45194, "name": "Initializable", "nameLocations": [ "149:13:124" ], "nodeType": "IdentifierPath", "referencedDeclaration": 267, "src": "149:13:124" }, "id": 45195, "nodeType": "InheritanceSpecifier", "src": "149:13:124" } ], "canonicalName": "Clonable2", "contractDependencies": [], "contractKind": "contract", "fullyImplemented": false, "id": 45417, "linearizedBaseContracts": [ 45417, 267 ], "name": "Clonable2", "nameLocation": "122:9:124", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 45201, "mutability": "immutable", "name": "__SELF", "nameLocation": "198:6:124", "nodeType": "VariableDeclaration", "scope": 45417, "src": "171:49:124", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45196, "name": "address", "nodeType": "ElementaryTypeName", "src": "171:7:124", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "arguments": [ { "id": 45199, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "215:4:124", "typeDescriptions": { "typeIdentifier": "t_contract$_Clonable2_$45417", "typeString": "contract Clonable2" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Clonable2_$45417", "typeString": "contract Clonable2" } ], "id": 45198, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "207:7:124", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 45197, "name": "address", "nodeType": "ElementaryTypeName", "src": "207:7:124", "typeDescriptions": {} } }, "id": 45200, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "207:13:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "anonymous": false, "eventSelector": "f376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc248", "id": 45209, "name": "Cloned", "nameLocation": "235:6:124", "nodeType": "EventDefinition", "parameters": { "id": 45208, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45203, "indexed": true, "mutability": "mutable", "name": "by", "nameLocation": "258:2:124", "nodeType": "VariableDeclaration", "scope": 45209, "src": "242:18:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45202, "name": "address", "nodeType": "ElementaryTypeName", "src": "242:7:124", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 45205, "indexed": true, "mutability": "mutable", "name": "master", "nameLocation": "278:6:124", "nodeType": "VariableDeclaration", "scope": 45209, "src": "262:22:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45204, "name": "address", "nodeType": "ElementaryTypeName", "src": "262:7:124", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 45207, "indexed": true, "mutability": "mutable", "name": "clone", "nameLocation": "302:5:124", "nodeType": "VariableDeclaration", "scope": 45209, "src": "286:21:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45206, "name": "address", "nodeType": "ElementaryTypeName", "src": "286:7:124", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "241:67:124" }, "src": "229:80:124" }, { "body": { "id": 45218, "nodeType": "Block", "src": "347:77:124", "statements": [ { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 45212, "name": "cloned", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45262, "src": "366:6:124", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45213, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "366:8:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c65323a206f6e6c79206f6e20636c6f6e6573", "id": 45214, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "376:27:124", "typeDescriptions": { "typeIdentifier": "t_stringliteral_cb0f4f0952b6e8163e47c54b60198339d077c9d234e096d830e0e50956f02ac7", "typeString": "literal_string \"Clonable2: only on clones\"" }, "value": "Clonable2: only on clones" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_cb0f4f0952b6e8163e47c54b60198339d077c9d234e096d830e0e50956f02ac7", "typeString": "literal_string \"Clonable2: only on clones\"" } ], "id": 45211, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "358:7:124", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45215, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "358:46:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45216, "nodeType": "ExpressionStatement", "src": "358:46:124" }, { "id": 45217, "nodeType": "PlaceholderStatement", "src": "415:1:124" } ] }, "id": 45219, "name": "onlyOnClones", "nameLocation": "326:12:124", "nodeType": "ModifierDefinition", "parameters": { "id": 45210, "nodeType": "ParameterList", "parameters": [], "src": "339:0:124" }, "src": "317:107:124", "virtual": true, "visibility": "internal" }, { "body": { "id": 45229, "nodeType": "Block", "src": "461:78:124", "statements": [ { "expression": { "arguments": [ { "id": 45224, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "480:9:124", "subExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 45222, "name": "cloned", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45262, "src": "481:6:124", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45223, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "481:8:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c65323a206e6f74206f6e20636c6f6e6573", "id": 45225, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "491:26:124", "typeDescriptions": { "typeIdentifier": "t_stringliteral_ceac1fd756e0c5b73e56786881ceba2dc475723057c1e4b6d95d0789e36b55f9", "typeString": "literal_string \"Clonable2: not on clones\"" }, "value": "Clonable2: not on clones" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_ceac1fd756e0c5b73e56786881ceba2dc475723057c1e4b6d95d0789e36b55f9", "typeString": "literal_string \"Clonable2: not on clones\"" } ], "id": 45221, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "472:7:124", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45226, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "472:46:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45227, "nodeType": "ExpressionStatement", "src": "472:46:124" }, { "id": 45228, "nodeType": "PlaceholderStatement", "src": "530:1:124" } ] }, "id": 45230, "name": "notOnClones", "nameLocation": "441:11:124", "nodeType": "ModifierDefinition", "parameters": { "id": 45220, "nodeType": "ParameterList", "parameters": [], "src": "453:0:124" }, "src": "432:107:124", "virtual": true, "visibility": "internal" }, { "body": { "id": 45239, "nodeType": "Block", "src": "571:83:124", "statements": [ { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 45233, "name": "initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45268, "src": "590:11:124", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45234, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "590:13:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c65323a206e6f7420696e697469616c697a6564", "id": 45235, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "605:28:124", "typeDescriptions": { "typeIdentifier": "t_stringliteral_721311a2f08e60a5da3521f68ccd4d528baf4a2096a7c111b9620b1dfa66df56", "typeString": "literal_string \"Clonable2: not initialized\"" }, "value": "Clonable2: not initialized" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_721311a2f08e60a5da3521f68ccd4d528baf4a2096a7c111b9620b1dfa66df56", "typeString": "literal_string \"Clonable2: not initialized\"" } ], "id": 45232, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "582:7:124", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45236, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "582:52:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45237, "nodeType": "ExpressionStatement", "src": "582:52:124" }, { "id": 45238, "nodeType": "PlaceholderStatement", "src": "645:1:124" } ] }, "id": 45240, "name": "wasInitialized", "nameLocation": "556:14:124", "nodeType": "ModifierDefinition", "parameters": { "id": 45231, "nodeType": "ParameterList", "parameters": [], "src": "571:0:124" }, "src": "547:107:124", "virtual": false, "visibility": "internal" }, { "body": { "id": 45247, "nodeType": "Block", "src": "716:32:124", "statements": [ { "expression": { "id": 45245, "name": "__SELF", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45201, "src": "734:6:124", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 45244, "id": 45246, "nodeType": "Return", "src": "727:13:124" } ] }, "functionSelector": "5001f3b5", "id": 45248, "implemented": true, "kind": "function", "modifiers": [], "name": "base", "nameLocation": "671:4:124", "nodeType": "FunctionDefinition", "parameters": { "id": 45241, "nodeType": "ParameterList", "parameters": [], "src": "675:2:124" }, "returnParameters": { "id": 45244, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45243, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45248, "src": "707:7:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45242, "name": "address", "nodeType": "ElementaryTypeName", "src": "707:7:124", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "706:9:124" }, "scope": 45417, "src": "662:86:124", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "body": { "id": 45261, "nodeType": "Block", "src": "900:49:124", "statements": [ { "expression": { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 45259, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 45256, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "926:4:124", "typeDescriptions": { "typeIdentifier": "t_contract$_Clonable2_$45417", "typeString": "contract Clonable2" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Clonable2_$45417", "typeString": "contract Clonable2" } ], "id": 45255, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "918:7:124", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 45254, "name": "address", "nodeType": "ElementaryTypeName", "src": "918:7:124", "typeDescriptions": {} } }, "id": 45257, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "918:13:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "id": 45258, "name": "__SELF", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45201, "src": "935:6:124", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "918:23:124", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 45253, "id": 45260, "nodeType": "Return", "src": "911:30:124" } ] }, "documentation": { "id": 45249, "nodeType": "StructuredDocumentation", "src": "756:62:124", "text": "@notice Tells whether this contract is a clone of `self()`" }, "functionSelector": "a04daef0", "id": 45262, "implemented": true, "kind": "function", "modifiers": [], "name": "cloned", "nameLocation": "833:6:124", "nodeType": "FunctionDefinition", "parameters": { "id": 45250, "nodeType": "ParameterList", "parameters": [], "src": "839:2:124" }, "returnParameters": { "id": 45253, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45252, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45262, "src": "889:4:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 45251, "name": "bool", "nodeType": "ElementaryTypeName", "src": "889:4:124", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "888:6:124" }, "scope": 45417, "src": "824:125:124", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "documentation": { "id": 45263, "nodeType": "StructuredDocumentation", "src": "957:61:124", "text": "@notice Tells whether this instance has been initialized." }, "functionSelector": "158ef93e", "id": 45268, "implemented": false, "kind": "function", "modifiers": [], "name": "initialized", "nameLocation": "1033:11:124", "nodeType": "FunctionDefinition", "parameters": { "id": 45264, "nodeType": "ParameterList", "parameters": [], "src": "1044:2:124" }, "returnParameters": { "id": 45267, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45266, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45268, "src": "1076:4:124", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 45265, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1076:4:124", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "1075:6:124" }, "scope": 45417, "src": "1024:58:124", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "body": { "id": 45278, "nodeType": "Block", "src": "1215:46:124", "statements": [ { "expression": { "expression": { "arguments": [], "expression": { "argumentTypes": [], "id": 45274, "name": "__clonable2", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45416, "src": "1233:11:124", "typeDescriptions": { "typeIdentifier": "t_function_internal_pure$__$returns$_t_struct$_Storage_$45408_storage_ptr_$", "typeString": "function () pure returns (struct Clonable2.Storage storage pointer)" } }, "id": 45275, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1233:13:124", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_struct$_Storage_$45408_storage_ptr", "typeString": "struct Clonable2.Storage storage pointer" } }, "id": 45276, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberLocation": "1247:6:124", "memberName": "master", "nodeType": "MemberAccess", "referencedDeclaration": 45407, "src": "1233:20:124", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 45273, "id": 45277, "nodeType": "Return", "src": "1226:27:124" } ] }, "documentation": { "id": 45269, "nodeType": "StructuredDocumentation", "src": "1090:63:124", "text": "@notice Master address from which this contract was cloned." }, "functionSelector": "ee97f7f3", "id": 45279, "implemented": true, "kind": "function", "modifiers": [], "name": "master", "nameL