UNPKG

@daostack/upgrades

Version:
1,125 lines (1,124 loc) 119 kB
{ "fileName": "DeprecatedAdminUpgradeabilityProxy.sol", "contractName": "DeprecatedAdminUpgradeabilityProxy", "source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\nimport '../upgradeability/UpgradeabilityProxy.sol';\n\n/**\n * @title AdminUpgradeabilityProxy\n * @dev This contract combines an upgradeability proxy with an authorization\n * mechanism for administrative tasks.\n * All external functions in this contract must be guarded by the\n * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity\n * feature proposal that would enable this to be done automatically.\n */\ncontract DeprecatedAdminUpgradeabilityProxy is UpgradeabilityProxy {\n /**\n * @dev Emitted when the administration has been transferred.\n * @param previousAdmin Address of the previous admin.\n * @param newAdmin Address of the new admin.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"org.zeppelinos.proxy.admin\", and is\n * validated in the constructor.\n */\n bytes32 private constant ADMIN_SLOT = 0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b;\n\n /**\n * @dev Modifier to check whether the `msg.sender` is the admin.\n * If it is, it will run the function. Otherwise, it will delegate the call\n * to the implementation.\n */\n modifier ifAdmin() {\n if (msg.sender == _admin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * Contract constructor.\n * It sets the `msg.sender` as the proxy administrator.\n * @param _implementation address of the initial implementation.\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 constructor(address _implementation, bytes memory _data) UpgradeabilityProxy(_implementation, _data) public payable {\n assert(ADMIN_SLOT == keccak256(\"org.zeppelinos.proxy.admin\"));\n\n _setAdmin(msg.sender);\n }\n\n /**\n * @return The address of the proxy admin.\n */\n function admin() external view returns (address) {\n return _admin();\n }\n\n /**\n * @return The address of the implementation.\n */\n function implementation() external ifAdmin returns (address) {\n return _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n * Only the current admin can call this function.\n * @param newAdmin Address to transfer proxy administration to.\n */\n function changeAdmin(address newAdmin) external ifAdmin {\n require(newAdmin != address(0), \"Cannot change the admin of a proxy to the zero address\");\n emit AdminChanged(_admin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the backing implementation of the proxy.\n * Only the admin can call this function.\n * @param newImplementation Address of the new implementation.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeTo(newImplementation);\n }\n\n /**\n * @dev Upgrade the backing implementation of the proxy and call a function\n * on the new implementation.\n * This is useful to initialize the proxied contract.\n * @param newImplementation Address of the new implementation.\n * @param data Data to send as msg.data in the low level call.\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 */\n function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {\n _upgradeTo(newImplementation);\n (bool success,) = newImplementation.delegatecall(data);\n require(success);\n }\n\n /**\n * @return adm The admin slot.\n */\n function _admin() internal view returns (address adm) {\n bytes32 slot = ADMIN_SLOT;\n assembly {\n adm := sload(slot)\n }\n }\n\n /**\n * @dev Sets the address of the proxy admin.\n * @param newAdmin Address of the new proxy admin.\n */\n function _setAdmin(address newAdmin) internal {\n bytes32 slot = ADMIN_SLOT;\n\n assembly {\n sstore(slot, newAdmin)\n }\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/DeprecatedAdminUpgradeabilityProxy.sol", "sourceMap": "469:4091:7:-:0;;;1946:216;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2023:15;2040:5;827:309:42;987:1;942:41;;;;;;;;;;;;;;;;;;;;;934:50;;:54;926:63;;903:86;;;810:66:36;903:19:42;;:86;;;;896:94;;;;;;996:26;1015:6;996:18;;;:26;;:::i;:::-;1046:1;1031:5;:12;:16;1028:104;;;1058:12;1075:6;:19;;1095:5;1075:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1057:44;;;1117:7;1109:16;;;;;;;;1028:104;;827:309;;;2089:39:7::1;;;;;;;;;;;;;;;;;;;;;2075:53;;;997:66;2075:10;;:53;;;;2068:61;;;;;;2136:21;2146:10;2136:9;;;:21;;:::i;:::-;1946:216;::::0;;469:4091;;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;4184:133:7:-;4236:12;997:66;4251:10;;4236:25;;4298:8;4292:4;4285:22;4277:36;;;:::o;956:616:43:-;1016:4;1032:12;1531:7;1519:20;1511:28;;1564:1;1557:4;:8;1550:15;;;;;956:616;;;;;:::o;469:4091:7:-;;;;;;;", "deployedSourceMap": "469:4091:7:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;514:50:39;548:11;:9;:11;;:::i;:::-;514:50;469:4091:7;;459:51:39;494:11;:9;:11;;:::i;:::-;459:51;469:4091:7;3042:103;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;3662:221;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2362:96;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2634:224;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2223:75;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2075:90:39;2111:15;:13;:15;;:::i;:::-;2132:28;2142:17;:15;:17;;:::i;:::-;2132:9;:28;;:::i;:::-;2075:90;:::o;3042:103:7:-;1296:8;:6;:8;;:::i;:::-;1282:22;;:10;:22;;;1278:76;;;3111:29:::1;3122:17;3111:10;:29;;:::i;:::-;1314:1;1278:76:::0;;;1336:11;:9;:11;;:::i;:::-;1278:76;3042:103;;:::o;3662:221::-;1296:8;:6;:8;;:::i;:::-;1282:22;;:10;:22;;;1278:76;;;3767:29:::1;3778:17;3767:10;:29;;:::i;:::-;3803:12;3820:17;:30;;3851:4;;3820:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3802:54;;;3870:7;3862:16;;;;;;;;1314:1;;1278:76:::0;;;1336:11;:9;:11;;:::i;:::-;1278:76;3662:221;;;;:::o;2362:96::-;2414:7;1296:8;:6;:8;;:::i;:::-;1282:22;;:10;:22;;;1278:76;;;2436:17:::1;:15;:17;;:::i;:::-;2429:24;;;;1314:1;1278:76:::0;;;1336:11;:9;:11;;:::i;:::-;1278:76;2362:96;;:::o;2634:224::-;1296:8;:6;:8;;:::i;:::-;1282:22;;:10;:22;;;1278:76;;;2724:1:::1;2704:22;;:8;:22;;;;2696:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2796:32;2809:8;:6;:8;;:::i;:::-;2819;2796:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2834:19;2844:8;2834:9;:19;;:::i;:::-;1314:1;1278:76:::0;;;1336:11;:9;:11;;:::i;:::-;1278:76;2634:224;;:::o;2223:75::-;2263:7;2285:8;:6;:8;;:::i;:::-;2278:15;;;;2223:75;;:::o;956:616:43:-;1016:4;1032:12;1531:7;1519:20;1511:28;;1564:1;1557:4;:8;1550:15;;;;;956:616;;;;;:::o;4392:166:7:-;4463:8;:6;:8;;:::i;:::-;4449:22;;:10;:22;;;;4441:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4532:21;:19;:21;;:::i;:::-;4392:166;:::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;3932:136:7:-;3973:11;3992:12;997:66;4007:10;;3992:25;;4053:4;4047:11;4040:18;;4032:32;;;:::o;1295:142:36:-;1357:37;1376:17;1357:18;:37;;:::i;:::-;1414:17;1405:27;;;;;;;;;;;;1295:142;;:::o;4184:133:7:-;4236:12;997:66;4251:10;;4236:25;;4298:8;4292:4;4285:22;4277:36;;;:::o;1933:47:39:-;;:::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", "abi": [ { "inputs": [ { "internalType": "address", "name": "_implementation", "type": "address" }, { "internalType": "bytes", "name": "_data", "type": "bytes" } ], "stateMutability": "payable", "type": "constructor" }, { "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": "view", "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": "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/DeprecatedAdminUpgradeabilityProxy.sol", "exportedSymbols": { "DeprecatedAdminUpgradeabilityProxy": [ 1151 ] }, "id": 1152, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 959, "literals": [ "solidity", "^", "0.6", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:7" }, { "absolutePath": "contracts/upgradeability/UpgradeabilityProxy.sol", "file": "../upgradeability/UpgradeabilityProxy.sol", "id": 960, "nodeType": "ImportDirective", "scope": 1152, "sourceUnit": 6754, "src": "57:51:7", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 962, "name": "UpgradeabilityProxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 6753, "src": "516:19:7", "typeDescriptions": { "typeIdentifier": "t_contract$_UpgradeabilityProxy_$6753", "typeString": "contract UpgradeabilityProxy" } }, "id": 963, "nodeType": "InheritanceSpecifier", "src": "516:19:7" } ], "contractDependencies": [ 6064, 6257, 6753 ], "contractKind": "contract", "documentation": { "id": 961, "nodeType": "StructuredDocumentation", "src": "110:358:7", "text": " @title AdminUpgradeabilityProxy\n @dev This contract combines an upgradeability proxy with an authorization\n mechanism for administrative tasks.\n All external functions in this contract must be guarded by the\n `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity\n feature proposal that would enable this to be done automatically." }, "fullyImplemented": true, "id": 1151, "linearizedBaseContracts": [ 1151, 6753, 6064, 6257 ], "name": "DeprecatedAdminUpgradeabilityProxy", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": { "id": 964, "nodeType": "StructuredDocumentation", "src": "540:177:7", "text": " @dev Emitted when the administration has been transferred.\n @param previousAdmin Address of the previous admin.\n @param newAdmin Address of the new admin." }, "id": 970, "name": "AdminChanged", "nodeType": "EventDefinition", "parameters": { "id": 969, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 966, "indexed": false, "mutability": "mutable", "name": "previousAdmin", "nodeType": "VariableDeclaration", "overrides": null, "scope": 970, "src": "739:21:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 965, "name": "address", "nodeType": "ElementaryTypeName", "src": "739:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 968, "indexed": false, "mutability": "mutable", "name": "newAdmin", "nodeType": "VariableDeclaration", "overrides": null, "scope": 970, "src": "762:16:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 967, "name": "address", "nodeType": "ElementaryTypeName", "src": "762:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "738:41:7" }, "src": "720:60:7" }, { "constant": true, "documentation": { "id": 971, "nodeType": "StructuredDocumentation", "src": "784:172:7", "text": " @dev Storage slot with the admin of the contract.\n This is the keccak-256 hash of \"org.zeppelinos.proxy.admin\", and is\n validated in the constructor." }, "id": 974, "mutability": "constant", "name": "ADMIN_SLOT", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1151, "src": "959:104:7", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 972, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "959:7:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "307831306436613534613437353463383836396436383836623566356437666266613562343532323233376561356336306431316263346537613166663933393062", "id": 973, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "997:66:7", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_7616251639890160809447714111544359812065171195189364993079081710756264753419_by_1", "typeString": "int_const 7616...(68 digits omitted)...3419" }, "value": "0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b" }, "visibility": "private" }, { "body": { "id": 989, "nodeType": "Block", "src": "1272:86:7", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 981, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 977, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "1282:3:7", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 978, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1282:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 979, "name": "_admin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1118, "src": "1296:6:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 980, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1296:8:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1282:22:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 987, "nodeType": "Block", "src": "1328:26:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 984, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6256, "src": "1336:9:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 985, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1336:11:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 986, "nodeType": "ExpressionStatement", "src": "1336:11:7" } ] }, "id": 988, "nodeType": "IfStatement", "src": "1278:76:7", "trueBody": { "id": 983, "nodeType": "Block", "src": "1306:16:7", "statements": [ { "id": 982, "nodeType": "PlaceholderStatement", "src": "1314:1:7" } ] } } ] }, "documentation": { "id": 975, "nodeType": "StructuredDocumentation", "src": "1068:182:7", "text": " @dev Modifier to check whether the `msg.sender` is the admin.\n If it is, it will run the function. Otherwise, it will delegate the call\n to the implementation." }, "id": 990, "name": "ifAdmin", "nodeType": "ModifierDefinition", "overrides": null, "parameters": { "id": 976, "nodeType": "ParameterList", "parameters": [], "src": "1269:2:7" }, "src": "1253:105:7", "virtual": false, "visibility": "internal" }, { "body": { "id": 1015, "nodeType": "Block", "src": "2062:100:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "id": 1007, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1003, "name": "ADMIN_SLOT", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 974, "src": "2075:10:7", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "6f72672e7a657070656c696e6f732e70726f78792e61646d696e", "id": 1005, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2099:28:7", "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": 1004, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -8, "src": "2089:9:7", "typeDescriptions": { "typeIdentifier": "t_function_keccak256_pure$_t_bytes_memory_ptr_$returns$_t_bytes32_$", "typeString": "function (bytes memory) pure returns (bytes32)" } }, "id": 1006, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2089:39:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "2075:53:7", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 1002, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -3, "src": "2068:6:7", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 1008, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2068:61:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1009, "nodeType": "ExpressionStatement", "src": "2068:61:7" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1011, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "2146:3:7", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1012, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2146:10:7", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1010, "name": "_setAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1130, "src": "2136:9:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1013, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2136:21:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1014, "nodeType": "ExpressionStatement", "src": "2136:21:7" } ] }, "documentation": { "id": 991, "nodeType": "StructuredDocumentation", "src": "1362:581:7", "text": " Contract constructor.\n It sets the `msg.sender` as the proxy administrator.\n @param _implementation address of the initial implementation.\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." }, "id": 1016, "implemented": true, "kind": "constructor", "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 998, "name": "_implementation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 993, "src": "2023:15:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 999, "name": "_data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 995, "src": "2040:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "id": 1000, "modifierName": { "argumentTypes": null, "id": 997, "name": "UpgradeabilityProxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6753, "src": "2003:19:7", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_UpgradeabilityProxy_$6753_$", "typeString": "type(contract UpgradeabilityProxy)" } }, "nodeType": "ModifierInvocation", "src": "2003:43:7" } ], "name": "", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 996, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 993, "mutability": "mutable", "name": "_implementation", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1016, "src": "1958:23:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 992, "name": "address", "nodeType": "ElementaryTypeName", "src": "1958:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 995, "mutability": "mutable", "name": "_data", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1016, "src": "1983:18:7", "stateVariable": false, "storageLocation": "memory", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 994, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1983:5:7", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1957:45:7" }, "returnParameters": { "id": 1001, "nodeType": "ParameterList", "parameters": [], "src": "2062:0:7" }, "scope": 1151, "src": "1946:216:7", "stateMutability": "payable", "virtual": false, "visibility": "public" }, { "body": { "id": 1025, "nodeType": "Block", "src": "2272:26:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 1022, "name": "_admin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1118, "src": "2285:6:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 1023, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2285:8:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1021, "id": 1024, "nodeType": "Return", "src": "2278:15:7" } ] }, "documentation": { "id": 1017, "nodeType": "StructuredDocumentation", "src": "2166:54:7", "text": " @return The address of the proxy admin." }, "functionSelector": "f851a440", "id": 1026, "implemented": true, "kind": "function", "modifiers": [], "name": "admin", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1018, "nodeType": "ParameterList", "parameters": [], "src": "2237:2:7" }, "returnParameters": { "id": 1021, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1020, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1026, "src": "2263:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1019, "name": "address", "nodeType": "ElementaryTypeName", "src": "2263:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2262:9:7" }, "scope": 1151, "src": "2223:75:7", "stateMutability": "view", "virtual": false, "visibility": "external" }, { "body": { "id": 1037, "nodeType": "Block", "src": "2423:35:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 1034, "name": "_implementation", "nodeType": "Identifier", "overloadedDeclarations": [ 6028 ], "referencedDeclaration": 6028, "src": "2436:15:7", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 1035, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2436:17:7", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 1033, "id": 1036, "nodeType": "Return", "src": "2429:24:7" } ] }, "documentation": { "id": 1027, "nodeType": "StructuredDocumentation", "src": "2302:57:7", "text": " @return The address of the implementation." }, "functionSelector": "5c60da1b", "id": 1038, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 1030, "modifierName": { "argumentTypes": null, "id": 1029, "name": "ifAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 990, "src": "2397:7:7", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2397:7:7" } ], "name": "implementation", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 1028, "nodeType": "ParameterList", "parameters": [], "src": "2385:2:7" }, "returnParameters": { "id": 1033, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1032, "mutability": "mutable", "name": "", "nodeType": "VariableDeclaration", "overrides": null, "scope": 1038, "src": "2414:7:7", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1031, "name": "address", "nodeType": "ElementaryTypeName", "src": "2414:7:7", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2413:9:7" }, "scope": 1151, "src": "2362:96:7", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 1066, "nodeType": "Block", "src": "2690:168:7", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 1052, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 1047, "name": "newAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1041, "src": "2704:8:7", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }