@alice-network/zos-lib
Version:
JavaScript library for the ZeppelinOS smart contract platform
1,097 lines (1,096 loc) • 104 kB
JSON
{
"contractName": "UpgradeabilityProxy",
"abi": [
{
"inputs": [
{
"name": "_implementation",
"type": "address"
},
{
"name": "_data",
"type": "bytes"
}
],
"payable": true,
"stateMutability": "payable",
"type": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
}
],
"bytecode": "0x6080604052604051610338380380610338833981018060405281019080805190602001909291908051820192919050505060405180807f6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e74617481526020017f696f6e000000000000000000000000000000000000000000000000000000000081525060230190506040518091039020600019167f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3600102600019161415156100c157fe5b6100d98261017b640100000000026401000000009004565b600081511115610174578173ffffffffffffffffffffffffffffffffffffffff168160405180828051906020019080838360005b8381101561012857808201518184015260208101905061010d565b50505050905090810190601f1680156101555780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561017357600080fd5b5b5050610273565b60006101998261026064010000000002610078176401000000009004565b1515610233576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b905060008111915050919050565b60b7806102816000396000f3006080604052600a600c565b005b60126020565b601e601a6022565b6053565b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146073573d6000f35b3d6000fd5b600080823b9050600081119150509190505600a165627a7a7230582059d068ccc7f811e893ac114e9873e5fe12849c4624f99d704dfcd7e54b87a88d0029",
"deployedBytecode": "0x6080604052600a600c565b005b60126020565b601e601a6022565b6053565b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146073573d6000f35b3d6000fd5b600080823b9050600081119150509190505600a165627a7a7230582059d068ccc7f811e893ac114e9873e5fe12849c4624f99d704dfcd7e54b87a88d0029",
"sourceMap": "320:2326:26:-;;;1391:281;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1492:48;;;;;;;;;;;;;;;;;;;;;;;;1469:71;;;789:66;1469:19;;:71;;;;1462:79;;;;;;1547:35;1566:15;1547:18;;;:35;;;:::i;:::-;1606:1;1591:5;:12;:16;1588:80;;;1625:15;:28;;1654:5;1625:35;;;;;;;;;;;;;23:1:-1;8:100;33:3;30:1;27:10;8:100;;;99:1;94:3;90:11;84:18;80:1;75:3;71:11;64:39;52:2;49:1;45:10;40:15;;8:100;;;12:14;1625:35:26;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1617:44;;;;;;;;1588:80;1391:281;;320:2326;;2355:289;2545:12;2432:42;2456:17;2432:23;;;;;:42;;;:::i;:::-;2424:114;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;789:66;2560:19;;2545:34;;2616:17;2610:4;2603:31;2595:45;;:::o;438:576:28:-;495:4;507:12;982:4;970:17;962:25;;1008:1;1001:4;:8;994:15;;438:576;;;;:::o;320:2326:26:-;;;;;;;",
"deployedSourceMap": "320:2326:26:-;;;454:11:24;:9;:11::i;:::-;320:2326:26;1953:90:24;1989:15;:13;:15::i;:::-;2010:28;2020:17;:15;:17::i;:::-;2010:9;:28::i;:::-;1953:90::o;1819:39::-;:::o;1785:156:26:-;1835:12;1855;789:66;1870:19;;1855:34;;1926:4;1920:11;1912:19;;1904:33;;:::o;879:731:24:-;1181:12;1178:1;1175;1162:32;1371:1;1368;1354:12;1351:1;1335:14;1330:3;1317:56;1435:14;1432:1;1429;1414:36;1465:6;1525:1;1520:36;;;;1583:14;1580:1;1573:25;1520:36;1539:14;1536:1;1529:25;438:576:28;495:4;507:12;982:4;970:17;962:25;;1008:1;1001:4;:8;994:15;;438:576;;;;:::o",
"source": "pragma solidity ^0.4.24;\n\nimport './Proxy.sol';\nimport 'openzeppelin-solidity/contracts/AddressUtils.sol';\n\n/**\n * @title UpgradeabilityProxy\n * @dev This contract implements a proxy that allows to change the\n * implementation address to which it will delegate.\n * Such a change is called an implementation upgrade.\n */\ncontract UpgradeabilityProxy is Proxy {\n /**\n * @dev Emitted when the implementation is upgraded.\n * @param implementation Address of the new implementation.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"org.zeppelinos.proxy.implementation\", and is\n * validated in the constructor.\n */\n bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3;\n\n /**\n * @dev Contract constructor.\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 _data) public payable {\n assert(IMPLEMENTATION_SLOT == keccak256(\"org.zeppelinos.proxy.implementation\"));\n _setImplementation(_implementation);\n if(_data.length > 0) {\n require(_implementation.delegatecall(_data));\n }\n }\n\n /**\n * @dev Returns the current implementation.\n * @return Address of the current implementation\n */\n function _implementation() internal view returns (address impl) {\n bytes32 slot = IMPLEMENTATION_SLOT;\n assembly {\n impl := sload(slot)\n }\n }\n\n /**\n * @dev Upgrades the proxy to a new implementation.\n * @param newImplementation Address of the new implementation.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Sets the implementation address of the proxy.\n * @param newImplementation Address of the new implementation.\n */\n function _setImplementation(address newImplementation) private {\n require(AddressUtils.isContract(newImplementation), \"Cannot set a proxy implementation to a non-contract address\");\n\n bytes32 slot = IMPLEMENTATION_SLOT;\n\n assembly {\n sstore(slot, newImplementation)\n }\n }\n}\n",
"sourcePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/UpgradeabilityProxy.sol",
"ast": {
"absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/UpgradeabilityProxy.sol",
"exportedSymbols": {
"UpgradeabilityProxy": [
3028
]
},
"id": 3029,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2939,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:26"
},
{
"absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/Proxy.sol",
"file": "./Proxy.sol",
"id": 2940,
"nodeType": "ImportDirective",
"scope": 3029,
"sourceUnit": 2851,
"src": "26:21:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"absolutePath": "openzeppelin-solidity/contracts/AddressUtils.sol",
"file": "openzeppelin-solidity/contracts/AddressUtils.sol",
"id": 2941,
"nodeType": "ImportDirective",
"scope": 3029,
"sourceUnit": 3057,
"src": "48:58:26",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 2942,
"name": "Proxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 2850,
"src": "352:5:26",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Proxy_$2850",
"typeString": "contract Proxy"
}
},
"id": 2943,
"nodeType": "InheritanceSpecifier",
"src": "352:5:26"
}
],
"contractDependencies": [
2850
],
"contractKind": "contract",
"documentation": "@title UpgradeabilityProxy\n@dev This contract implements a proxy that allows to change the\nimplementation address to which it will delegate.\nSuch a change is called an implementation upgrade.",
"fullyImplemented": true,
"id": 3028,
"linearizedBaseContracts": [
3028,
2850
],
"name": "UpgradeabilityProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": "@dev Emitted when the implementation is upgraded.\n@param implementation Address of the new implementation.",
"id": 2947,
"name": "Upgraded",
"nodeType": "EventDefinition",
"parameters": {
"id": 2946,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2945,
"indexed": true,
"name": "implementation",
"nodeType": "VariableDeclaration",
"scope": 2947,
"src": "506:30:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2944,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "506:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "505:32:26"
},
"src": "491:47:26"
},
{
"constant": true,
"id": 2950,
"name": "IMPLEMENTATION_SLOT",
"nodeType": "VariableDeclaration",
"scope": 3028,
"src": "742:113:26",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 2948,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "742:7:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307837303530633965306634636137363963363962643361386566373430626333373933346638653263303336653561373233666438656530343865643366386333",
"id": 2949,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "789:66:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_50801780122331352337026042894847907698553222651959119521779622085092237899971_by_1",
"typeString": "int_const 5080...(69 digits omitted)...9971"
},
"value": "0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3"
},
"visibility": "private"
},
{
"body": {
"id": 2982,
"nodeType": "Block",
"src": "1456:216:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 2962,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2958,
"name": "IMPLEMENTATION_SLOT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2950,
"src": "1469:19:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e746174696f6e",
"id": 2960,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1502:37:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3",
"typeString": "literal_string \"org.zeppelinos.proxy.implementation\""
},
"value": "org.zeppelinos.proxy.implementation"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_stringliteral_7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3",
"typeString": "literal_string \"org.zeppelinos.proxy.implementation\""
}
],
"id": 2959,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3151,
"src": "1492:9:26",
"typeDescriptions": {
"typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$",
"typeString": "function () pure returns (bytes32)"
}
},
"id": 2961,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1492:48:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "1469:71:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2957,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3146,
"src": "1462:6:26",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2963,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1462:79:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2964,
"nodeType": "ExpressionStatement",
"src": "1462:79:26"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2966,
"name": "_implementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2952,
"src": "1566:15:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 2965,
"name": "_setImplementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3027,
"src": "1547:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 2967,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1547:35:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2968,
"nodeType": "ExpressionStatement",
"src": "1547:35:26"
},
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 2972,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2969,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2954,
"src": "1591:5:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"id": 2970,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "length",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1591:12:26",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">",
"rightExpression": {
"argumentTypes": null,
"hexValue": "30",
"id": 2971,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1606:1:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
},
"src": "1591:16:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": null,
"id": 2981,
"nodeType": "IfStatement",
"src": "1588:80:26",
"trueBody": {
"id": 2980,
"nodeType": "Block",
"src": "1609:59:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2976,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2954,
"src": "1654:5:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
],
"expression": {
"argumentTypes": null,
"id": 2974,
"name": "_implementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2952,
"src": "1625:15:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 2975,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "delegatecall",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1625:28:26",
"typeDescriptions": {
"typeIdentifier": "t_function_baredelegatecall_nonpayable$__$returns$_t_bool_$",
"typeString": "function () returns (bool)"
}
},
"id": 2977,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1625:35:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2973,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
3160,
3161
],
"referencedDeclaration": 3160,
"src": "1617:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2978,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1617:44:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2979,
"nodeType": "ExpressionStatement",
"src": "1617:44:26"
}
]
}
}
]
},
"documentation": "@dev Contract constructor.\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.\nIt should include the signature and the parameters of the function to be called, as described in\nhttps://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\nThis parameter is optional, if no data is given the initialization call to proxied contract will be skipped.",
"id": 2983,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2955,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2952,
"name": "_implementation",
"nodeType": "VariableDeclaration",
"scope": 2983,
"src": "1403:23:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2951,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1403:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2954,
"name": "_data",
"nodeType": "VariableDeclaration",
"scope": 2983,
"src": "1428:11:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 2953,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1428:5:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1402:38:26"
},
"payable": true,
"returnParameters": {
"id": 2956,
"nodeType": "ParameterList",
"parameters": [],
"src": "1456:0:26"
},
"scope": 3028,
"src": "1391:281:26",
"stateMutability": "payable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 2993,
"nodeType": "Block",
"src": "1849:92:26",
"statements": [
{
"assignments": [
2989
],
"declarations": [
{
"constant": false,
"id": 2989,
"name": "slot",
"nodeType": "VariableDeclaration",
"scope": 2994,
"src": "1855:12:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 2988,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "1855:7:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": null,
"visibility": "internal"
}
],
"id": 2991,
"initialValue": {
"argumentTypes": null,
"id": 2990,
"name": "IMPLEMENTATION_SLOT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2950,
"src": "1870:19:26",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "1855:34:26"
},
{
"externalReferences": [
{
"impl": {
"declaration": 2986,
"isOffset": false,
"isSlot": false,
"src": "1912:4:26",
"valueSize": 1
}
},
{
"slot": {
"declaration": 2989,
"isOffset": false,
"isSlot": false,
"src": "1926:4:26",
"valueSize": 1
}
}
],
"id": 2992,
"nodeType": "InlineAssembly",
"operations": "{\n impl := sload(slot)\n}",
"src": "1895:46:26"
}
]
},
"documentation": "@dev Returns the current implementation.\n@return Address of the current implementation",
"id": 2994,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "_implementation",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2984,
"nodeType": "ParameterList",
"parameters": [],
"src": "1809:2:26"
},
"payable": false,
"returnParameters": {
"id": 2987,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2986,
"name": "impl",
"nodeType": "VariableDeclaration",
"scope": 2994,
"src": "1835:12:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2985,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1835:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1834:14:26"
},
"scope": 3028,
"src": "1785:156:26",
"stateMutability": "view",
"superFunction": 2826,
"visibility": "internal"
},
{
"body": {
"id": 3007,
"nodeType": "Block",
"src": "2132:86:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3000,
"name": "newImplementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2996,
"src": "2157:17:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 2999,
"name": "_setImplementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3027,
"src": "2138:18:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 3001,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2138:37:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 3002,
"nodeType": "ExpressionStatement",
"src": "2138:37:26"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3004,
"name": "newImplementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2996,
"src": "2195:17:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 3003,
"name": "Upgraded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2947,
"src": "2186:8:26",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 3005,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2186:27:26",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 3006,
"nodeType": "EmitStatement",
"src": "2181:32:26"
}
]
},
"documentation": "@dev Upgrades the proxy to a new implementation.\n@param newImplementation Address of the new implementation.",
"id": 3008,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "_upgradeTo",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2997,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2996,
"name": "newImplementation",
"nodeType": "VariableDeclaration",
"scope": 3008,
"src": "2096:25:26",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2995,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2096:7:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "2095:27:26"
},
"payable": false,
"returnParameters": {
"id": 2998,
"nodeType": "ParameterList",
"parameters": [],
"src": "2132:0:26"
},
"scope": 3028,
"src": "2076:142:26",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 3026,
"nodeType": "Block",
"src": "2418:226:26",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 3016,
"name": "newImplementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3010,
"src": "2456:17:26",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"id": 3014,
"name": "AddressUtils",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3056,
"src": "2432:12:26",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_AddressUtils_$3056_$",
"typeString": "type(library AddressUtils)"
}
},
"id": 3015,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "isContract",
"nodeType": "MemberAccess",
"referencedDeclaration": 3055,
"src": "2432:23:26",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
"typeString": "function (address) view returns (bool)"
}
},
"id": 3017,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2432:42:26",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"argumentTypes": null,
"hexValue": "43616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373",
"id": 3018,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2476:61:26",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
"typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
},
"value": "Cannot set a proxy implementation to a non-contract address"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_b5145a64ce8c406e5785204fe5b300f0ceda96d6636350b38fdccb9cd8c0c37c",
"typeString": "literal_string \"Cannot set a proxy implementation to a non-contract address\""
}
],
"id": 3013,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
3160,
3161
],
"referencedDeclaration": 3161,
"src": "2424:7:26",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 3019,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",