@daostack/upgrades
Version:
Proxy upgadable contracts based on openzeppelin-sdk
1,171 lines (1,170 loc) • 89.7 kB
JSON
{
"fileName": "ProxyAdmin.sol",
"contractName": "ProxyAdmin",
"source": "pragma solidity ^0.6.0;\n// SPDX-License-Identifier: MIT\n\nimport \"../ownership/Ownable.sol\";\nimport \"./AdminUpgradeabilityProxy.sol\";\n\n/**\n * @title ProxyAdmin\n * @dev This contract is the admin of a proxy, and is in charge\n * of upgrading it as well as transferring it to another admin.\n */\ncontract ProxyAdmin is OpenZeppelinUpgradesOwnable {\n\n /**\n * @dev Returns the current implementation of a proxy.\n * This is needed because only the proxy admin can query it.\n * @return The address of the current implementation of the proxy.\n */\n function getProxyImplementation(AdminUpgradeabilityProxy proxy) public view returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"implementation()\")) == 0x5c60da1b\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"5c60da1b\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Returns the admin of a proxy. Only the admin can query it.\n * @return The address of the current admin of the proxy.\n */\n function getProxyAdmin(AdminUpgradeabilityProxy proxy) public view returns (address) {\n // We need to manually run the static call since the getter cannot be flagged as view\n // bytes4(keccak256(\"admin()\")) == 0xf851a440\n (bool success, bytes memory returndata) = address(proxy).staticcall(hex\"f851a440\");\n require(success);\n return abi.decode(returndata, (address));\n }\n\n /**\n * @dev Changes the admin of a proxy.\n * @param proxy Proxy to change admin.\n * @param newAdmin Address to transfer proxy administration to.\n */\n function changeProxyAdmin(AdminUpgradeabilityProxy proxy, address newAdmin) public onlyOwner {\n proxy.changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrades a proxy to the newest implementation of a contract.\n * @param proxy Proxy to be upgraded.\n * @param implementation the address of the Implementation.\n */\n function upgrade(AdminUpgradeabilityProxy proxy, address implementation) public onlyOwner {\n proxy.upgradeTo(implementation);\n }\n\n /**\n * @dev Upgrades a proxy to the newest implementation of a contract and forwards a function call to it.\n * This is useful to initialize the proxied contract.\n * @param proxy Proxy to be upgraded.\n * @param implementation Address of the 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 upgradeAndCall(AdminUpgradeabilityProxy proxy, address implementation, bytes memory data) payable public onlyOwner {\n proxy.upgradeToAndCall{value: msg.value}(implementation, data);\n }\n}\n",
"sourcePath": "contracts/upgradeability/ProxyAdmin.sol",
"sourceMap": "291:2552:40:-:0;;;;;;;;;;;;;978:115:33;1021:10;1012:6;;:19;;;;;;;;;;;;;;;;;;1079:6;;;;;;;;;;;1046:40;;1075:1;1046:40;;;;;;;;;;;;978:115;291:2552:40;;;;;;;;;",
"deployedSourceMap": "291:2552:40:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;548:404;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1844:137:33;;;;;;;;;;;;;:::i;:::-;;1646:131:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1156:77:33;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1476:90;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2644:197:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1966:132;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2152:107:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;1097:386:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;548:404;633:7;798:12;812:23;847:5;839:25;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;797:82;;;;893:7;885:16;;;;;;;;925:10;914:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;907:40;;;;;;548:404;;;;;;:::o;1844:137:33:-;1360:9;:7;:9;;:::i;:::-;1352:18;;;;;;;;1942:1:::1;1905:40;;1926:6;;;;;;;;;;;1905:40;;;;;;;;;;;;1972:1;1955:6;;:19;;;;;;;;;;;;;;;;;;1380:1;1844:137:::0;:::o;1646:131:40:-;1360:9:33;:7;:9;;:::i;:::-;1352:18;;;;;;;;1745:5:40::1;:17;;;1763:8;1745:27;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1380:1:33;1646:131:40::0;;;:::o;1156:77:33:-;1194:7;1220:6;;;;;;;;;;;1213:13;;;;1156:77;;:::o;1476:90::-;1516:4;1553:6;;;;;;;;;;;1539:20;;:10;:20;;;1532:27;;;;1476:90;;:::o;2644:197:40:-;1360:9:33;:7;:9;;:::i;:::-;1352:18;;;;;;;;2774:5:40::1;:22;;;2804:9;2815:14;2831:4;2774:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1380:1:33;2644:197:40::0;;;;:::o;1966:132::-;1360:9:33;:7;:9;;:::i;:::-;1352:18;;;;;;;;2062:5:40::1;:15;;;2078:14;2062:31;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1380:1:33;1966:132:40::0;;;:::o;2152:107:33:-;1360:9;:7;:9;;:::i;:::-;1352:18;;;;;;;;2224:28:::1;2243:8;2224:18;:28;;:::i;:::-;1380:1;2152:107:::0;;:::o;1097:386:40:-;1173:7;1329:12;1343:23;1378:5;1370:25;;:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1328:82;;;;1424:7;1416:16;;;;;;;;1456:10;1445:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1438:40;;;;;;1097:386;;;;;;:::o;2403:183:33:-;2496:1;2476:22;;:8;:22;;;;2468:31;;;;;;;;2543:8;2514:38;;2535:6;;;;;;;;;;;2514:38;;;;;;;;;;;;2571:8;2562:6;;:17;;;;;;;;;;;;;;;;;;2403:183;;:::o",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [
{
"internalType": "contract AdminUpgradeabilityProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeProxyAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract AdminUpgradeabilityProxy",
"name": "proxy",
"type": "address"
}
],
"name": "getProxyAdmin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract AdminUpgradeabilityProxy",
"name": "proxy",
"type": "address"
}
],
"name": "getProxyImplementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isOwner",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract AdminUpgradeabilityProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "upgrade",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract AdminUpgradeabilityProxy",
"name": "proxy",
"type": "address"
},
{
"internalType": "address",
"name": "implementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
],
"ast": {
"absolutePath": "contracts/upgradeability/ProxyAdmin.sol",
"exportedSymbols": {
"ProxyAdmin": [
6388
]
},
"id": 6389,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6259,
"literals": [
"solidity",
"^",
"0.6",
".0"
],
"nodeType": "PragmaDirective",
"src": "0:23:40"
},
{
"absolutePath": "contracts/ownership/Ownable.sol",
"file": "../ownership/Ownable.sol",
"id": 6260,
"nodeType": "ImportDirective",
"scope": 6389,
"sourceUnit": 5785,
"src": "57:34:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "contracts/upgradeability/AdminUpgradeabilityProxy.sol",
"file": "./AdminUpgradeabilityProxy.sol",
"id": 6261,
"nodeType": "ImportDirective",
"scope": 6389,
"sourceUnit": 5850,
"src": "92:40:40",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 6263,
"name": "OpenZeppelinUpgradesOwnable",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5784,
"src": "314:27:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_OpenZeppelinUpgradesOwnable_$5784",
"typeString": "contract OpenZeppelinUpgradesOwnable"
}
},
"id": 6264,
"nodeType": "InheritanceSpecifier",
"src": "314:27:40"
}
],
"contractDependencies": [
5784
],
"contractKind": "contract",
"documentation": {
"id": 6262,
"nodeType": "StructuredDocumentation",
"src": "134:156:40",
"text": " @title ProxyAdmin\n @dev This contract is the admin of a proxy, and is in charge\n of upgrading it as well as transferring it to another admin."
},
"fullyImplemented": true,
"id": 6388,
"linearizedBaseContracts": [
6388,
5784
],
"name": "ProxyAdmin",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 6296,
"nodeType": "Block",
"src": "642:310:40",
"statements": [
{
"assignments": [
6273,
6275
],
"declarations": [
{
"constant": false,
"id": 6273,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6296,
"src": "798:12:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6272,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "798:4:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6275,
"mutability": "mutable",
"name": "returndata",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6296,
"src": "812:23:40",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6274,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "812:5:40",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 6283,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "5c60da1b",
"id": 6281,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "865:13:40",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_96a4c6be7716f5be15d118c16bd1d464cb27f01187d0b9218993a5d488a47c29",
"typeString": "literal_string (contains invalid UTF-8 sequence at position 4)"
},
"value": null
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_96a4c6be7716f5be15d118c16bd1d464cb27f01187d0b9218993a5d488a47c29",
"typeString": "literal_string (contains invalid UTF-8 sequence at position 4)"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6278,
"name": "proxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6267,
"src": "847:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
],
"id": 6277,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "839:7:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6276,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "839:7:40",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6279,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "839:14:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 6280,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "839:25:40",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 6282,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "839:40:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "797:82:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6285,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6273,
"src": "893:7:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 6284,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "885:7:40",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 6286,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "885:16:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6287,
"nodeType": "ExpressionStatement",
"src": "885:16:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6290,
"name": "returndata",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6275,
"src": "925:10:40",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 6292,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "938:7:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6291,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "938:7:40",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 6293,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "937:9:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
}
],
"expression": {
"argumentTypes": null,
"id": 6288,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "914:3:40",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 6289,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "914:10:40",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 6294,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "914:33:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"functionReturnParameters": 6271,
"id": 6295,
"nodeType": "Return",
"src": "907:40:40"
}
]
},
"documentation": {
"id": 6265,
"nodeType": "StructuredDocumentation",
"src": "347:198:40",
"text": " @dev Returns the current implementation of a proxy.\n This is needed because only the proxy admin can query it.\n @return The address of the current implementation of the proxy."
},
"functionSelector": "204e1c7a",
"id": 6297,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getProxyImplementation",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 6268,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6267,
"mutability": "mutable",
"name": "proxy",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6297,
"src": "580:30:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
},
"typeName": {
"contractScope": null,
"id": 6266,
"name": "AdminUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5849,
"src": "580:24:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "579:32:40"
},
"returnParameters": {
"id": 6271,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6270,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6297,
"src": "633:7:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6269,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "633:7:40",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "632:9:40"
},
"scope": 6388,
"src": "548:404:40",
"stateMutability": "view",
"virtual": false,
"visibility": "public"
},
{
"body": {
"id": 6329,
"nodeType": "Block",
"src": "1182:301:40",
"statements": [
{
"assignments": [
6306,
6308
],
"declarations": [
{
"constant": false,
"id": 6306,
"mutability": "mutable",
"name": "success",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6329,
"src": "1329:12:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6305,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1329:4:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6308,
"mutability": "mutable",
"name": "returndata",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6329,
"src": "1343:23:40",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 6307,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1343:5:40",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 6316,
"initialValue": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "f851a440",
"id": 6314,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1396:13:40",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_cb23cf6c353ccb16f0d92c8e6b5c5b425654e65dd07e2d295b394de4cf15afb7",
"typeString": "literal_string (contains invalid UTF-8 sequence at position 0)"
},
"value": null
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_cb23cf6c353ccb16f0d92c8e6b5c5b425654e65dd07e2d295b394de4cf15afb7",
"typeString": "literal_string (contains invalid UTF-8 sequence at position 0)"
}
],
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6311,
"name": "proxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6300,
"src": "1378:5:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
],
"id": 6310,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1370:7:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6309,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1370:7:40",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
},
"id": 6312,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1370:14:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"id": 6313,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "staticcall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1370:25:40",
"typeDescriptions": {
"typeIdentifier": "t_function_barestaticcall_view$_t_bytes_memory_ptr_$returns$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "function (bytes memory) view returns (bool,bytes memory)"
}
},
"id": 6315,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1370:40:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$_t_bool_$_t_bytes_memory_ptr_$",
"typeString": "tuple(bool,bytes memory)"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1328:82:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6318,
"name": "success",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6306,
"src": "1424:7:40",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 6317,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
-18,
-18
],
"referencedDeclaration": -18,
"src": "1416:7:40",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 6319,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1416:16:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6320,
"nodeType": "ExpressionStatement",
"src": "1416:16:40"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6323,
"name": "returndata",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6308,
"src": "1456:10:40",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
{
"argumentTypes": null,
"components": [
{
"argumentTypes": null,
"id": 6325,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1469:7:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 6324,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1469:7:40",
"typeDescriptions": {
"typeIdentifier": null,
"typeString": null
}
}
}
],
"id": 6326,
"isConstant": false,
"isInlineArray": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "TupleExpression",
"src": "1468:9:40",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
},
{
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
}
],
"expression": {
"argumentTypes": null,
"id": 6321,
"name": "abi",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": -1,
"src": "1445:3:40",
"typeDescriptions": {
"typeIdentifier": "t_magic_abi",
"typeString": "abi"
}
},
"id": 6322,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"memberName": "decode",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1445:10:40",
"typeDescriptions": {
"typeIdentifier": "t_function_abidecode_pure$__$returns$__$",
"typeString": "function () pure"
}
},
"id": 6327,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1445:33:40",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"functionReturnParameters": 6304,
"id": 6328,
"nodeType": "Return",
"src": "1438:40:40"
}
]
},
"documentation": {
"id": 6298,
"nodeType": "StructuredDocumentation",
"src": "956:138:40",
"text": " @dev Returns the admin of a proxy. Only the admin can query it.\n @return The address of the current admin of the proxy."
},
"functionSelector": "f3b7dead",
"id": 6330,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "getProxyAdmin",
"nodeType": "FunctionDefinition",
"overrides": null,
"parameters": {
"id": 6301,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6300,
"mutability": "mutable",
"name": "proxy",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6330,
"src": "1120:30:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
},
"typeName": {
"contractScope": null,
"id": 6299,
"name": "AdminUpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 5849,
"src": "1120:24:40",
"typeDescriptions": {
"typeIdentifier": "t_contract$_AdminUpgradeabilityProxy_$5849",
"typeString": "contract AdminUpgradeabilityProxy"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1119:32:40"
},
"returnParameters": {
"id": 6304,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6303,
"mutability": "mutable",
"name": "",
"nodeType": "VariableDeclaration",
"overrides": null,
"scope": 6330,
"src": "1173:7:40",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6302,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1173:7:40",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"