UNPKG

@alice-network/zos-lib

Version:

JavaScript library for the ZeppelinOS smart contract platform

867 lines 194 kB
{ "contractName": "DeprecatedAdminUpgradeabilityProxy", "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": 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": "0x6080604052604051610b56380380610b568339810180604052810190808051906020019092919080518201929190505050818160405180807f6f72672e7a657070656c696e6f732e70726f78792e696d706c656d656e74617481526020017f696f6e000000000000000000000000000000000000000000000000000000000081525060230190506040518091039020600019167f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3600102600019161415156100c357fe5b6100db82610202640100000000026401000000009004565b600081511115610176578173ffffffffffffffffffffffffffffffffffffffff168160405180828051906020019080838360005b8381101561012a57808201518184015260208101905061010f565b50505050905090810190601f1680156101575780820380516001836020036101000a031916815260200191505b50915050600060405180830381855af4915050151561017557600080fd5b5b505060405180807f6f72672e7a657070656c696e6f732e70726f78792e61646d696e000000000000815250601a0190506040518091039020600019167f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b600102600019161415156101e357fe5b6101fb336102e7640100000000026401000000009004565b5050610329565b600061022082610316640100000000026107df176401000000009004565b15156102ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b600080823b905060008111915050919050565b61081e806103386000396000f30060806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035d565b005b3480156101ae57600080fd5b506101b761051b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61020161052a565b61021161020c610605565b610636565b565b61021b61065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c576102578161068d565b610265565b6102646101f9565b5b50565b61027061065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102f7576102ac8361068d565b8273ffffffffffffffffffffffffffffffffffffffff16828260405180838380828437820191505092505050600060405180830381855af491505015156102f257600080fd5b610300565b6102ff6101f9565b5b505050565b600061030f61065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103515761034a610605565b905061035a565b6103596101f9565b5b90565b61036561065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050f57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610463576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048c61065c565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050a816106dc565b610518565b6105176101f9565b5b50565b600061052561065c565b905090565b61053261065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61060361070b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e8060008114610657573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106968161070d565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b6000610718826107df565b15156107b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a72305820ad77446a00c2023c03b2360b0c041446bd204ff1ee1716edcd3e80b78dc2e3550029", "deployedBytecode": "0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035d565b005b3480156101ae57600080fd5b506101b761051b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61020161052a565b61021161020c610605565b610636565b565b61021b61065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c576102578161068d565b610265565b6102646101f9565b5b50565b61027061065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102f7576102ac8361068d565b8273ffffffffffffffffffffffffffffffffffffffff16828260405180838380828437820191505092505050600060405180830381855af491505015156102f257600080fd5b610300565b6102ff6101f9565b5b505050565b600061030f61065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103515761034a610605565b905061035a565b6103596101f9565b5b90565b61036561065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050f57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610463576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048c61065c565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050a816106dc565b610518565b6105176101f9565b5b50565b600061052561065c565b905090565b61053261065c565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61060361070b565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e8060008114610657573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106968161070d565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b6000610718826107df565b15156107b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a72305820ad77446a00c2023c03b2360b0c041446bd204ff1ee1716edcd3e80b78dc2e3550029", "sourceMap": "438:4036:6:-;;;1915:209;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1985:15;2002: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;;2051:39:6;;;;;;;;;;;;;;;;;;;2037:53;;;966:66;2037:10;;:53;;;;2030:61;;;;;;2098:21;2108:10;2098:9;;;:21;;;:::i;:::-;1915:209;;438:4036;;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;4107:133:6:-;4159:12;966:66;4174:10;;4159:25;;4221:8;4215:4;4208:22;4200: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;:4036:6:-;;;;;;;", "deployedSourceMap": "438:4036:6:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;454:11:24;:9;:11::i;:::-;438:4036:6;3009:103;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3009:103:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;3629:181;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2324:101;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2324:101:6;;;;;;;;;;;;;;;;;;;;;;;;;;;2601:224;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2601:224:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;2185:75;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2185:75:6;;;;;;;;;;;;;;;;;;;;;;;;;;;1953:90:24;1989:15;:13;:15::i;:::-;2010:28;2020:17;:15;:17::i;:::-;2010:9;:28::i;:::-;1953:90::o;3009:103:6:-;1265:8;:6;:8::i;:::-;1251:22;;:10;:22;;;1247:76;;;3078:29;3089:17;3078:10;:29::i;:::-;1247:76;;;1305:11;:9;:11::i;:::-;1247:76;3009:103;:::o;3629:181::-;1265:8;:6;:8::i;:::-;1251:22;;:10;:22;;;1247:76;;;3725:29;3736:17;3725:10;:29::i;:::-;3768:17;:30;;3799:4;;3768:36;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3760:45;;;;;;;;1247:76;;;1305:11;:9;:11::i;:::-;1247:76;3629:181;;;:::o;2324:101::-;2381:7;1265:8;:6;:8::i;:::-;1251:22;;:10;:22;;;1247:76;;;2403:17;:15;:17::i;:::-;2396:24;;1247:76;;;1305:11;:9;:11::i;:::-;1247:76;2324:101;:::o;2601:224::-;1265:8;:6;:8::i;:::-;1251:22;;:10;:22;;;1247:76;;;2691:1;2671:22;;:8;:22;;;;2663:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2763:32;2776:8;:6;:8::i;:::-;2786;2763:32;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2801:19;2811:8;2801:9;:19::i;:::-;1247:76;;;1305:11;:9;:11::i;:::-;1247:76;2601:224;:::o;2185:75::-;2225:7;2247:8;:6;:8::i;:::-;2240:15;;2185:75;:::o;4315:157::-;4377:8;:6;:8::i;:::-;4363:22;;:10;:22;;;;4355:85;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4446:21;:19;:21::i;:::-;4315: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;3855:136:6;3896:11;3915:12;966:66;3930:10;;3915:25;;3976:4;3970:11;3963:18;;3955:32;;:::o;2076:142:26:-;2138:37;2157:17;2138:18;:37::i;:::-;2195:17;2186:27;;;;;;;;;;;;2076:142;:::o;4107:133:6:-;4159:12;966:66;4174:10;;4159:25;;4221:8;4215:4;4208:22;4200: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 '../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 _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 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/mocks/DeprecatedAdminUpgradeabilityProxy.sol", "ast": { "absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/mocks/DeprecatedAdminUpgradeabilityProxy.sol", "exportedSymbols": { "DeprecatedAdminUpgradeabilityProxy": [ 970 ] }, "id": 971, "nodeType": "SourceUnit", "nodes": [ { "id": 797, "literals": [ "solidity", "^", "0.4", ".24" ], "nodeType": "PragmaDirective", "src": "0:24:6" }, { "absolutePath": "/Users/yoonjae/WebstormProjects/zos/packages/lib/contracts/upgradeability/UpgradeabilityProxy.sol", "file": "../upgradeability/UpgradeabilityProxy.sol", "id": 798, "nodeType": "ImportDirective", "scope": 971, "sourceUnit": 3029, "src": "26:51:6", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 799, "name": "UpgradeabilityProxy", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 3028, "src": "485:19:6", "typeDescriptions": { "typeIdentifier": "t_contract$_UpgradeabilityProxy_$3028", "typeString": "contract UpgradeabilityProxy" } }, "id": 800, "nodeType": "InheritanceSpecifier", "src": "485:19:6" } ], "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": 970, "linearizedBaseContracts": [ 970, 3028, 2850 ], "name": "DeprecatedAdminUpgradeabilityProxy", "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": 806, "name": "AdminChanged", "nodeType": "EventDefinition", "parameters": { "id": 805, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 802, "indexed": false, "name": "previousAdmin", "nodeType": "VariableDeclaration", "scope": 806, "src": "708:21:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 801, "name": "address", "nodeType": "ElementaryTypeName", "src": "708:7:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 804, "indexed": false, "name": "newAdmin", "nodeType": "VariableDeclaration", "scope": 806, "src": "731:16:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 803, "name": "address", "nodeType": "ElementaryTypeName", "src": "731:7:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "707:41:6" }, "src": "689:60:6" }, { "constant": true, "id": 809, "name": "ADMIN_SLOT", "nodeType": "VariableDeclaration", "scope": 970, "src": "928:104:6", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "typeName": { "id": 807, "name": "bytes32", "nodeType": "ElementaryTypeName", "src": "928:7:6", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "value": { "argumentTypes": null, "hexValue": "307831306436613534613437353463383836396436383836623566356437666266613562343532323233376561356336306431316263346537613166663933393062", "id": 808, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "966:66:6", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_7616251639890160809447714111544359812065171195189364993079081710756264753419_by_1", "typeString": "int_const 7616...(68 digits omitted)...3419" }, "value": "0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b" }, "visibility": "private" }, { "body": { "id": 823, "nodeType": "Block", "src": "1241:86:6", "statements": [ { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 815, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 811, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3157, "src": "1251:3:6", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 812, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1251:10:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 813, "name": "_admin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 940, "src": "1265:6:6", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 814, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1265:8:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "src": "1251:22:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": { "id": 821, "nodeType": "Block", "src": "1297:26:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 818, "name": "_fallback", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2849, "src": "1305:9:6", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 819, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1305:11:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 820, "nodeType": "ExpressionStatement", "src": "1305:11:6" } ] }, "id": 822, "nodeType": "IfStatement", "src": "1247:76:6", "trueBody": { "id": 817, "nodeType": "Block", "src": "1275:16:6", "statements": [ { "id": 816, "nodeType": "PlaceholderStatement", "src": "1283:1:6" } ] } } ] }, "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": 824, "name": "ifAdmin", "nodeType": "ModifierDefinition", "parameters": { "id": 810, "nodeType": "ParameterList", "parameters": [], "src": "1238:2:6" }, "src": "1222:105:6", "visibility": "internal" }, { "body": { "id": 848, "nodeType": "Block", "src": "2024:100:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "commonType": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" }, "id": 840, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "id": 836, "name": "ADMIN_SLOT", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 809, "src": "2037:10:6", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "6f72672e7a657070656c696e6f732e70726f78792e61646d696e", "id": 838, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2061:28:6", "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": 837, "name": "keccak256", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3151, "src": "2051:9:6", "typeDescriptions": { "typeIdentifier": "t_function_sha3_pure$__$returns$_t_bytes32_$", "typeString": "function () pure returns (bytes32)" } }, "id": 839, "isConstant": false, "isLValue": false, "isPure": true, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2051:39:6", "typeDescriptions": { "typeIdentifier": "t_bytes32", "typeString": "bytes32" } }, "src": "2037:53:6", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 835, "name": "assert", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3146, "src": "2030:6:6", "typeDescriptions": { "typeIdentifier": "t_function_assert_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 841, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2030:61:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 842, "nodeType": "ExpressionStatement", "src": "2030:61:6" }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 844, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3157, "src": "2108:3:6", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 845, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2108:10:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 843, "name": "_setAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 951, "src": "2098:9:6", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 846, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2098:21:6", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 847, "nodeType": "ExpressionStatement", "src": "2098:21:6" } ] }, "documentation": "Contract constructor.\nIt 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.\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": 849, "implemented": true, "isConstructor": true, "isDeclaredConst": false, "modifiers": [ { "arguments": [ { "argumentTypes": null, "id": 831, "name": "_implementation", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 826, "src": "1985:15:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, { "argumentTypes": null, "id": 832, "name": "_data", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 828, "src": "2002:5:6", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes memory" } } ], "id": 833, "modifierName": { "argumentTypes": null, "id": 830, "name": "UpgradeabilityProxy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3028, "src": "1965:19:6", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_UpgradeabilityProxy_$3028_$", "typeString": "type(contract UpgradeabilityProxy)" } }, "nodeType": "ModifierInvocation", "src": "1965:43:6" } ], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 829, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 826, "name": "_implementation", "nodeType": "VariableDeclaration", "scope": 849, "src": "1927:23:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 825, "name": "address", "nodeType": "ElementaryTypeName", "src": "1927:7:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 828, "name": "_data", "nodeType": "VariableDeclaration", "scope": 849, "src": "1952:11:6", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bytes_memory_ptr", "typeString": "bytes" }, "typeName": { "id": 827, "name": "bytes", "nodeType": "ElementaryTypeName", "src": "1952:5:6", "typeDescriptions": { "typeIdentifier": "t_bytes_storage_ptr", "typeString": "bytes" } }, "value": null, "visibility": "internal" } ], "src": "1926:38:6" }, "payable": true, "returnParameters": { "id": 834, "nodeType": "ParameterList", "parameters": [], "src": "2024:0:6" }, "scope": 970, "src": "1915:209:6", "stateMutability": "payable", "superFunction": null, "visibility": "public" }, { "body": { "id": 857, "nodeType": "Block", "src": "2234:26:6", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 854, "name": "_admin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 940, "src": "2247:6:6", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_address_$", "typeString": "function () view returns (address)" } }, "id": 855, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2247:8:6", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "functionReturnParameters": 853, "id": 856, "nodeType": "Return", "src": "2240:15:6" } ] }, "documentation": "@return The address of the proxy admin.", "id": 858, "implemented": true, "isConstructor": false, "isDeclaredConst": true, "modifiers": [], "name": "admin", "nodeType": "FunctionDefinition", "parameters": { "id": 850, "nodeType": "ParameterList", "parameters": [], "src": "2199:2:6" }, "payable": false, "returnParameters": { "id": 853, "nodeType": "ParameterList", "para