@alice-network/zos-lib
Version:
JavaScript library for the ZeppelinOS smart contract platform
856 lines • 197 kB
JSON
{
"contractName": "AdminUpgradeabilityProxy",
"abi": [
{
"inputs": [
{
"name": "_implementation",
"type": "address"
},
{
"name": "_admin",
"type": "address"
},
{
"name": "_data",
"type": "bytes"
}
],
"payable": true,
"stateMutability": "payable",
"type": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"constant": true,
"inputs": [],
"name": "admin",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "implementation",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newImplementation",
"type": "address"
},
{
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
}
],
"bytecode": "0x6080604052604051610baa380380610baa833981018060405281019080805190602001909291908051906020019092919080518201929190505050828160405180807f6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e74617481526020017f696f6e000000000000000000000000000000000000000000000000000000000081525060230190506040518091039020600019167f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3600102600019161415156100cd57fe5b6100e58261020d640100000000026401000000009004565b600081511115610180578173ffffffffffffffffffffffffffffffffffffffff168160405180828051906020019080838360005b83811015610134578082015181840152602081019050610119565b50505050905090810190601f1680156101615780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561017f57600080fd5b5b505060405180807f6f72672e7a657070656c696e6f732e70726f78792e61646d696e000000000000815250601a0190506040518091039020600019167f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b600102600019161415156101ed57fe5b610205826102f2640100000000026401000000009004565b505050610334565b600061022b8261032164010000000002610828176401000000009004565b15156102c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b600080823b905060008111915050919050565b610867806103436000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035d565b005b3480156101ae57600080fd5b506101b761051b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610201610573565b61021161020c61064e565b61067f565b565b61021b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c57610257816106d6565b610265565b6102646101f9565b5b50565b6102706106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102f7576102ac836106d6565b8273ffffffffffffffffffffffffffffffffffffffff16828260405180838380828437820191505092505050600060405180830381855af491505015156102f257600080fd5b610300565b6102ff6101f9565b5b505050565b600061030f6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103515761034a61064e565b905061035a565b6103596101f9565b5b90565b6103656106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050f57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610463576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048c6106a5565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050a81610725565b610518565b6105176101f9565b5b50565b60006105256106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610567576105606106a5565b9050610570565b61056f6101f9565b5b90565b61057b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61064c610754565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146106a0573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106df81610756565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b600061076182610828565b15156107fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a723058202029b82c05a453a0ab69adc4daaaac163e04b8cfc21e38fceccfcffcefb057f80029",
"deployedBytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035d565b005b3480156101ae57600080fd5b506101b761051b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610201610573565b61021161020c61064e565b61067f565b565b61021b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c57610257816106d6565b610265565b6102646101f9565b5b50565b6102706106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102f7576102ac836106d6565b8273ffffffffffffffffffffffffffffffffffffffff16828260405180838380828437820191505092505050600060405180830381855af491505015156102f257600080fd5b610300565b6102ff6101f9565b5b505050565b600061030f6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103515761034a61064e565b905061035a565b6103596101f9565b5b90565b6103656106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050f57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610463576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048c6106a5565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050a81610725565b610518565b6105176101f9565b5b50565b60006105256106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610567576105606106a5565b9050610570565b61056f6101f9565b5b90565b61057b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61064c610754565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146106a0573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106df81610756565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b600061076182610828565b15156107fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a723058202029b82c05a453a0ab69adc4daaaac163e04b8cfc21e38fceccfcffcefb057f80029",
"sourceMap": "422:4043:23:-;;;1886:221;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1972:15;1989:5;1492:48:26;;;;;;;;;;;;;;;;;;;;;;;;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;;2038:39:23;;;;;;;;;;;;;;;;;;;2024:53;;;940:66;2024:10;;:53;;;;2017:61;;;;;;2085:17;2095:6;2085:9;;;:17;;;:::i;:::-;1886:221;;;422:4043;;2355:289:26;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;4098:133:23:-;4150:12;940:66;4165:10;;4150:25;;4212:8;4206:4;4199:22;4191:36;;:::o;438:576:28:-;495:4;507:12;982:4;970:17;962:25;;1008:1;1001:4;:8;994:15;;438:576;;;;:::o;422:4043:23:-;;;;;;;",
"deployedSourceMap": "422:4043:23:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;454:11:24;:9;:11::i;:::-;422:4043:23;3000:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3000:103:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;3620:181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2315:101;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2315:101:23;;;;;;;;;;;;;;;;;;;;;;;;;;;2592:224;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2592:224:23;;;;;;;;;;;;;;;;;;;;;;;;;;;;2168:83;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2168:83:23;;;;;;;;;;;;;;;;;;;;;;;;;;;1953:90:24;1989:15;:13;:15::i;:::-;2010:28;2020:17;:15;:17::i;:::-;2010:9;:28::i;:::-;1953:90::o;3000:103:23:-;1239:8;:6;:8::i;:::-;1225:22;;:10;:22;;;1221:76;;;3069:29;3080:17;3069:10;:29::i;:::-;1221:76;;;1279:11;:9;:11::i;:::-;1221:76;3000:103;:::o;3620:181::-;1239:8;:6;:8::i;:::-;1225:22;;:10;:22;;;1221:76;;;3716:29;3727:17;3716:10;:29::i;:::-;3759:17;:30;;3790:4;;3759:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3751:45;;;;;;;;1221:76;;;1279:11;:9;:11::i;:::-;1221:76;3620:181;;;:::o;2315:101::-;2372:7;1239:8;:6;:8::i;:::-;1225:22;;:10;:22;;;1221:76;;;2394:17;:15;:17::i;:::-;2387:24;;1221:76;;;1279:11;:9;:11::i;:::-;1221:76;2315:101;:::o;2592:224::-;1239:8;:6;:8::i;:::-;1225:22;;:10;:22;;;1221:76;;;2682:1;2662:22;;:8;:22;;;;2654:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2754:32;2767:8;:6;:8::i;:::-;2777;2754:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2792:19;2802:8;2792:9;:19::i;:::-;1221:76;;;1279:11;:9;:11::i;:::-;1221:76;2592:224;:::o;2168:83::-;2216:7;1239:8;:6;:8::i;:::-;1225:22;;:10;:22;;;1221:76;;;2238:8;:6;:8::i;:::-;2231:15;;1221:76;;;1279:11;:9;:11::i;:::-;1221:76;2168:83;:::o;4306:157::-;4368:8;:6;:8::i;:::-;4354:22;;:10;:22;;;;4346:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4437:21;:19;:21::i;:::-;4306:157::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;3846:136:23;3887:11;3906:12;940:66;3921:10;;3906:25;;3967:4;3961:11;3954:18;;3946:32;;:::o;2076:142:26:-;2138:37;2157:17;2138:18;:37::i;:::-;2195:17;2186:27;;;;;;;;;;;;2076:142;:::o;4098:133:23:-;4150:12;940:66;4165:10;;4150:25;;4212:8;4206:4;4199:22;4191:36;;:::o;1819:39:24:-;:::o;2355:289:26:-;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",
"source": "pragma solidity ^0.4.24;\n\nimport './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 AdminUpgradeabilityProxy 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 * @param _implementation 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 constructor(address _implementation, address _admin, bytes _data) UpgradeabilityProxy(_implementation, _data) public payable {\n assert(ADMIN_SLOT == keccak256(\"org.zeppelinos.proxy.admin\"));\n\n _setAdmin(_admin);\n }\n\n /**\n * @return The address of the proxy admin.\n */\n function admin() external view ifAdmin returns (address) {\n return _admin();\n }\n\n /**\n * @return The address of the implementation.\n */\n function implementation() external view 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 data) payable external ifAdmin {\n _upgradeTo(newImplementation);\n require(newImplementation.delegatecall(data));\n }\n\n /**\n * @return 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 {\n require(msg.sender != _admin(), \"Cannot call fallback function from the proxy admin\");\n super._willFallback();\n }\n}\n",
"sourcePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/AdminUpgradeabilityProxy.sol",
"ast": {
"absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/AdminUpgradeabilityProxy.sol",
"exportedSymbols": {
"AdminUpgradeabilityProxy": [
2812
]
},
"id": 2813,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 2636,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:23"
},
{
"absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/UpgradeabilityProxy.sol",
"file": "./UpgradeabilityProxy.sol",
"id": 2637,
"nodeType": "ImportDirective",
"scope": 2813,
"sourceUnit": 3029,
"src": "26:35:23",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [
{
"arguments": null,
"baseName": {
"contractScope": null,
"id": 2638,
"name": "UpgradeabilityProxy",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 3028,
"src": "459:19:23",
"typeDescriptions": {
"typeIdentifier": "t_contract$_UpgradeabilityProxy_$3028",
"typeString": "contract UpgradeabilityProxy"
}
},
"id": 2639,
"nodeType": "InheritanceSpecifier",
"src": "459:19:23"
}
],
"contractDependencies": [
2850,
3028
],
"contractKind": "contract",
"documentation": "@title AdminUpgradeabilityProxy\n@dev This contract combines an upgradeability proxy with an authorization\nmechanism for administrative tasks.\nAll external functions in this contract must be guarded by the\n`ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity\nfeature proposal that would enable this to be done automatically.",
"fullyImplemented": true,
"id": 2812,
"linearizedBaseContracts": [
2812,
3028,
2850
],
"name": "AdminUpgradeabilityProxy",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": "@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": 2645,
"name": "AdminChanged",
"nodeType": "EventDefinition",
"parameters": {
"id": 2644,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2641,
"indexed": false,
"name": "previousAdmin",
"nodeType": "VariableDeclaration",
"scope": 2645,
"src": "682:21:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2640,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "682:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2643,
"indexed": false,
"name": "newAdmin",
"nodeType": "VariableDeclaration",
"scope": 2645,
"src": "705:16:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2642,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "705:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "681:41:23"
},
"src": "663:60:23"
},
{
"constant": true,
"id": 2648,
"name": "ADMIN_SLOT",
"nodeType": "VariableDeclaration",
"scope": 2812,
"src": "902:104:23",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"typeName": {
"id": 2646,
"name": "bytes32",
"nodeType": "ElementaryTypeName",
"src": "902:7:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"value": {
"argumentTypes": null,
"hexValue": "307831306436613534613437353463383836396436383836623566356437666266613562343532323233376561356336306431316263346537613166663933393062",
"id": 2647,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "940:66:23",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_7616251639890160809447714111544359812065171195189364993079081710756264753419_by_1",
"typeString": "int_const 7616...(68 digits omitted)...3419"
},
"value": "0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b"
},
"visibility": "private"
},
{
"body": {
"id": 2662,
"nodeType": "Block",
"src": "1215:86:23",
"statements": [
{
"condition": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 2654,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 2650,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3157,
"src": "1225:3:23",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 2651,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberName": "sender",
"nodeType": "MemberAccess",
"referencedDeclaration": null,
"src": "1225:10:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 2652,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2782,
"src": "1239:6:23",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 2653,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1239:8:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1225:22:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"falseBody": {
"id": 2660,
"nodeType": "Block",
"src": "1271:26:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 2657,
"name": "_fallback",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2849,
"src": "1279:9:23",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$__$returns$__$",
"typeString": "function ()"
}
},
"id": 2658,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1279:11:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2659,
"nodeType": "ExpressionStatement",
"src": "1279:11:23"
}
]
},
"id": 2661,
"nodeType": "IfStatement",
"src": "1221:76:23",
"trueBody": {
"id": 2656,
"nodeType": "Block",
"src": "1249:16:23",
"statements": [
{
"id": 2655,
"nodeType": "PlaceholderStatement",
"src": "1257:1:23"
}
]
}
}
]
},
"documentation": "@dev Modifier to check whether the `msg.sender` is the admin.\nIf it is, it will run the function. Otherwise, it will delegate the call\nto the implementation.",
"id": 2663,
"name": "ifAdmin",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 2649,
"nodeType": "ParameterList",
"parameters": [],
"src": "1212:2:23"
},
"src": "1196:105:23",
"visibility": "internal"
},
{
"body": {
"id": 2688,
"nodeType": "Block",
"src": "2011:96:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
},
"id": 2681,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 2677,
"name": "ADMIN_SLOT",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2648,
"src": "2024:10:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "6f72672e7a657070656c696e6f732e70726f78792e61646d696e",
"id": 2679,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2048:28:23",
"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": 2678,
"name": "keccak256",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3151,
"src": "2038:9:23",
"typeDescriptions": {
"typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$",
"typeString": "function () pure returns (bytes32)"
}
},
"id": 2680,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2038:39:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes32",
"typeString": "bytes32"
}
},
"src": "2024:53:23",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 2676,
"name": "assert",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3146,
"src": "2017:6:23",
"typeDescriptions": {
"typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 2682,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2017:61:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2683,
"nodeType": "ExpressionStatement",
"src": "2017:61:23"
},
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 2685,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2667,
"src": "2095:6:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 2684,
"name": "_setAdmin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2793,
"src": "2085:9:23",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 2686,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2085:17:23",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 2687,
"nodeType": "ExpressionStatement",
"src": "2085:17:23"
}
]
},
"documentation": "Contract constructor.\n@param _implementation 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.\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": 2689,
"implemented": true,
"isConstructor": true,
"isDeclaredConst": false,
"modifiers": [
{
"arguments": [
{
"argumentTypes": null,
"id": 2672,
"name": "_implementation",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2665,
"src": "1972:15:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 2673,
"name": "_data",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2669,
"src": "1989:5:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
}
],
"id": 2674,
"modifierName": {
"argumentTypes": null,
"id": 2671,
"name": "UpgradeabilityProxy",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 3028,
"src": "1952:19:23",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_contract$_UpgradeabilityProxy_$3028_$",
"typeString": "type(contract UpgradeabilityProxy)"
}
},
"nodeType": "ModifierInvocation",
"src": "1952:43:23"
}
],
"name": "",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 2670,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 2665,
"name": "_implementation",
"nodeType": "VariableDeclaration",
"scope": 2689,
"src": "1898:23:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2664,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1898:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2667,
"name": "_admin",
"nodeType": "VariableDeclaration",
"scope": 2689,
"src": "1923:14:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 2666,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1923:7:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 2669,
"name": "_data",
"nodeType": "VariableDeclaration",
"scope": 2689,
"src": "1939:11:23",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 2668,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "1939:5:23",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1897:54:23"
},
"payable": true,
"returnParameters": {
"id": 2675,
"nodeType": "ParameterList",
"parameters": [],
"src": "2011:0:23"
},
"scope": 2812,
"src": "1886:221:23",
"stateMutability": "payable",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 2699,
"nodeType": "Block",
"src": "2225:26:23",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 2696,
"name": "_admin",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 2782,
"src": "2238:6:23",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 2697,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "2238:8:23",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"func