UNPKG

witnet-solidity-bridge

Version:

Witnet Solidity Bridge contracts for EVM-compatible chains

1,173 lines 116 kB
{ "contractName": "Clonable", "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" } ], "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\"}],\"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.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"project:/contracts/patterns/Clonable.sol\":\"Clonable\"},\"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/Clonable.sol\":{\"keccak256\":\"0x9a2dbc814306f60263fe736b88aeabc44fc241d3bed132e8dd76a3684dd825f7\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://e665de5be06c9227c49f9466d24f798d4bed1a2db66d4d1368dcd9fc663c1b3a\",\"dweb:/ipfs/QmRjY2CHTGp1eyi9XPeTKr4WnPCzXbtk2285kdy2bJVCYA\"]},\"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 Clonable\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(), \"Clonable: only on clones\");\r\n _;\r\n }\r\n\r\n modifier notOnClones virtual {\r\n require(!cloned(), \"Clonable: not on clones\"); \r\n _;\r\n }\r\n\r\n modifier wasInitialized {\r\n require(initialized(), \"Clonable: 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 /// 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), \"Clonable: CREATE failed\");\r\n emit Cloned(msg.sender, base(), _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), \"Clonable: CREATE2 failed\");\r\n emit Cloned(msg.sender, base(), _instance);\r\n }\r\n\r\n /// @notice Returns minimal proxy's deploy bytecode.\r\n function _cloneBytecode()\r\n internal view\r\n returns (bytes memory)\r\n {\r\n return abi.encodePacked(\r\n hex\"3d602d80600a3d3981f3363d3d373d3d3d363d73\",\r\n bytes20(base()),\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 _base = base();\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, _base))\r\n // end minimal proxy construction bytecode:\r\n mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\r\n }\r\n }\r\n}", "sourcePath": "C:\\Users\\guill\\github\\guidiaz\\witnet-solidity-bridge\\contracts\\patterns\\Clonable.sol", "ast": { "absolutePath": "project:/contracts/patterns/Clonable.sol", "exportedSymbols": { "Clonable": [ 45518 ], "Initializable": [ 267 ] }, "id": 45519, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 45344, "literals": [ "solidity", ">=", "0.8", ".20", "<", "0.9", ".0" ], "nodeType": "PragmaDirective", "src": "35:32:127" }, { "absolutePath": "project:/contracts/patterns/Initializable.sol", "file": "./Initializable.sol", "id": 45345, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 45519, "sourceUnit": 45622, "src": "71:29:127", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [ { "baseName": { "id": 45346, "name": "Initializable", "nameLocations": [ "148:13:127" ], "nodeType": "IdentifierPath", "referencedDeclaration": 267, "src": "148:13:127" }, "id": 45347, "nodeType": "InheritanceSpecifier", "src": "148:13:127" } ], "canonicalName": "Clonable", "contractDependencies": [], "contractKind": "contract", "fullyImplemented": false, "id": 45518, "linearizedBaseContracts": [ 45518, 267 ], "name": "Clonable", "nameLocation": "122:8:127", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 45353, "mutability": "immutable", "name": "__SELF", "nameLocation": "197:6:127", "nodeType": "VariableDeclaration", "scope": 45518, "src": "170:49:127", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45348, "name": "address", "nodeType": "ElementaryTypeName", "src": "170:7:127", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": { "arguments": [ { "id": 45351, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "214:4:127", "typeDescriptions": { "typeIdentifier": "t_contract$_Clonable_$45518", "typeString": "contract Clonable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Clonable_$45518", "typeString": "contract Clonable" } ], "id": 45350, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "206:7:127", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 45349, "name": "address", "nodeType": "ElementaryTypeName", "src": "206:7:127", "typeDescriptions": {} } }, "id": 45352, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "206:13:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "anonymous": false, "eventSelector": "f376596be5039d6b2fb36fead4c8a370eae426e790a869be8db074ab608cc248", "id": 45361, "name": "Cloned", "nameLocation": "234:6:127", "nodeType": "EventDefinition", "parameters": { "id": 45360, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45355, "indexed": true, "mutability": "mutable", "name": "by", "nameLocation": "257:2:127", "nodeType": "VariableDeclaration", "scope": 45361, "src": "241:18:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45354, "name": "address", "nodeType": "ElementaryTypeName", "src": "241:7:127", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 45357, "indexed": true, "mutability": "mutable", "name": "master", "nameLocation": "277:6:127", "nodeType": "VariableDeclaration", "scope": 45361, "src": "261:22:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45356, "name": "address", "nodeType": "ElementaryTypeName", "src": "261:7:127", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" }, { "constant": false, "id": 45359, "indexed": true, "mutability": "mutable", "name": "clone", "nameLocation": "301:5:127", "nodeType": "VariableDeclaration", "scope": 45361, "src": "285:21:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45358, "name": "address", "nodeType": "ElementaryTypeName", "src": "285:7:127", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "240:67:127" }, "src": "228:80:127" }, { "body": { "id": 45370, "nodeType": "Block", "src": "346:76:127", "statements": [ { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 45364, "name": "cloned", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45414, "src": "365:6:127", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45365, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "365:8:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c653a206f6e6c79206f6e20636c6f6e6573", "id": 45366, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "375:26:127", "typeDescriptions": { "typeIdentifier": "t_stringliteral_679c3eba4e7d658297efbb8047c8787b8adf0086ae8149ace5cf10d6f2df7de4", "typeString": "literal_string \"Clonable: only on clones\"" }, "value": "Clonable: only on clones" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_679c3eba4e7d658297efbb8047c8787b8adf0086ae8149ace5cf10d6f2df7de4", "typeString": "literal_string \"Clonable: only on clones\"" } ], "id": 45363, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "357:7:127", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45367, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "357:45:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45368, "nodeType": "ExpressionStatement", "src": "357:45:127" }, { "id": 45369, "nodeType": "PlaceholderStatement", "src": "413:1:127" } ] }, "id": 45371, "name": "onlyOnClones", "nameLocation": "325:12:127", "nodeType": "ModifierDefinition", "parameters": { "id": 45362, "nodeType": "ParameterList", "parameters": [], "src": "338:0:127" }, "src": "316:106:127", "virtual": true, "visibility": "internal" }, { "body": { "id": 45381, "nodeType": "Block", "src": "459:77:127", "statements": [ { "expression": { "arguments": [ { "id": 45376, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "478:9:127", "subExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 45374, "name": "cloned", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45414, "src": "479:6:127", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45375, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "479:8:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c653a206e6f74206f6e20636c6f6e6573", "id": 45377, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "489:25:127", "typeDescriptions": { "typeIdentifier": "t_stringliteral_6c8d6ab6c355fbee6991366178d616f7020664f3d5ef700c3a324122b0d63803", "typeString": "literal_string \"Clonable: not on clones\"" }, "value": "Clonable: not on clones" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_6c8d6ab6c355fbee6991366178d616f7020664f3d5ef700c3a324122b0d63803", "typeString": "literal_string \"Clonable: not on clones\"" } ], "id": 45373, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "470:7:127", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45378, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "470:45:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45379, "nodeType": "ExpressionStatement", "src": "470:45:127" }, { "id": 45380, "nodeType": "PlaceholderStatement", "src": "527:1:127" } ] }, "id": 45382, "name": "notOnClones", "nameLocation": "439:11:127", "nodeType": "ModifierDefinition", "parameters": { "id": 45372, "nodeType": "ParameterList", "parameters": [], "src": "451:0:127" }, "src": "430:106:127", "virtual": true, "visibility": "internal" }, { "body": { "id": 45391, "nodeType": "Block", "src": "568:82:127", "statements": [ { "expression": { "arguments": [ { "arguments": [], "expression": { "argumentTypes": [], "id": 45385, "name": "initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45420, "src": "587:11:127", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 45386, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "587:13:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "436c6f6e61626c653a206e6f7420696e697469616c697a6564", "id": 45387, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "602:27:127", "typeDescriptions": { "typeIdentifier": "t_stringliteral_ce61f321a906d42c94add0f81a303e335ce4d3c44e707c18568ea10a1470b252", "typeString": "literal_string \"Clonable: not initialized\"" }, "value": "Clonable: not initialized" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_ce61f321a906d42c94add0f81a303e335ce4d3c44e707c18568ea10a1470b252", "typeString": "literal_string \"Clonable: not initialized\"" } ], "id": 45384, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "579:7:127", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 45388, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "579:51:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 45389, "nodeType": "ExpressionStatement", "src": "579:51:127" }, { "id": 45390, "nodeType": "PlaceholderStatement", "src": "641:1:127" } ] }, "id": 45392, "name": "wasInitialized", "nameLocation": "553:14:127", "nodeType": "ModifierDefinition", "parameters": { "id": 45383, "nodeType": "ParameterList", "parameters": [], "src": "568:0:127" }, "src": "544:106:127", "virtual": false, "visibility": "internal" }, { "body": { "id": 45399, "nodeType": "Block", "src": "712:32:127", "statements": [ { "expression": { "id": 45397, "name": "__SELF", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45353, "src": "730:6:127", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 45396, "id": 45398, "nodeType": "Return", "src": "723:13:127" } ] }, "functionSelector": "5001f3b5", "id": 45400, "implemented": true, "kind": "function", "modifiers": [], "name": "base", "nameLocation": "667:4:127", "nodeType": "FunctionDefinition", "parameters": { "id": 45393, "nodeType": "ParameterList", "parameters": [], "src": "671:2:127" }, "returnParameters": { "id": 45396, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45395, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45400, "src": "703:7:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 45394, "name": "address", "nodeType": "ElementaryTypeName", "src": "703:7:127", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "visibility": "internal" } ], "src": "702:9:127" }, "scope": 45518, "src": "658:86:127", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "body": { "id": 45413, "nodeType": "Block", "src": "896:49:127", "statements": [ { "expression": { "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 45411, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "arguments": [ { "id": 45408, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "922:4:127", "typeDescriptions": { "typeIdentifier": "t_contract$_Clonable_$45518", "typeString": "contract Clonable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Clonable_$45518", "typeString": "contract Clonable" } ], "id": 45407, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "914:7:127", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 45406, "name": "address", "nodeType": "ElementaryTypeName", "src": "914:7:127", "typeDescriptions": {} } }, "id": 45409, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "914:13:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "!=", "rightExpression": { "id": 45410, "name": "__SELF", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45353, "src": "931:6:127", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "914:23:127", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 45405, "id": 45412, "nodeType": "Return", "src": "907:30:127" } ] }, "documentation": { "id": 45401, "nodeType": "StructuredDocumentation", "src": "752:62:127", "text": "@notice Tells whether this contract is a clone of `self()`" }, "functionSelector": "a04daef0", "id": 45414, "implemented": true, "kind": "function", "modifiers": [], "name": "cloned", "nameLocation": "829:6:127", "nodeType": "FunctionDefinition", "parameters": { "id": 45402, "nodeType": "ParameterList", "parameters": [], "src": "835:2:127" }, "returnParameters": { "id": 45405, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45404, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45414, "src": "885:4:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 45403, "name": "bool", "nodeType": "ElementaryTypeName", "src": "885:4:127", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "884:6:127" }, "scope": 45518, "src": "820:125:127", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "documentation": { "id": 45415, "nodeType": "StructuredDocumentation", "src": "953:61:127", "text": "@notice Tells whether this instance has been initialized." }, "functionSelector": "158ef93e", "id": 45420, "implemented": false, "kind": "function", "modifiers": [], "name": "initialized", "nameLocation": "1029:11:127", "nodeType": "FunctionDefinition", "parameters": { "id": 45416, "nodeType": "ParameterList", "parameters": [], "src": "1040:2:127" }, "returnParameters": { "id": 45419, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 45418, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 45420, "src": "1072:4:127", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 45417, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1072:4:127", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "1071:6:127" }, "scope": 45518, "src": "1020:58:127", "stateMutability": "view", "virtual": true, "visibility": "public" }, { "body": { "id": 45450, "nodeType": "Block", "src": "1611:303:127", "statements": [ { "assignments": [ 45427 ], "declarations": [ { "constant": false, "id": 45427, "mutability": "mutable", "name": "ptr", "nameLocation": "1635:3:127", "nodeType": "VariableDeclaration", "scope": 45450, "src": "1622:16:127", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 45426, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1622:5:127", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "visibility": "internal" } ], "id": 45430, "initialValue": { "arguments": [], "expression": { "argumentTypes": [], "id": 45428, "name": "_cloneBytecodePtr", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 45517, "src": "1641:17:127", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bytes_memory_ptr_$", "typeString": "function () view returns (bytes memory)" } }, "id": 45429, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "nameLocations": [], "names": [], "nodeType": "FunctionCall", "src": "1641:19:127", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "nodeType": "VariableDeclarationStatement", "src": "1622:38:127" }, { "AST": { "nativeSrc": "1680:96:127", "nodeType": "YulBlock", "src": "1680:96:127", "statements": [ { "nativeSrc": "1732:33:127", "nodeType": "YulAssignment", "src": "1732:33:127", "value": { "arguments": [ { "kind": "number", "nativeSrc": "1752:1:127", "nodeType": "YulLiteral", "src": "1752:1:127", "type": "", "value": "0" }, { "name": "ptr", "nativeSrc": "1755:3:127", "nodeType": "YulIdentifier", "src": "1755:3:127" }, { "kind": "number", "nativeSrc": "1760:4:127", "nodeType": "YulLiteral", "src": "1760:4:127", "type": "", "value": "0x37" } ], "functionName": { "name": "create", "nativeSrc": "1745:6:127", "nodeType": "YulIdentifier", "src": "1745:6:127" }, "nativeSrc": "1745:20:127", "nodeType": "YulFunctionCall", "src": "1745:20:127" }, "variableNames": [ { "