UNPKG

@openzeppelin/upgrades

Version:

JavaScript library for the OpenZeppelin smart contract platform

1,065 lines (1,064 loc) 225 kB
{ "fileName": "ProxyFactory.sol", "contractName": "ProxyFactory", "source": "pragma solidity ^0.5.3;\n\nimport \"./InitializableAdminUpgradeabilityProxy.sol\";\nimport \"../cryptography/ECDSA.sol\";\n\ncontract ProxyFactory {\n \n event ProxyCreated(address proxy);\n\n bytes32 private contractCodeHash;\n\n constructor() public {\n contractCodeHash = keccak256(\n type(InitializableAdminUpgradeabilityProxy).creationCode\n );\n }\n\n function deployMinimal(address _logic, bytes memory _data) public returns (address proxy) {\n // Adapted from https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol\n bytes20 targetBytes = bytes20(_logic);\n assembly {\n let clone := mload(0x40)\n mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n mstore(add(clone, 0x14), targetBytes)\n mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n proxy := create(0, clone, 0x37)\n }\n \n emit ProxyCreated(address(proxy));\n\n if(_data.length > 0) {\n (bool success,) = proxy.call(_data);\n require(success);\n } \n }\n\n function deploy(uint256 _salt, address _logic, address _admin, bytes memory _data) public returns (address) {\n return _deployProxy(_salt, _logic, _admin, _data, msg.sender);\n }\n\n function deploySigned(uint256 _salt, address _logic, address _admin, bytes memory _data, bytes memory _signature) public returns (address) {\n address signer = getSigner(_salt, _logic, _admin, _data, _signature);\n require(signer != address(0), \"Invalid signature\");\n return _deployProxy(_salt, _logic, _admin, _data, signer);\n }\n\n function getDeploymentAddress(uint256 _salt, address _sender) public view returns (address) {\n // Adapted from https://github.com/archanova/solidity/blob/08f8f6bedc6e71c24758d20219b7d0749d75919d/contracts/contractCreator/ContractCreator.sol\n bytes32 salt = _getSalt(_salt, _sender);\n bytes32 rawAddress = keccak256(\n abi.encodePacked(\n bytes1(0xff),\n address(this),\n salt,\n contractCodeHash\n )\n );\n\n return address(bytes20(rawAddress << 96));\n }\n\n function getSigner(uint256 _salt, address _logic, address _admin, bytes memory _data, bytes memory _signature) public view returns (address) {\n bytes32 msgHash = OpenZeppelinUpgradesECDSA.toEthSignedMessageHash(\n keccak256(\n abi.encodePacked(\n _salt, _logic, _admin, _data, address(this)\n )\n )\n );\n\n return OpenZeppelinUpgradesECDSA.recover(msgHash, _signature);\n }\n\n function _deployProxy(uint256 _salt, address _logic, address _admin, bytes memory _data, address _sender) internal returns (address) {\n InitializableAdminUpgradeabilityProxy proxy = _createProxy(_salt, _sender);\n emit ProxyCreated(address(proxy));\n proxy.initialize(_logic, _admin, _data);\n return address(proxy);\n }\n\n function _createProxy(uint256 _salt, address _sender) internal returns (InitializableAdminUpgradeabilityProxy) {\n address payable addr;\n bytes memory code = type(InitializableAdminUpgradeabilityProxy).creationCode;\n bytes32 salt = _getSalt(_salt, _sender);\n\n assembly {\n addr := create2(0, add(code, 0x20), mload(code), salt)\n if iszero(extcodesize(addr)) {\n revert(0, 0)\n }\n }\n\n return InitializableAdminUpgradeabilityProxy(addr);\n }\n\n function _getSalt(uint256 _salt, address _sender) internal pure returns (bytes32) {\n return keccak256(abi.encodePacked(_salt, _sender)); \n }\n}\n", "sourcePath": "contracts/upgradeability/ProxyFactory.sol", "sourceMap": "116:3386:41:-;;;220:130;8:9:-1;5:2;;;30:1;27;20:12;5:2;220:130:41;283:56;;;;;;;;:::i;:::-;41:4:-1;34:5;30:16;25:3;21:26;14:5;7:41;65:3;61:2;54:15;283:56:41;266:79;;;;;;247:16;:98;;;;116:3386;;;;;;;;;;:::o;:::-;;;;;;;", "deployedSourceMap": "116:3386:41:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;116:3386:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2132:408;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2132:408:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2132:408:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2132:408:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2132:408:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;2132:408:41;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2132:408:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2132:408:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2132:408:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;2132:408:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1288:337;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1288:337:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1288:337:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1288:337:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1288:337:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1288:337:41;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1288:337:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1288:337:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1288:337:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1288:337:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1104:180;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;1104:180:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1104:180:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1104:180:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1104:180:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1104:180:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1629:499;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1629:499:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;354:746;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;354:746:41;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;354:746:41;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;354:746:41;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;354:746:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;354:746:41;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2132:408;2264:7;2279:15;2297:170;2400:5;2407:6;2415;2423:5;2438:4;2372:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2372:81:41;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;2372:81:41;;;2353:108;;;;;;2297:48;:170::i;:::-;2279:188;;2481:54;2515:7;2524:10;2481:33;:54::i;:::-;2474:61;;;2132:408;;;;;;;:::o;1288:337::-;1418:7;1433:14;1450:51;1460:5;1467:6;1475;1483:5;1490:10;1450:9;:51::i;:::-;1433:68;;1533:1;1515:20;;:6;:20;;;;1507:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1570;1583:5;1590:6;1598;1606:5;1613:6;1570:12;:50::i;:::-;1563:57;;;1288:337;;;;;;;:::o;1104:180::-;1203:7;1225:54;1238:5;1245:6;1253;1261:5;1268:10;1225:12;:54::i;:::-;1218:61;;1104:180;;;;;;:::o;1629:499::-;1712:7;1877:12;1892:24;1901:5;1908:7;1892:8;:24::i;:::-;1877:39;;1922:18;1993:4;1986:12;;2016:4;2031;2045:16;;1960:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;1960:109:41;;;1943:132;;;;;;1922:153;;2119:2;2105:10;:16;;2089:34;;2082:41;;;;1629:499;;;;:::o;354:746::-;429:13;588:19;618:6;610:15;;588:37;;667:4;661:11;693:66;686:5;679:81;792:11;785:4;778:5;774:16;767:37;836:66;829:4;822:5;818:16;811:92;936:4;929:5;926:1;919:22;910:31;;640:307;962:28;983:5;962:28;;;;;;;;;;;;;;;;;;;;;;1015:1;1000:5;:12;:16;997:95;;;1027:12;1044:5;:10;;1055:5;1044:17;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1044:17:41;;;;;;;;;;;;;;;;;;;;;;;;14:1:-1;21;16:31;;;;75:4;69:11;64:16;;144:4;140:9;133:4;115:16;111:27;107:43;104:1;100:51;94:4;87:65;169:16;166:1;159:27;225:16;222:1;215:4;212:1;208:12;193:49;7:242;;16:31;36:4;31:9;;7:242;;1026:35:41;;;1077:7;1069:16;;;;;;;;997:95;;354:746;;;;;:::o;3142:265:5:-;3211:7;3394:4;3341:58;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3341:58:5;;;3331:69;;;;;;3324:76;;3142:265;;;:::o;1101:1891::-;1179:7;1260:2;1240:9;:16;:22;;1236:72;;;1294:1;1278:19;;;;1236:72;1374:9;1393;1412:7;1658:4;1647:9;1643:20;1637:27;1632:32;;1703:4;1692:9;1688:20;1682:27;1677:32;;1756:4;1745:9;1741:20;1735:27;1732:1;1727:36;1722:41;;2674:66;2669:1;2661:10;;:79;2657:127;;;2771:1;2756:17;;;;;;;2657:127;2803:2;2798:1;:7;;;;:18;;;;;2814:2;2809:1;:7;;;;2798:18;2794:66;;;2847:1;2832:17;;;;;;;2794:66;2961:24;2971:4;2977:1;2980;2983;2961:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2961:24:5;;;;;;;;2954:31;;;;;1101:1891;;;;;:::o;2544:329:41:-;2668:7;2683:43;2729:28;2742:5;2749:7;2729:12;:28::i;:::-;2683:74;;2768:28;2789:5;2768:28;;;;;;;;;;;;;;;;;;;;;;2802:5;:16;;;2819:6;2827;2835:5;2802:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;2802:39:41;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2802:39:41;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2802:39:41;;;;2862:5;2847:21;;;2544:329;;;;;;;:::o;3356:144::-;3429:7;3478:5;3485:7;3461:32;;;;;;;;;;;;;;;;;;;;;;;;;;;49:4:-1;39:7;30;26:21;22:32;13:7;6:49;3461:32:41;;;3451:43;;;;;;3444:50;;3356:144;;;;:::o;2877:475::-;2949:37;2994:20;3020:17;3040:56;;;;;;;;:::i;:::-;41:4:-1;34:5;30:16;25:3;21:26;14:5;7:41;65:3;61:2;54:15;3040:56:41;3020:76;;3102:12;3117:24;3126:5;3133:7;3117:8;:24::i;:::-;3102:39;;3214:4;3207;3201:11;3194:4;3188;3184:15;3181:1;3173:46;3165:54;;3248:4;3236:17;3229:25;3226:2;;;3275:1;3272;3265:12;3226:2;3342:4;3297:50;;;;;2877:475;;;;:::o;116:3386::-;;;;;;;;:::o", "abi": [ { "constant": true, "inputs": [ { "name": "_salt", "type": "uint256" }, { "name": "_logic", "type": "address" }, { "name": "_admin", "type": "address" }, { "name": "_data", "type": "bytes" }, { "name": "_signature", "type": "bytes" } ], "name": "getSigner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_salt", "type": "uint256" }, { "name": "_logic", "type": "address" }, { "name": "_admin", "type": "address" }, { "name": "_data", "type": "bytes" }, { "name": "_signature", "type": "bytes" } ], "name": "deploySigned", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "_salt", "type": "uint256" }, { "name": "_logic", "type": "address" }, { "name": "_admin", "type": "address" }, { "name": "_data", "type": "bytes" } ], "name": "deploy", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "_salt", "type": "uint256" }, { "name": "_sender", "type": "address" } ], "name": "getDeploymentAddress", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "_logic", "type": "address" }, { "name": "_data", "type": "bytes" } ], "name": "deployMinimal", "outputs": [ { "name": "proxy", "type": "address" } ], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "proxy", "type": "address" } ], "name": "ProxyCreated", "type": "event" } ], "ast": { "absolutePath": "contracts/upgradeability/ProxyFactory.sol", "exportedSymbols": { "ProxyFactory": [ 6321 ] }, "id": 6322, "nodeType": "SourceUnit", "nodes": [ { "id": 6021, "literals": [ "solidity", "^", "0.5", ".3" ], "nodeType": "PragmaDirective", "src": "0:23:41" }, { "absolutePath": "contracts/upgradeability/InitializableAdminUpgradeabilityProxy.sol", "file": "./InitializableAdminUpgradeabilityProxy.sol", "id": 6022, "nodeType": "ImportDirective", "scope": 6322, "sourceUnit": 5801, "src": "25:53:41", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/cryptography/ECDSA.sol", "file": "../cryptography/ECDSA.sol", "id": 6023, "nodeType": "ImportDirective", "scope": 6322, "sourceUnit": 875, "src": "79:35:41", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [ 5800 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 6321, "linearizedBaseContracts": [ 6321 ], "name": "ProxyFactory", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": null, "id": 6027, "name": "ProxyCreated", "nodeType": "EventDefinition", "parameters": { "id": 6026, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6025, "indexed": false, "name": "proxy", "nodeType": "VariableDeclaration", "scope": 6027, "src": "164:13:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 6024, "name": "address", "nodeType": "ElementaryTypeName", "src": "164:7:41", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "163:15:41" }, "src": "145:34:41" }, { "constant": false, "id": 6029, "name": "contractCodeHash", "nodeType": "VariableDeclaration", "scope": 6321, "src": "183:32:41", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 6028, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "183:7:41", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": null, "visibility": "private" }, { "body": { "id": 6041, "nodeType": "Block", "src": "241:109:41", "statements": [ { "expression": { "argumentTypes": null, "id": 6039, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 6032, "name": "contractCodeHash", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6029, "src": "247:16:41", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6035, "name": "InitializableAdminUpgradeabilityProxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5800, "src": "288:37:41", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_InitializableAdminUpgradeabilityProxy_$5800_$", "typeString": "type(contract InitializableAdminUpgradeabilityProxy)" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_type$_t_contract$_InitializableAdminUpgradeabilityProxy_$5800_$", "typeString": "type(contract InitializableAdminUpgradeabilityProxy)" } ], "id": 6034, "name": "type", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6476, "src": "283:4:41", "typeDescriptions": { "typeIdentifier": "t_function_metatype_pure$_t_address_$returns$__$", "typeString": "function (address) pure" } }, "id": 6036, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "283:43:41", "typeDescriptions": { "typeIdentifier": "t_magic_meta_type_t_contract$_InitializableAdminUpgradeabilityProxy_$5800", "typeString": "type(contract InitializableAdminUpgradeabilityProxy)" } }, "id": 6037, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "memberName": "creationCode", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "283:56:41", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "id": 6033, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6457, "src": "266:9:41", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 6038, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "266:79:41", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "247:98:41", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "id": 6040, "nodeType": "ExpressionStatement", "src": "247:98:41" } ] }, "documentation": null, "id": 6042, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 6030, "nodeType": "ParameterList", "parameters": [], "src": "231:2:41" }, "returnParameters": { "id": 6031, "nodeType": "ParameterList", "parameters": [], "src": "241:0:41" }, "scope": 6321, "src": "220:130:41", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 6081, "nodeType": "Block", "src": "444:656:41", "statements": [ { "assignments": [ 6052 ], "declarations": [ { "constant": false, "id": 6052, "name": "targetBytes", "nodeType": "VariableDeclaration", "scope": 6081, "src": "588:19:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes20", "typeString": "bytes20" }, "typeName": { "id": 6051, "name": "bytes20", "nodeType": "ElementaryTypeName", "src": "588:7:41", "typeDescriptions": { "typeIdentifier": "t_bytes20", "typeString": "bytes20" } }, "value": null, "visibility": "internal" } ], "id": 6056, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6054, "name": "_logic", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6044, "src": "618:6:41", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 6053, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "610:7:41", "typeDescriptions": { "typeIdentifier": "t_type$_t_bytes20_$", "typeString": "type(bytes20)" }, "typeName": "bytes20" }, "id": 6055, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "610:15:41", "typeDescriptions": { "typeIdentifier": "t_bytes20", "typeString": "bytes20" } }, "nodeType": "VariableDeclarationStatement", "src": "588:37:41" }, { "externalReferences": [ { "proxy": { "declaration": 6049, "isOffset": false, "isSlot": false, "src": "910:5:41", "valueSize": 1 } }, { "targetBytes": { "declaration": 6052, "isOffset": false, "isSlot": false, "src": "792:11:41", "valueSize": 1 } } ], "id": 6057, "nodeType": "InlineAssembly", "operations": "{\n let clone := mload(0x40)\n mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\n mstore(add(clone, 0x14), targetBytes)\n mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\n proxy := create(0, clone, 0x37)\n}", "src": "631:330:41" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6060, "name": "proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6049, "src": "983:5:41", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 6059, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "975:7:41", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 6061, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "975:14:41", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 6058, "name": "ProxyCreated", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6027, "src": "962:12:41", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 6062, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "962:28:41", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 6063, "nodeType": "EmitStatement", "src": "957:33:41" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "id": 6067, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 6064, "name": "_data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6046, "src": "1000:5:41", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } }, "id": 6065, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "length", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1000:12:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "nodeType": "BinaryOperation", "operator": ">", "rightExpression": { "argumentTypes": null, "hexValue": "30", "id": 6066, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1015:1:41", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" }, "src": "1000:16:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 6080, "nodeType": "IfStatement", "src": "997:95:41", "trueBody": { "id": 6079, "nodeType": "Block", "src": "1018:74:41", "statements": [ { "assignments": [ 6069, null ], "declarations": [ { "constant": false, "id": 6069, "name": "success", "nodeType": "VariableDeclaration", "scope": 6079, "src": "1027:12:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 6068, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1027:4:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" }, null ], "id": 6074, "initialValue": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6072, "name": "_data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6046, "src": "1055:5:41", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } ], "expression": { "argumentTypes": null, "id": 6070, "name": "proxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6049, "src": "1044:5:41", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "id": 6071, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "call", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1044:10:41", "typeDescriptions": { "typeIdentifier": "t_function_barecall_payable$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$", "typeString": "function (bytes memory) payable returns (bool,bytes memory)" } }, "id": 6073, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1044:17:41", "typeDescriptions": { "typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$", "typeString": "tuple(bool,bytes memory)" } }, "nodeType": "VariableDeclarationStatement", "src": "1026:35:41" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6076, "name": "success", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6069, "src": "1077:7:41", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 6075, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6466, 6467 ], "referencedDeclaration": 6466, "src": "1069:7:41", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 6077, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1069:16:41", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 6078, "nodeType": "ExpressionStatement", "src": "1069:16:41" } ] } } ] }, "documentation": null, "id": 6082, "implemented": true, "kind": "function", "modifiers": [], "name": "deployMinimal", "nodeType": "FunctionDefinition", "parameters": { "id": 6047, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6044, "name": "_logic", "nodeType": "VariableDeclaration", "scope": 6082, "src": "377:14:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 6043, "name": "address", "nodeType": "ElementaryTypeName", "src": "377:7:41", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 6046, "name": "_data", "nodeType": "VariableDeclaration", "scope": 6082, "src": "393:18:41", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 6045, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "393:5:41", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "376:36:41" }, "returnParameters": { "id": 6050, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 6049, "name": "proxy", "nodeType": "VariableDeclaration", "scope": 6082, "src": "429:13:41", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 6048, "name": "address", "nodeType": "ElementaryTypeName", "src": "429:7:41", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "428:15:41" }, "scope": 6321, "src": "354:746:41", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 6104, "nodeType": "Block", "src": "1212:72:41", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 6096, "name": "_salt", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6084, "src": "1238:5:41", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, { "argumentTypes": null, "id": 6097, "name": "_logic", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6086, "src": "1245:6:41", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, {