@daostack/upgrades
Version:
Proxy upgadable contracts based on openzeppelin-sdk
1,084 lines • 62 kB
JSON
{
"fileName": "ZosInitializableAdminUpgradeabilityProxy.sol",
"contractName": "ZosInitializableAdminUpgradeabilityProxy",
"source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\nimport './ZosBaseAdminUpgradeabilityProxy.sol';\nimport './ZosInitializableUpgradeabilityProxy.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 ZosInitializableAdminUpgradeabilityProxy is ZosBaseAdminUpgradeabilityProxy, ZosInitializableUpgradeabilityProxy {\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 ZosInitializableUpgradeabilityProxy.initialize(_logic, _data);\n assert(ADMIN_SLOT == keccak256(\"org.zeppelinos.proxy.admin\"));\n _setAdmin(_admin);\n }\n\n /**\n * @dev Only fall back when the sender is not the admin.\n */\n function _willFallback() internal override {\n require(msg.sender != _admin(), \"Cannot call fallback function from the proxy admin\");\n super._willFallback();\n }\n}\n",
"sourcePath": "contracts/mocks/zos/ZosInitializableAdminUpgradeabilityProxy.sol",
"sourceMap": "346:1236:30:-:0;;;;;;;;;;;;;;;;;;;;;;",
"deployedSourceMap": "346:1236:30:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;514:50:39;548:11;:9;:11;;:::i;:::-;514:50;346:1236:30;;459:51:39;494:11;:9;:11;;:::i;:::-;459:51;346:1236:30;2238:103:28;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2858:221;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1558:96;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1830:224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1044:295:30;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;863:348:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1416:78:28;;;;;;;;;;;;;:::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:28:-;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;1044:295:30:-;1174:1;1145:31;;:17;:15;:17;;:::i;:::-;:31;;;1137:40;;;;;;;;1183:61;1230:6;1238:5;1183:46;:61;;:::i;:::-;1271:39;;;;;;;;;;;;;;;;;;;;;1257:53;;;994:66:28;1257:10:30;;:53;;;;1250:61;;;;;;1317:17;1327:6;1317:9;:17;;:::i;:::-;1044:295;;;;:::o;863:348:31:-;977:1;948:31;;:17;:15;:17;;:::i;:::-;:31;;;940:40;;;;;;;;1016:48;;;;;;;;;;;;;;;;;;;993:71;;;826:66:29;993:19:31;;:71;;;;986:79;;;;;;1071:26;1090:6;1071:18;:26;;:::i;:::-;1121:1;1106:5;:12;:16;1103:104;;;1133:12;1150:6;:19;;1170:5;1150:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1132:44;;;1192:7;1184:16;;;;;;;;1103:104;;863:348;;;:::o;1416:78:28:-;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;1414:166:30:-;1485:8;:6;:8;;:::i;:::-;1471:22;;:10;:22;;;;1463:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1554:21;:19;:21;;:::i;:::-;1414:166;:::o;1011:165:29:-;1070:12;1090;826:66;1105:19;;1090:34;;1161:4;1155:11;1147:19;;1139: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:28:-;3169:11;3188:12;994:66;3203:10;;3188:25;;3249:4;3243:11;3236:18;;3228:32;;;:::o;1311:142:29:-;1373:37;1392:17;1373:18;:37;;:::i;:::-;1430:17;1421:27;;;;;;;;;;;;1311:142;;:::o;3380:133:28:-;3432:12;994:66;3447:10;;3432:25;;3494:8;3488:4;3481:22;3473:36;;;:::o;1590:305:29:-;1668:57;1707:17;1668:38;:57;;:::i;:::-;1660:129;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1796:12;826:66;1811:19;;1796:34;;1867:17;1861:4;1854:31;1846: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/mocks/zos/ZosInitializableAdminUpgradeabilityProxy.sol",
"exportedSymbols": {
"ZosInitializableAdminUpgradeabilityProxy": [
5563
]
},
"id": 5564,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 5495,
"literals": [
"solidity",
"^",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:30"
},
{
"absolutePath": "contracts/mocks/zos/ZosBaseAdminUpgradeabilityProxy.sol",
"file": "./ZosBaseAdminUpgradeabilityProxy.sol",
"id": 5496,
"nodeType": "ImportDirective",
"scope": 5564,
"sourceUnit": 5429,
"src": "57:47:30",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "contracts/mocks/zos/ZosInitializableUpgradeabilityProxy.sol",
"file": "./ZosInitializableUpgradeabilityProxy.sol",
"id": 5497,
"nodeType": "ImportDirective",
"scope": 5564,
"sourceUnit": 5619,
"src": "105:51:30",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 5499,
"name": "ZosBaseAdminUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5428,
"src": "399:31:30",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ZosBaseAdminUpgradeabilityProxy_$5428",
"typeString": "contract ZosBaseAdminUpgradeabilityProxy"
}
},
"id": 5500,
"nodeType": "InheritanceSpecifier",
"src": "399:31:30"
},
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 5501,
"name": "ZosInitializableUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5618,
"src": "432:35:30",
"typeDescriptions": {
"typeIdentifier": "t_contract$_ZosInitializableUpgradeabilityProxy_$5618",
"typeString": "contract ZosInitializableUpgradeabilityProxy"
}
},
"id": 5502,
"nodeType": "InheritanceSpecifier",
"src": "432:35:30"
}
],
"contractDependencies": [
5428,
5493,
5618,
6257
],
"contractKind": "contract",
"documentation": {
"id": 5498,
"nodeType": "StructuredDocumentation",
"src": "158:187:30",
"text": " @title InitializableAdminUpgradeabilityProxy\n @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for\n initializing the implementation, admin, and init data."
},
"fullyImplemented": true,
"id": 5563,
"linearizedBaseContracts": [
5563,
5618,
5428,
5493,
6257
],
"name": "ZosInitializableAdminUpgradeabilityProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 5541,
"nodeType": "Block",
"src": "1131:208:30",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 5519,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 5513,
"name": "_implementation",
"nodeType": "Identifier",
"overloadedDeclarations": [
5457
],
"referencedDeclaration": 5457,
"src": "1145:15:30",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 5514,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1145:17:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 5517,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1174:1:30",
"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": 5516,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1166:7:30",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 5515,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1166:7:30",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 5518,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1166:10:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"src": "1145:31:30",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 5512,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1137:7:30",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 5520,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1137:40:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5521,
"nodeType": "ExpressionStatement",
"src": "1137:40:30"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 5525,
"name": "_logic",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5505,
"src": "1230:6:30",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 5526,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5509,
"src": "1238:5:30",
"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": 5522,
"name": "ZosInitializableUpgradeabilityProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5618,
"src": "1183:35:30",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_ZosInitializableUpgradeabilityProxy_$5618_$",
"typeString": "type(contract ZosInitializableUpgradeabilityProxy)"
}
},
"id": 5524,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "initialize",
"nodeType": "MemberAccess",
"referencedDeclaration": 5617,
"src": "1183:46:30",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$_t_bytes_memory_ptr_$returns$__$",
"typeString": "function (address,bytes memory)"
}
},
"id": 5527,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1183:61:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5528,
"nodeType": "ExpressionStatement",
"src": "1183:61:30"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 5534,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 5530,
"name": "ADMIN_SLOT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5295,
"src": "1257:10:30",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "6f72672e7a657070656c696e6f732e70726f78792e61646d696e",
"id": 5532,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1281:28:30",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b",
"typeString": "literal_string \"org.zeppelinos.proxy.admin\""
},
"value": "org.zeppelinos.proxy.admin"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b",
"typeString": "literal_string \"org.zeppelinos.proxy.admin\""
}
],
"id": 5531,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -8,
"src": "1271:9:30",
"typeDescriptions": {
"typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$",
"typeString": "function (bytes memory) pure returns (bytes32)"
}
},
"id": 5533,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1271:39:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1257:53:30",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 5529,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -3,
"src": "1250:6:30",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 5535,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1250:61:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5536,
"nodeType": "ExpressionStatement",
"src": "1250:61:30"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 5538,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5507,
"src": "1327:6:30",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 5537,
"name": "_setAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5427,
"src": "1317:9:30",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 5539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1317:17:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5540,
"nodeType": "ExpressionStatement",
"src": "1317:17:30"
}
]
},
"documentation": {
"id": 5503,
"nodeType": "StructuredDocumentation",
"src": "472:569:30",
"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": 5542,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "initialize",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 5510,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5505,
"mutability": "mutable",
"name": "_logic",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 5542,
"src": "1064:14:30",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5504,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1064:7:30",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5507,
"mutability": "mutable",
"name": "_admin",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 5542,
"src": "1080:14:30",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 5506,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1080:7:30",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 5509,
"mutability": "mutable",
"name": "_data",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 5542,
"src": "1096:18:30",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 5508,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1096:5:30",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1063:52:30"
},
"returnParameters": {
"id": 5511,
"nodeType": "ParameterList",
"parameters": [],
"src": "1131:0:30"
},
"scope": 5563,
"src": "1044:295:30",
"stateMutability": "payable",
"virtual": false,
"visibility": "public"
},
{
"baseFunctions": [
6243
],
"body": {
"id": 5561,
"nodeType": "Block",
"src": "1457:123:30",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 5552,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 5548,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -15,
"src": "1471:3:30",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 5549,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1471:10:30",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 5550,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 5415,
"src": "1485:6:30",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 5551,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1485:8:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1471:22:30",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e",
"id": 5553,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1495:52:30",
"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": 5547,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1463:7:30",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 5554,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1463:85:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5555,
"nodeType": "ExpressionStatement",
"src": "1463:85:30"
},
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"expression": {
"argumentTypes": null,
"id": 5556,
"name": "super",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -25,
"src": "1554:5:30",
"typeDescriptions": {
"typeIdentifier": "t_super$_ZosInitializableAdminUpgradeabilityProxy_$5563",
"typeString": "contract super ZosInitializableAdminUpgradeabilityProxy"
}
},
"id": 5558,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "_willFallback",
"nodeType": "MemberAccess",
"referencedDeclaration": 6243,
"src": "1554:19:30",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 5559,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1554:21:30",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 5560,
"nodeType": "ExpressionStatement",
"src": "1554:21:30"
}
]
},
"documentation": {
"id": 5543,
"nodeType": "StructuredDocumentation",
"src": "1343:68:30",
"text": " @dev Only fall back when the sender is not the admin."
},
"id": 5562,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_willFallback",
"nodeType": "FunctionDefinition",
"overrides": {
"id": 5545,
"nodeType": "OverrideSpecifier",
"overrides": [],
"src": "1448:8:30"
},
"parameters": {
"id": 5544,
"nodeType": "ParameterList",
"parameters": [],
"src": "1436:2:30"
},
"returnParameters": {
"id": 5546,
"nodeType": "ParameterList",
"parameters": [],
"src": "1457:0:30"
},
"scope": 5563,
"src": "1414:166:30",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
}
],
"scope": 5564,
"src": "346:1236:30"
}
],
"src": "0:1583:30"
},
"bytecode": "0x60806040523480156100115760006000fd5b50610017565b610e3c806100266000396000f3fe6080604052600436106100745760003560e01c80638f2839701161004e5780638f283970146101e7578063cf7a1d771461023a578063d1f578941461033d578063f851a440146104205761008b565b80633659cfe61461009d5780634f1ef286146100f05780635c60da1b1461018f5761008b565b3661008b575b61008861047863ffffffff16565b5b005b5b61009a61047863ffffffff16565b5b005b3480156100aa5760006000fd5b506100ee600480360360208110156100c25760006000fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506104a5565b005b61018d600480360360408110156101075760006000fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156101455760006000fd5b8201836020820111156101585760006000fd5b8035906020019184600183028401116401000000008311171561017b5760006000fd5b9091929390909192939050505061050e565b005b34801561019c5760006000fd5b506101a56105fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f45760006000fd5b506102386004803603602081101561020c5760006000fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061066b565b005b61033b600480360360608110156102515760006000fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156102af5760006000fd5b8201836020820111156102c25760006000fd5b803590602001918460018302840111640100000000831117156102e55760006000fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050909091929090919290505050610800565b005b61041e600480360360408110156103545760006000fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156103925760006000fd5b8201836020820111156103a55760006000fd5b803590602001918460018302840111640100000000831117156103c85760006000fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509090919290909192905050506108dc565b005b34801561042d5760006000fd5b50610436610a59565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610486610ac963ffffffff16565b6104a2610497610b6e63ffffffff16565b610ba163ffffffff16565b5b565b6104b3610bd463ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156104fb576104f581610c0763ffffffff16565b5b61050a565b61050961047863ffffffff16565b5b5b50565b61051c610bd463ffffffff16565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156105e65761055e83610c0763ffffffff16565b60008373ffffffffffffffffffffffffffffffffffffffff1683836