@daostack/upgrades
Version:
Proxy upgadable contracts based on openzeppelin-sdk
1,103 lines • 69.5 kB
JSON
{
"fileName": "InitializableAdminUpgradeabilityProxy.sol",
"contractName": "InitializableAdminUpgradeabilityProxy",
"source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\nimport './BaseAdminUpgradeabilityProxy.sol';\nimport './InitializableUpgradeabilityProxy.sol';\n\n/**\n * @title InitializableAdminUpgradeabilityProxy\n * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for\n * initializing the implementation, admin, and init data.\n */\ncontract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy {\n /**\n * Contract initializer.\n * @param _logic address of the initial implementation.\n * @param _admin Address of the proxy administrator.\n * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.\n * It should include the signature and the parameters of the function to be called, as described in\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\n * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\n */\n function initialize(address _logic, address _admin, bytes memory _data) public payable {\n require(_implementation() == address(0));\n InitializableUpgradeabilityProxy.initialize(_logic, _data);\n assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _setAdmin(_admin);\n }\n\n /**\n * @dev Only fall back when the sender is not the admin.\n */\n function _willFallback() internal override(Proxy) {\n require(msg.sender != _admin(), \"Cannot call fallback function from the proxy admin\");\n super._willFallback();\n }\n}\n",
"sourcePath": "contracts/upgradeability/InitializableAdminUpgradeabilityProxy.sol",
"sourceMap": "340:1246:37:-:0;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "340:1246:37:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;514:50:39;548:11;:9;:11;;:::i;:::-;514:50;340:1246:37;;459:51:39;494:11;:9;:11;;:::i;:::-;459:51;340:1246:37;2238:103:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2858:221;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1558:96;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1830:224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1029:307:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;854:363:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1416:78:35;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2075:90:39;2111:15;:13;:15;;:::i;:::-;2132:28;2142:17;:15;:17;;:::i;:::-;2132:9;:28;;:::i;:::-;2075:90;:::o;2238:103:35:-;1293:8;:6;:8;;:::i;:::-;1279:22;;:10;:22;;;1275:76;;;2307:29:::1;2318:17;2307:10;:29;;:::i;:::-;1311:1;1275:76:::0;;;1333:11;:9;:11;;:::i;:::-;1275:76;2238:103;;:::o;2858:221::-;1293:8;:6;:8;;:::i;:::-;1279:22;;:10;:22;;;1275:76;;;2963:29:::1;2974:17;2963:10;:29;;:::i;:::-;2999:12;3016:17;:30;;3047:4;;3016:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2998:54;;;3066:7;3058:16;;;;;;;;1311:1;;1275:76:::0;;;1333:11;:9;:11;;:::i;:::-;1275:76;2858:221;;;;:::o;1558:96::-;1610:7;1293:8;:6;:8;;:::i;:::-;1279:22;;:10;:22;;;1275:76;;;1632:17:::1;:15;:17;;:::i;:::-;1625:24;;;;1311:1;1275:76:::0;;;1333:11;:9;:11;;:::i;:::-;1275:76;1558:96;;:::o;1830:224::-;1293:8;:6;:8;;:::i;:::-;1279:22;;:10;:22;;;1275:76;;;1920:1:::1;1900:22;;:8;:22;;;;1892:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1992:32;2005:8;:6;:8;;:::i;:::-;2015;1992:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2030:19;2040:8;2030:9;:19;;:::i;:::-;1311:1;1275:76:::0;;;1333:11;:9;:11;;:::i;:::-;1275:76;1830:224;;:::o;1029:307:37:-;1159:1;1130:31;;:17;:15;:17;;:::i;:::-;:31;;;1122:40;;;;;;;;1168:58;1212:6;1220:5;1168:43;:58;;:::i;:::-;1305:1;1269:32;;;;;;;;;;;;;;;;;;;;;1261:41;;:45;1253:54;;1239:68;;;994:66:35;1239:10:37;;:68;;;;1232:76;;;;;;1314:17;1324:6;1314:9;:17;;:::i;:::-;1029:307;;;;:::o;854:363:38:-;968:1;939:31;;:17;:15;:17;;:::i;:::-;:31;;;931:40;;;;;;;;1068:1;1023:41;;;;;;;;;;;;;;;;;;;;;1015:50;;:54;1007:63;;984:86;;;810:66:36;984:19:38;;:86;;;;977:94;;;;;;1077:26;1096:6;1077:18;:26;;:::i;:::-;1127:1;1112:5;:12;:16;1109:104;;;1139:12;1156:6;:19;;1176:5;1156:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1138:44;;;1198:7;1190:16;;;;;;;;1109:104;;854:363;;;:::o;1416:78:35:-;1459:7;1293:8;:6;:8;;:::i;:::-;1279:22;;:10;:22;;;1275:76;;;1481:8:::1;:6;:8;;:::i;:::-;1474:15;;;;1311:1;1275:76:::0;;;1333:11;:9;:11;;:::i;:::-;1275:76;1416:78;;:::o;1411:173:37:-;1489:8;:6;:8;;:::i;:::-;1475:22;;:10;:22;;;;1467:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1558:21;:19;:21;;:::i;:::-;1411:173;:::o;995:165:36:-;1054:12;1074;810:66;1089:19;;1074:34;;1145:4;1139:11;1131:19;;1123:33;;;:::o;981:743:39:-;1283:14;1280:1;1277;1264:34;1479:1;1476;1460:14;1457:1;1441:14;1434:5;1421:60;1543:16;1540:1;1537;1522:38;1575:6;1635:1;1630:38;;;;1695:16;1692:1;1685:27;1568:146;;1630:38;1649:16;1646:1;1639:27;1568:146;;1048:672;;;:::o;3128:136:35:-;3169:11;3188:12;994:66;3203:10;;3188:25;;3249:4;3243:11;3236:18;;3228:32;;;:::o;1295:142:36:-;1357:37;1376:17;1357:18;:37;;:::i;:::-;1414:17;1405:27;;;;;;;;;;;;1295:142;;:::o;3380:133:35:-;3432:12;994:66;3447:10;;3432:25;;3494:8;3488:4;3481:22;3473:36;;;:::o;1574:305:36:-;1652:57;1691:17;1652:38;:57;;:::i;:::-;1644:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1780:12;810:66;1795:19;;1780:34;;1851:17;1845:4;1838:31;1830:45;;;:::o;1933:47:39:-;;:::o;956:616:43:-;1016:4;1032:12;1531:7;1519:20;1511:28;;1564:1;1557:4;:8;1550:15;;;;;956:616;;;;;:::o",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "address",
"name": "_admin",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_logic",
"type": "address"
},
{
"internalType": "bytes",
"name": "_data",
"type": "bytes"
}
],
"name": "initialize",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"stateMutability": "payable",
"type": "receive"
}
],
"ast": {
"absolutePath": "contracts/upgradeability/InitializableAdminUpgradeabilityProxy.sol",
"exportedSymbols": {
"InitializableAdminUpgradeabilityProxy": [
6143
]
},
"id": 6144,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6066,
"literals": [
"solidity",
"^",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:37"
},
{
"absolutePath": "contracts/upgradeability/BaseAdminUpgradeabilityProxy.sol",
"file": "./BaseAdminUpgradeabilityProxy.sol",
"id": 6067,
"nodeType": "ImportDirective",
"scope": 6144,
"sourceUnit": 6000,
"src": "57:44:37",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "contracts/upgradeability/InitializableUpgradeabilityProxy.sol",
"file": "./InitializableUpgradeabilityProxy.sol",
"id": 6068,
"nodeType": "ImportDirective",
"scope": 6144,
"sourceUnit": 6207,
"src": "102:48:37",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6070,
"name": "BaseAdminUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5999,
"src": "390:28:37",
"typeDescriptions": {
"typeIdentifier": "t_contract$_BaseAdminUpgradeabilityProxy_$5999",
"typeString": "contract BaseAdminUpgradeabilityProxy"
}
},
"id": 6071,
"nodeType": "InheritanceSpecifier",
"src": "390:28:37"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6072,
"name": "InitializableUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6206,
"src": "420:32:37",
"typeDescriptions": {
"typeIdentifier": "t_contract$_InitializableUpgradeabilityProxy_$6206",
"typeString": "contract InitializableUpgradeabilityProxy"
}
},
"id": 6073,
"nodeType": "InheritanceSpecifier",
"src": "420:32:37"
}
],
"contractDependencies": [
5999,
6064,
6206,
6257
],
"contractKind": "contract",
"documentation": {
"id": 6069,
"nodeType": "StructuredDocumentation",
"src": "152:187:37",
"text": " @title InitializableAdminUpgradeabilityProxy\n @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for\n initializing the implementation, admin, and init data."
},
"fullyImplemented": true,
"id": 6143,
"linearizedBaseContracts": [
6143,
6206,
5999,
6064,
6257
],
"name": "InitializableAdminUpgradeabilityProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 6120,
"nodeType": "Block",
"src": "1116:220:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 6090,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 6084,
"name": "_implementation",
"nodeType": "Identifier",
"overloadedDeclarations": [
6028
],
"referencedDeclaration": 6028,
"src": "1130:15:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 6085,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1130:17:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 6088,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1159:1:37",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 6087,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1151:7:37",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6086,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1151:7:37",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6089,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1151:10:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1130:31:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 6083,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1122:7:37",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 6091,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1122:40:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6092,
"nodeType": "ExpressionStatement",
"src": "1122:40:37"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6096,
"name": "_logic",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6076,
"src": "1212:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 6097,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6080,
"src": "1220:5:37",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 6093,
"name": "InitializableUpgradeabilityProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6206,
"src": "1168:32:37",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_InitializableUpgradeabilityProxy_$6206_$",
"typeString": "type(contract InitializableUpgradeabilityProxy)"
}
},
"id": 6095,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "initialize",
"nodeType": "MemberAccess",
"referencedDeclaration": 6205,
"src": "1168:43:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$",
"typeString": "function (address,bytes memory)"
}
},
"id": 6098,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1168:58:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6099,
"nodeType": "ExpressionStatement",
"src": "1168:58:37"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 6113,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 6101,
"name": "ADMIN_SLOT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5866,
"src": "1239:10:37",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 6111,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "656970313936372e70726f78792e61646d696e",
"id": 6107,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1279:21:37",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104",
"typeString": "literal_string \"eip1967.proxy.admin\""
},
"value": "eip1967.proxy.admin"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104",
"typeString": "literal_string \"eip1967.proxy.admin\""
}
],
"id": 6106,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "1269:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 6108,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1269:32:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
],
"id": 6105,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1261:7:37",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_uint256_$",
"typeString": "type(uint256)"
},
"typeName": {
"id": 6104,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1261:7:37",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6109,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1261:41:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "-",
"rightExpression": {
"argumentTypes": null,
"hexValue": "31",
"id": 6110,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1305:1:37",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_1_by_1",
"typeString": "int_const 1"
},
"value": "1"
},
"src": "1261:45:37",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
],
"id": 6103,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1253:7:37",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_bytes32_$",
"typeString": "type(bytes32)"
},
"typeName": {
"id": 6102,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1253:7:37",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6112,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1253:54:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1239:68:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 6100,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "1232:6:37",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 6114,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1232:76:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6115,
"nodeType": "ExpressionStatement",
"src": "1232:76:37"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6117,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6078,
"src": "1324:6:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 6116,
"name": "_setAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5998,
"src": "1314:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 6118,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1314:17:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6119,
"nodeType": "ExpressionStatement",
"src": "1314:17:37"
}
]
},
"documentation": {
"id": 6074,
"nodeType": "StructuredDocumentation",
"src": "457:569:37",
"text": " Contract initializer.\n @param _logic address of the initial implementation.\n @param _admin Address of the proxy administrator.\n @param _data Data to send as msg.data to the implementation to initialize the proxied contract.\n It should include the signature and the parameters of the function to be called, as described in\n https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\n This parameter is optional, if no data is given the initialization call to proxied contract will be skipped."
},
"functionSelector": "cf7a1d77",
"id": 6121,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "initialize",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 6081,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6076,
"mutability": "mutable",
"name": "_logic",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6121,
"src": "1049:14:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6075,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1049:7:37",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6078,
"mutability": "mutable",
"name": "_admin",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6121,
"src": "1065:14:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6077,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1065:7:37",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6080,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6121,
"src": "1081:18:37",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6079,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1081:5:37",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1048:52:37"
},
"returnParameters": {
"id": 6082,
"nodeType": "ParameterList",
"parameters": [],
"src": "1116:0:37"
},
"scope": 6143,
"src": "1029:307:37",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
6243
],
"body": {
"id": 6141,
"nodeType": "Block",
"src": "1461:123:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 6132,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 6128,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "1475:3:37",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 6129,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1475:10:37",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 6130,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5986,
"src": "1489:6:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 6131,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1489:8:37",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1475:22:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e",
"id": 6133,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1499:52:37",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_08b466bde770d6d309a22d90ec051a62ad397be6218a53e741989877ec297fc9",
"typeString": "literal_string \"Cannot call fallback function from the proxy admin\""
},
"value": "Cannot call fallback function from the proxy admin"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_08b466bde770d6d309a22d90ec051a62ad397be6218a53e741989877ec297fc9",
"typeString": "literal_string \"Cannot call fallback function from the proxy admin\""
}
],
"id": 6127,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1467:7:37",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 6134,
"isConstant": false,
"isLValue