@daostack/upgrades
Version:
Proxy upgadable contracts based on openzeppelin-sdk
1,120 lines (1,119 loc) • 249 kB
JSON
{
"fileName": "ProxyFactory.sol",
"contractName": "ProxyFactory",
"source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\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": "148:3386:41:-:0;;;252:130;;;;;;;;;;;315:56;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;298:79;;;;;;279:16;;:98;;;;;;;;;;252:130;148:3386;;;;;;;;;;:::o;:::-;;;;;;;",
"deployedSourceMap": "148:3386:41:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2164:408;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1320:337;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1136:180;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1661:499;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;386:746;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2164:408;2296:7;2311:15;2329:170;2432:5;2439:6;2447;2455:5;2470:4;2404:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2385:108;;;;;;2329:48;:170;;:::i;:::-;2311:188;;2513:54;2547:7;2556:10;2513:33;:54;;:::i;:::-;2506:61;;;;;2164:408;;;;;;;;;:::o;1320:337::-;1450:7;1465:14;1482:51;1492:5;1499:6;1507;1515:5;1522:10;1482:9;:51;;:::i;:::-;1465:68;;1565:1;1547:20;;:6;:20;;;;1539:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1602;1615:5;1622:6;1630;1638:5;1645:6;1602:12;:50;;:::i;:::-;1595:57;;;;;1320:337;;;;;;;;;:::o;1136:180::-;1235:7;1257:54;1270:5;1277:6;1285;1293:5;1300:10;1257:12;:54;;:::i;:::-;1250:61;;;;1136:180;;;;;;;:::o;1661:499::-;1744:7;1909:12;1924:24;1933:5;1940:7;1924:8;:24;;:::i;:::-;1909:39;;1954:18;2025:4;2018:12;;2048:4;2063;2077:16;;;;1992:109;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1975:132;;;;;;1954:153;;2151:2;2137:10;:16;;;;;2121:34;;2114:41;;;;;;1661:499;;;;;;;:::o;386:746::-;461:13;620:19;650:6;642:15;;620:37;;699:4;693:11;725:66;718:5;711:81;824:11;817:4;810:5;806:16;799:37;868:66;861:4;854:5;850:16;843:92;968:4;961:5;958:1;951:22;942:31;;672:307;994:28;1015:5;994:28;;;;;;;;;;;;;;;;;;;;;;1047:1;1032:5;:12;:16;1029:95;;;1059:12;1076:5;:10;;1087:5;1076:17;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1058:35;;;1109:7;1101:16;;;;;;;;1029:95;;386:746;;;;;;:::o;3174:265:5:-;3243:7;3426:4;3373:58;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3363:69;;;;;;3356:76;;;;3174:265;;;;:::o;1133:1891::-;1211:7;1292:2;1272:9;:16;:22;;1268:72;;;1326:1;1310:19;;;;1268:72;1406:9;1425;1444:7;1690:4;1679:9;1675:20;1669:27;1664:32;;1735:4;1724:9;1720:20;1714:27;1709:32;;1788:4;1777:9;1773:20;1767:27;1764:1;1759:36;1754:41;;2706:66;2701:1;2693:10;;:79;2689:127;;;2803:1;2788:17;;;;;;;2689:127;2835:2;2830:1;:7;;;;:18;;;;;2846:2;2841:1;:7;;;;2830:18;2826:66;;;2879:1;2864:17;;;;;;;2826:66;2993:24;3003:4;3009:1;3012;3015;2993:24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2986:31;;;;;;;1133:1891;;;;;;;;:::o;2576:329:41:-;2700:7;2715:43;2761:28;2774:5;2781:7;2761:12;:28;;:::i;:::-;2715:74;;2800:28;2821:5;2800:28;;;;;;;;;;;;;;;;;;;;;;2834:5;:16;;;2851:6;2859;2867:5;2834:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2894:5;2879:21;;;;;2576:329;;;;;;;;;:::o;3388:144::-;3461:7;3510:5;3517:7;3493:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3483:43;;;;;;3476:50;;;;3388:144;;;;;:::o;2909:475::-;2981:37;3026:20;3052:17;3072:56;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;3052:76;;3134:12;3149:24;3158:5;3165:7;3149:8;:24;;:::i;:::-;3134:39;;3246:4;3239;3233:11;3226:4;3220;3216:15;3213:1;3205:46;3197:54;;3280:4;3268:17;3261:25;3258:2;;;3307:1;3304;3297:12;3258:2;3374:4;3329:50;;;;;;;2909:475;;;;;;;;:::o;-1:-1:-1:-;;;;;;;;:::o",
"abi": [
{
"inputs": [],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "proxy",
"type": "address"
}
],
"name": "ProxyCreated",
"type": "event"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_salt",
"type": "uint256"
},
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "_admin",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "deployMinimal",
"outputs": [
{
"internalType": "address",
"name": "proxy",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_salt",
"type": "uint256"
},
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "_admin",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_signature",
"type": "bytes"
}
],
"name": "deploySigned",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_salt",
"type": "uint256"
},
{
"internalType": "address",
"name": "_sender",
"type": "address"
}
],
"name": "getDeploymentAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_salt",
"type": "uint256"
},
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "_admin",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_signature",
"type": "bytes"
}
],
"name": "getSigner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
}
],
"ast": {
"absolutePath": "contracts/upgradeability/ProxyFactory.sol",
"exportedSymbols": {
"ProxyFactory": [
6700
]
},
"id": 6701,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6390,
"literals": [
"solidity",
"^",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:41"
},
{
"absolutePath": "contracts/upgradeability/InitializableAdminUpgradeabilityProxy.sol",
"file": "./InitializableAdminUpgradeabilityProxy.sol",
"id": 6391,
"nodeType": "ImportDirective",
"scope": 6701,
"sourceUnit": 6144,
"src": "57:53:41",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "contracts/cryptography/ECDSA.sol",
"file": "../cryptography/ECDSA.sol",
"id": 6392,
"nodeType": "ImportDirective",
"scope": 6701,
"sourceUnit": 938,
"src": "111:35:41",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [],
"contractDependencies": [
6143
],
"contractKind": "contract",
"documentation": null,
"fullyImplemented": true,
"id": 6700,
"linearizedBaseContracts": [
6700
],
"name": "ProxyFactory",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": null,
"id": 6396,
"name": "ProxyCreated",
"nodeType": "EventDefinition",
"parameters": {
"id": 6395,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6394,
"indexed": false,
"mutability": "mutable",
"name": "proxy",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6396,
"src": "196:13:41",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6393,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "196:7:41",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "195:15:41"
},
"src": "177:34:41"
},
{
"constant": false,
"id": 6398,
"mutability": "mutable",
"name": "contractCodeHash",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6700,
"src": "215:32:41",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 6397,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "215:7:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "private"
},
{
"body": {
"id": 6410,
"nodeType": "Block",
"src": "273:109:41",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 6408,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"id": 6401,
"name": "contractCodeHash",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6398,
"src": "279:16:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6404,
"name": "InitializableAdminUpgradeabilityProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6143,
"src": "320:37:41",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_InitializableAdminUpgradeabilityProxy_$6143_$",
"typeString": "type(contract InitializableAdminUpgradeabilityProxy)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_type$_t_contract$_InitializableAdminUpgradeabilityProxy_$6143_$",
"typeString": "type(contract InitializableAdminUpgradeabilityProxy)"
}
],
"id": 6403,
"name": "type",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -27,
"src": "315:4:41",
"typeDescriptions": {
"typeIdentifier": "t_function_metatype_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 6405,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "315:43:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_magic_meta_type_t_contract$_InitializableAdminUpgradeabilityProxy_$6143",
"typeString": "type(contract InitializableAdminUpgradeabilityProxy)"
}
},
"id": 6406,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "creationCode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "315:56:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"id": 6402,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "298:9:41",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 6407,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "298:79:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "279:98:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"id": 6409,
"nodeType": "ExpressionStatement",
"src": "279:98:41"
}
]
},
"documentation": null,
"id": 6411,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 6399,
"nodeType": "ParameterList",
"parameters": [],
"src": "263:2:41"
},
"returnParameters": {
"id": 6400,
"nodeType": "ParameterList",
"parameters": [],
"src": "273:0:41"
},
"scope": 6700,
"src": "252:130:41",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 6452,
"nodeType": "Block",
"src": "476:656:41",
"statements": [
{
"assignments": [
6421
],
"declarations": [
{
"constant": false,
"id": 6421,
"mutability": "mutable",
"name": "targetBytes",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6452,
"src": "620:19:41",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes20",
"typeString": "bytes20"
},
"typeName": {
"id": 6420,
"name": "bytes20",
"nodeType": "ElementaryTypeName",
"src": "620:7:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes20",
"typeString": "bytes20"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 6426,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6424,
"name": "_logic",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6413,
"src": "650:6:41",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 6423,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "642:7:41",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes20_$",
"typeString": "type(bytes20)"
},
"typeName": {
"id": 6422,
"name": "bytes20",
"nodeType": "ElementaryTypeName",
"src": "642:7:41",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6425,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "642:15:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes20",
"typeString": "bytes20"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "620:37:41"
},
{
"AST": {
"nodeType": "YulBlock",
"src": "672:307:41",
"statements": [
{
"nodeType": "YulVariableDeclaration",
"src": "680:24:41",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "699:4:41",
"type": "",
"value": "0x40"
}
],
"functionName": {
"name": "mload",
"nodeType": "YulIdentifier",
"src": "693:5:41"
},
"nodeType": "YulFunctionCall",
"src": "693:11:41"
},
"variables": [
{
"name": "clone",
"nodeType": "YulTypedName",
"src": "684:5:41",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "clone",
"nodeType": "YulIdentifier",
"src": "718:5:41"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "725:66:41",
"type": "",
"value": "0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "711:6:41"
},
"nodeType": "YulFunctionCall",
"src": "711:81:41"
},
"nodeType": "YulExpressionStatement",
"src": "711:81:41"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "clone",
"nodeType": "YulIdentifier",
"src": "810:5:41"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "817:4:41",
"type": "",
"value": "0x14"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "806:3:41"
},
"nodeType": "YulFunctionCall",
"src": "806:16:41"
},
{
"name": "targetBytes",
"nodeType": "YulIdentifier",
"src": "824:11:41"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "799:6:41"
},
"nodeType": "YulFunctionCall",
"src": "799:37:41"
},
"nodeType": "YulExpressionStatement",
"src": "799:37:41"
},
{
"expression": {
"arguments": [
{
"arguments": [
{
"name": "clone",
"nodeType": "YulIdentifier",
"src": "854:5:41"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "861:4:41",
"type": "",
"value": "0x28"
}
],
"functionName": {
"name": "add",
"nodeType": "YulIdentifier",
"src": "850:3:41"
},
"nodeType": "YulFunctionCall",
"src": "850:16:41"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "868:66:41",
"type": "",
"value": "0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000"
}
],
"functionName": {
"name": "mstore",
"nodeType": "YulIdentifier",
"src": "843:6:41"
},
"nodeType": "YulFunctionCall",
"src": "843:92:41"
},
"nodeType": "YulExpressionStatement",
"src": "843:92:41"
},
{
"nodeType": "YulAssignment",
"src": "942:31:41",
"value": {
"arguments": [
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "958:1:41",
"type": "",
"value": "0"
},
{
"name": "clone",
"nodeType": "YulIdentifier",
"src": "961:5:41"
},
{
"kind": "number",
"nodeType": "YulLiteral",
"src": "968:4:41",
"type": "",
"value": "0x37"
}
],
"functionName": {
"name": "create",
"nodeType": "YulIdentifier",
"src": "951:6:41"
},
"nodeType": "YulFunctionCall",
"src": "951:22:41"
},
"variableNames": [
{
"name": "proxy",
"nodeType": "YulIdentifier",
"src": "942:5:41"
}
]
}
]
},
"evmVersion": "constantinople",
"externalReferences": [
{
"declaration": 6418,
"isOffset": false,
"isSlot": false,
"src": "942:5:41",
"valueSize": 1
},
{
"declaration": 6421,
"isOffset": false,
"isSlot": false,
"src": "824:11:41",
"valueSize": 1
}
],
"id": 6427,
"nodeType": "InlineAssembly",
"src": "663:316:41"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6431,
"name": "proxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6418,
"src": "1015:5:41",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 6430,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1007:7:41",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6429,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1007:7:41",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6432,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1007:14:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 6428,
"name": "ProxyCreated",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6396,
"src": "994:12:41",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 6433,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "994:28:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6434,
"nodeType": "EmitStatement",
"src": "989:33:41"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6438,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 6435,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6415,
"src": "1032:5:41",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 6436,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1032:12:41",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 6437,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1047:1:41",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1032:16:41",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 6451,
"nodeType": "IfStatement",
"src": "1029:95:41",
"trueBody": {
"id": 6450,
"nodeType": "Block",
"src": "1050:74:41",
"statements": [
{
"assignments": [
6440,
null
],
"declarations": [
{
"constant": false,
"id": 6440,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6450,
"src": "1059:12:41",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6439,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1059:4:41",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
null
],
"id": 6445,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6443,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6415,
"src": "1087: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": 6441,
"name": "proxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6418,
"src": "1076:5:41",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 6442,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "call",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1076: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": 6444,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1076:17:41",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1058:35:41"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6447,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6440,
"src": "1109:7:41",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],