UNPKG

@openzeppelin/upgrades

Version:

JavaScript library for the OpenZeppelin smart contract platform

995 lines 212 kB
{ "fileName": "App.sol", "contractName": "App", "source": "pragma solidity ^0.5.0;\n\nimport \"./ImplementationProvider.sol\";\nimport \"./Package.sol\";\nimport \"../upgradeability/AdminUpgradeabilityProxy.sol\";\nimport \"../ownership/Ownable.sol\";\n\n/**\n * @title App\n * @dev Contract for upgradeable applications.\n * It handles the creation of proxies.\n */\ncontract App is OpenZeppelinUpgradesOwnable {\n /**\n * @dev Emitted when a new proxy is created.\n * @param proxy Address of the created proxy.\n */\n event ProxyCreated(address proxy);\n\n /**\n * @dev Emitted when a package dependency is changed in the application.\n * @param providerName Name of the package that changed.\n * @param package Address of the package associated to the name.\n * @param version Version of the package in use.\n */\n event PackageChanged(string providerName, address package, uint64[3] version);\n\n /**\n * @dev Tracks a package in a particular version, used for retrieving implementations\n */\n struct ProviderInfo {\n Package package;\n uint64[3] version;\n }\n\n /**\n * @dev Maps from dependency name to a tuple of package and version\n */\n mapping(string => ProviderInfo) internal providers;\n\n /**\n * @dev Constructor function.\n */\n constructor() public { }\n\n /**\n * @dev Returns the provider for a given package name, or zero if not set.\n * @param packageName Name of the package to be retrieved.\n * @return The provider.\n */\n function getProvider(string memory packageName) public view returns (ImplementationProvider provider) {\n ProviderInfo storage info = providers[packageName];\n if (address(info.package) == address(0)) return ImplementationProvider(0);\n return ImplementationProvider(info.package.getContract(info.version));\n }\n\n /**\n * @dev Returns information on a package given its name.\n * @param packageName Name of the package to be queried.\n * @return A tuple with the package address and pinned version given a package name, or zero if not set\n */\n function getPackage(string memory packageName) public view returns (Package, uint64[3] memory) {\n ProviderInfo storage info = providers[packageName];\n return (info.package, info.version);\n }\n\n /**\n * @dev Sets a package in a specific version as a dependency for this application.\n * Requires the version to be present in the package.\n * @param packageName Name of the package to set or overwrite.\n * @param package Address of the package to register.\n * @param version Version of the package to use in this application.\n */\n function setPackage(string memory packageName, Package package, uint64[3] memory version) public onlyOwner {\n require(package.hasVersion(version), \"The requested version must be registered in the given package\");\n providers[packageName] = ProviderInfo(package, version);\n emit PackageChanged(packageName, address(package), version);\n }\n\n /**\n * @dev Unsets a package given its name.\n * Reverts if the package is not set in the application.\n * @param packageName Name of the package to remove.\n */\n function unsetPackage(string memory packageName) public onlyOwner {\n require(address(providers[packageName].package) != address(0), \"Package to unset not found\");\n delete providers[packageName];\n emit PackageChanged(packageName, address(0), [uint64(0), uint64(0), uint64(0)]);\n }\n\n /**\n * @dev Returns the implementation address for a given contract name, provided by the `ImplementationProvider`.\n * @param packageName Name of the package where the contract is contained.\n * @param contractName Name of the contract.\n * @return Address where the contract is implemented.\n */\n function getImplementation(string memory packageName, string memory contractName) public view returns (address) {\n ImplementationProvider provider = getProvider(packageName);\n if (address(provider) == address(0)) return address(0);\n return provider.getImplementation(contractName);\n }\n\n /**\n * @dev Creates a new proxy for the given contract and forwards a function call to it.\n * This is useful to initialize the proxied contract.\n * @param packageName Name of the package where the contract is contained.\n * @param contractName Name of the contract.\n * @param admin Address of the proxy administrator.\n * @param data Data to send as msg.data to the corresponding 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 * @return Address of the new proxy.\n */\n function create(string memory packageName, string memory contractName, address admin, bytes memory data) payable public returns (AdminUpgradeabilityProxy) {\n address implementation = getImplementation(packageName, contractName);\n AdminUpgradeabilityProxy proxy = (new AdminUpgradeabilityProxy).value(msg.value)(implementation, admin, data);\n emit ProxyCreated(address(proxy));\n return proxy;\n }\n}\n", "sourcePath": "contracts/application/App.sol", "sourceMap": "289:4837:1:-;;;1182:24;8:9:-1;5:2;;;30:1;27;20:12;5:2;1182:24:1;989:10:33;980:6;;:19;;;;;;;;;;;;;;;;;;1047:6;;;;;;;;;;;1014:40;;1043:1;1014:40;;;;;;;;;;;;289:4837:1;;;;;;", "deployedSourceMap": "289:4837:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3607:294;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3607:294:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3607:294:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;3607:294:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;3607:294:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;3607:294:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;3607:294:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;3607:294:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;3607:294:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;3607:294:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;3607:294:1;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1387:317;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1387:317:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1387:317:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1387:317:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1387:317:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1387:317:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1387:317:1;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1812:137:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1812:137:33;;;:::i;:::-;;2490:345:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2490:345:1;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;2490:345:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;2490:345:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;2490:345:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;2490:345:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;2490:345:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;2490:345:1;;;;;;;;;;;;;;:::i;:::-;;1944:197;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1944:197:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1944:197:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;1944:197:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;1944:197:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;1944:197:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;1944:197:1;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;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;1944:197:1;;;;;;;;;;;;;;;;;1124:77:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1124:77:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;1444:90;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1444:90:33;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;3008:289:1;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3008:289:1;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3008:289:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;3008:289:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;3008:289:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;3008:289:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;3008:289:1;;;;;;;;;;;;;;;:::i;:::-;;4713:411;;;;;;13:3:-1;8;5:12;2:2;;;30:1;27;20:12;2:2;4713:411:1;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;4713:411:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4713:411:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;4713:411:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;4713:411:1;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;4713:411:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4713:411:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;4713:411:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;4713:411:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;21:11:-1;8;5:28;2:2;;;46:1;43;36:12;2:2;4713:411:1;;35:9:-1;28:4;12:14;8:25;5:40;2:2;;;58:1;55;48:12;2:2;4713:411:1;;;;;;100:9:-1;95:1;81:12;77:20;67:8;63:35;60:50;39:11;25:12;22:29;11:107;8:2;;;131:1;128;121:12;8:2;4713:411:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;30:3:-1;22:6;14;1:33;99:1;93:3;85:6;81:16;74:27;137:4;133:9;126:4;121:3;117:14;113:30;106:37;;169:3;161:6;157:16;147:26;;4713:411:1;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;2120:107:33;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2120:107:33;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2120:107:33;;;;;;;;;;;;;;;;;;;:::i;:::-;;3607:294:1;3710:7;3725:31;3759:24;3771:11;3759;:24::i;:::-;3725:58;;3822:1;3793:31;;3801:8;3793:31;;;3789:54;;;3841:1;3826:17;;;;;3789:54;3856:8;:26;;;3883:12;3856:40;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3856:40:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;3856:40:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;3856:40:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;3856:40:1;;;;;;;;;;;;;;;;3849:47;;;3607:294;;;;;:::o;1387:317::-;1456:31;1495:25;1523:9;1533:11;1523:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;1523:22:1;;;;;;;;;;;;;;;;;;;;;1495:50;;1588:1;1555:35;;1563:4;:12;;;;;;;;;;;;1555:35;;;1551:73;;;1622:1;1592:32;;;;;1551:73;1660:4;:12;;;;;;;;;;;;:24;;;1685:4;:12;;1660:38;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;1660:38:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;1660:38:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;1660:38:1;;;;;;;;;;;;;;;;1630:69;;;1387:317;;;;:::o;1812:137:33:-;1328:9;:7;:9::i;:::-;1320:18;;;;;;;;1910:1;1873:40;;1894:6;;;;;;;;;;;1873:40;;;;;;;;;;;;1940:1;1923:6;;:19;;;;;;;;;;;;;;;;;;1812:137::o;2490:345:1:-;1328:9:33;:7;:9::i;:::-;1320:18;;;;;;;;2611:7:1;:18;;;2630:7;2611:27;;;;;;;;;;;;;;;;;;;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;2611:27:1;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;2611:27:1;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;2611:27:1;;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;2611:27:1;;;;;;;;;;;;;;;;2603:101;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2735:30;;;;;;;;;2748:7;2735:30;;;;;;2757:7;2735:30;;;2710:9;2720:11;2710:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2710:22:1;;;;;;;;;;;;;;;;;;;;;:55;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;2776:54;2791:11;2812:7;2822;2776:54;;;;;;;;;;;;;;;;;;;;;;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;2776:54:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;2776:54:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2490:345;;;:::o;1944:197::-;2012:7;2021:16;;:::i;:::-;2045:25;2073:9;2083:11;2073:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;2073:22:1;;;;;;;;;;;;;;;;;;;;;2045:50;;2109:4;:12;;;;;;;;;;;;2123:4;:12;;2101:35;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1944:197;;;:::o;1124:77:33:-;1162:7;1188:6;;;;;;;;;;;1181:13;;1124:77;:::o;1444:90::-;1484:4;1521:6;;;;;;;;;;;1507:20;;:10;:20;;;1500:27;;1444:90;:::o;3008:289:1:-;1328:9:33;:7;:9::i;:::-;1320:18;;;;;;;;3139:1:1;3088:53;;3096:9;3106:11;3096:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3096:22:1;;;;;;;;;;;;;;;;;;;;;:30;;;;;;;;;;;;3088:53;;;;3080:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3185:9;3195:11;3185:22;;;;;;;;;;;;;36:153:-1;66:2;61:3;58:11;51:19;36:153;;;182:3;176:10;171:3;164:23;98:2;93:3;89:12;82:19;;123:2;118:3;114:12;107:19;;148:2;143:3;139:12;132:19;;36:153;;;274:1;267:3;263:2;259:12;254:3;250:22;246:30;315:4;311:9;305:3;299:10;295:26;356:4;350:3;344:10;340:21;389:7;380;377:20;372:3;365:33;3:399;;;3185:22:1;;;;;;;;;;;;;;;;;;;;;;3178:29;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;3218:74;3233:11;3254:1;3218:74;;;;;;;;;3266:1;3218:74;;;;;;;;3277:1;3218:74;;;;;;;;3288:1;3218:74;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3218:74:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;3218:74:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3008:289;:::o;4713:411::-;4842:24;4875:22;4900:44;4918:11;4931:12;4900:17;:44::i;:::-;4875:69;;4951:30;5021:9;5032:14;5048:5;5055:4;4984:76;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;4984:76:1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8:9:-1;5:2;;;45:16;42:1;39;24:38;77:16;74:1;67:27;5:2;4984:76:1;;;4951:109;;5072:28;5093:5;5072:28;;;;;;;;;;;;;;;;;;;;;;5114:5;5107:12;;;;4713:411;;;;;;:::o;2120:107:33:-;1328:9;:7;:9::i;:::-;1320:18;;;;;;;;2192:28;2211:8;2192:18;:28::i;:::-;2120:107;:::o;2371:183::-;2464:1;2444:22;;:8;:22;;;;2436:31;;;;;;;;2511:8;2482:38;;2503:6;;;;;;;;;;;2482:38;;;;;;;;;;;;2539:8;2530:6;;:17;;;;;;;;;;;;;;;;;;2371:183;:::o;289:4837:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;:::o;:::-;;;;;;;;;;;;29:2:-1;21:6;17:15;117:4;105:10;97:6;88:34;148:4;140:6;136:17;126:27;;0:157;289:4837:1;;;;:::o;:::-;;;;;:::o;:::-;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o", "abi": [ { "constant": true, "inputs": [ { "name": "packageName", "type": "string" }, { "name": "contractName", "type": "string" } ], "name": "getImplementation", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [ { "name": "packageName", "type": "string" } ], "name": "getProvider", "outputs": [ { "name": "provider", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "packageName", "type": "string" }, { "name": "package", "type": "address" }, { "name": "version", "type": "uint64[3]" } ], "name": "setPackage", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": true, "inputs": [ { "name": "packageName", "type": "string" } ], "name": "getPackage", "outputs": [ { "name": "", "type": "address" }, { "name": "", "type": "uint64[3]" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "owner", "outputs": [ { "name": "", "type": "address" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": true, "inputs": [], "name": "isOwner", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "packageName", "type": "string" } ], "name": "unsetPackage", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [ { "name": "packageName", "type": "string" }, { "name": "contractName", "type": "string" }, { "name": "admin", "type": "address" }, { "name": "data", "type": "bytes" } ], "name": "create", "outputs": [ { "name": "", "type": "address" } ], "payable": true, "stateMutability": "payable", "type": "function" }, { "constant": false, "inputs": [ { "name": "newOwner", "type": "address" } ], "name": "transferOwnership", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "proxy", "type": "address" } ], "name": "ProxyCreated", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": false, "name": "providerName", "type": "string" }, { "indexed": false, "name": "package", "type": "address" }, { "indexed": false, "name": "version", "type": "uint64[3]" } ], "name": "PackageChanged", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "previousOwner", "type": "address" }, { "indexed": true, "name": "newOwner", "type": "address" } ], "name": "OwnershipTransferred", "type": "event" } ], "ast": { "absolutePath": "contracts/application/App.sol", "exportedSymbols": { "App": [ 325 ] }, "id": 326, "nodeType": "SourceUnit", "nodes": [ { "id": 70, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:1" }, { "absolutePath": "contracts/application/ImplementationProvider.sol", "file": "./ImplementationProvider.sol", "id": 71, "nodeType": "ImportDirective", "scope": 326, "sourceUnit": 453, "src": "25:38:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/application/Package.sol", "file": "./Package.sol", "id": 72, "nodeType": "ImportDirective", "scope": 326, "sourceUnit": 794, "src": "64:23:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/upgradeability/AdminUpgradeabilityProxy.sol", "file": "../upgradeability/AdminUpgradeabilityProxy.sol", "id": 73, "nodeType": "ImportDirective", "scope": 326, "sourceUnit": 5534, "src": "88:56:1", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "contracts/ownership/Ownable.sol", "file": "../ownership/Ownable.sol", "id": 74, "nodeType": "ImportDirective", "scope": 326, "sourceUnit": 5494, "src": "145:34:1", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 75, "name": "OpenZeppelinUpgradesOwnable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5493, "src": "305:27:1", "typeDescriptions": { "typeIdentifier": "t_contract$_OpenZeppelinUpgradesOwnable_$5493", "typeString": "contract OpenZeppelinUpgradesOwnable" } }, "id": 76, "nodeType": "InheritanceSpecifier", "src": "305:27:1" } ], "contractDependencies": [ 5493, 5533 ], "contractKind": "contract", "documentation": "@title App\n@dev Contract for upgradeable applications.\nIt handles the creation of proxies.", "fullyImplemented": true, "id": 325, "linearizedBaseContracts": [ 325, 5493 ], "name": "App", "nodeType": "ContractDefinition", "nodes": [ { "anonymous": false, "documentation": "@dev Emitted when a new proxy is created.\n@param proxy Address of the created proxy.", "id": 80, "name": "ProxyCreated", "nodeType": "EventDefinition", "parameters": { "id": 79, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 78, "indexed": false, "name": "proxy", "nodeType": "VariableDeclaration", "scope": 80, "src": "463:13:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 77, "name": "address", "nodeType": "ElementaryTypeName", "src": "463:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "462:15:1" }, "src": "444:34:1" }, { "anonymous": false, "documentation": "@dev Emitted when a package dependency is changed in the application.\n@param providerName Name of the package that changed.\n@param package Address of the package associated to the name.\n@param version Version of the package in use.", "id": 90, "name": "PackageChanged", "nodeType": "EventDefinition", "parameters": { "id": 89, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 82, "indexed": false, "name": "providerName", "nodeType": "VariableDeclaration", "scope": 90, "src": "767:19:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string" }, "typeName": { "id": 81, "name": "string", "nodeType": "ElementaryTypeName", "src": "767:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 84, "indexed": false, "name": "package", "nodeType": "VariableDeclaration", "scope": 90, "src": "788:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 83, "name": "address", "nodeType": "ElementaryTypeName", "src": "788:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 88, "indexed": false, "name": "version", "nodeType": "VariableDeclaration", "scope": 90, "src": "805:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint64_$3_memory_ptr", "typeString": "uint64[3]" }, "typeName": { "baseType": { "id": 85, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "805:6:1", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "id": 87, "length": { "argumentTypes": null, "hexValue": "33", "id": 86, "isConstant": false, "isLValue": false, "isPure": false, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "812:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": null, "typeString": null }, "value": "3" }, "nodeType": "ArrayTypeName", "src": "805:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint64_$3_storage_ptr", "typeString": "uint64[3]" } }, "value": null, "visibility": "internal" } ], "src": "766:57:1" }, "src": "746:78:1" }, { "canonicalName": "App.ProviderInfo", "id": 97, "members": [ { "constant": false, "id": 92, "name": "package", "nodeType": "VariableDeclaration", "scope": 97, "src": "954:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_Package_$793", "typeString": "contract Package" }, "typeName": { "contractScope": null, "id": 91, "name": "Package", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 793, "src": "954:7:1", "typeDescriptions": { "typeIdentifier": "t_contract$_Package_$793", "typeString": "contract Package" } }, "value": null, "visibility": "internal" }, { "constant": false, "id": 96, "name": "version", "nodeType": "VariableDeclaration", "scope": 97, "src": "975:17:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint64_$3_storage_ptr", "typeString": "uint64[3]" }, "typeName": { "baseType": { "id": 93, "name": "uint64", "nodeType": "ElementaryTypeName", "src": "975:6:1", "typeDescriptions": { "typeIdentifier": "t_uint64", "typeString": "uint64" } }, "id": 95, "length": { "argumentTypes": null, "hexValue": "33", "id": 94, "isConstant": false, "isLValue": false, "isPure": false, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "982:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": null, "typeString": null }, "value": "3" }, "nodeType": "ArrayTypeName", "src": "975:9:1", "typeDescriptions": { "typeIdentifier": "t_array$_t_uint64_$3_storage_ptr", "typeString": "uint64[3]" } }, "value": null, "visibility": "internal" } ], "name": "ProviderInfo", "nodeType": "StructDefinition", "scope": 325, "src": "928:69:1", "visibility": "public" }, { "constant": false, "id": 101, "name": "providers", "nodeType": "VariableDeclaration", "scope": 325, "src": "1083:50:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_ProviderInfo_$97_storage_$", "typeString": "mapping(string => struct App.ProviderInfo)" }, "typeName": { "id": 100, "keyType": { "id": 98, "name": "string", "nodeType": "ElementaryTypeName", "src": "1091:6:1", "typeDescriptions": { "typeIdentifier": "t_string_storage_ptr", "typeString": "string" } }, "nodeType": "Mapping", "src": "1083:31:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_ProviderInfo_$97_storage_$", "typeString": "mapping(string => struct App.ProviderInfo)" }, "valueType": { "contractScope": null, "id": 99, "name": "ProviderInfo", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 97, "src": "1101:12:1", "typeDescriptions": { "typeIdentifier": "t_struct$_ProviderInfo_$97_storage_ptr", "typeString": "struct App.ProviderInfo" } } }, "value": null, "visibility": "internal" }, { "body": { "id": 104, "nodeType": "Block", "src": "1203:3:1", "statements": [] }, "documentation": "@dev Constructor function.", "id": 105, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 102, "nodeType": "ParameterList", "parameters": [], "src": "1193:2:1" }, "returnParameters": { "id": 103, "nodeType": "ParameterList", "parameters": [], "src": "1203:0:1" }, "scope": 325, "src": "1182:24:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 140, "nodeType": "Block", "src": "1489:215:1", "statements": [ { "assignments": [ 113 ], "declarations": [ { "constant": false, "id": 113, "name": "info", "nodeType": "VariableDeclaration", "scope": 140, "src": "1495:25:1", "stateVariable": false, "storageLocation": "storage", "typeDescriptions": { "typeIdentifier": "t_struct$_ProviderInfo_$97_storage_ptr", "typeString": "struct App.ProviderInfo" }, "typeName": { "contractScope": null, "id": 112, "name": "ProviderInfo", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 97, "src": "1495:12:1", "typeDescriptions": { "typeIdentifier": "t_struct$_ProviderInfo_$97_storage_ptr", "typeString": "struct App.ProviderInfo" } }, "value": null, "visibility": "internal" } ], "id": 117, "initialValue": { "argumentTypes": null, "baseExpression": { "argumentTypes": null, "id": 114, "name": "providers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 101, "src": "1523:9:1", "typeDescriptions": { "typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_ProviderInfo_$97_storage_$", "typeString": "mapping(string memory => struct App.ProviderInfo storage ref)" } }, "id": 116, "indexExpression": { "argumentTypes": null, "id": 115, "name": "packageName", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 107, "src": "1533:11:1", "typeDescriptions": { "typeIdentifier": "t_string_memory_ptr", "typeString": "string memory" } }, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "nodeType": "IndexAccess", "src": "1523:22:1", "typeDescriptions": { "typeIdentifier": "t_struct$_ProviderInfo_$97_storage", "typeString": "struct App.ProviderInfo storage ref" } }, "nodeType": "VariableDeclarationStatement", "src": "1495:50:1" }, { "condition": { "argumentTypes": null, "commonType": { "typeIdentifier": "t_address", "typeString": "address" }, "id": 125, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 119, "name": "info", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 113, "src": "1563:4:1", "typeDescriptions": { "typeIdentifier": "t_struct$_ProviderInfo_$97_storage_ptr", "typeString": "struct App.ProviderInfo storage pointer" } }, "id": 120, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "package", "nodeType": "MemberAccess", "referencedDeclaration": 92, "src": "1563:12:1", "typeDescriptions": { "typeIdentifier": "t_contract$_Package_$793", "typeString": "contract Package" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Package_$793", "typeString": "contract Package" } ], "id": 118, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1555:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 121, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1555:21:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "nodeType": "BinaryOperation", "operator": "==", "rightExpression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 123, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1588:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 122, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "1580:7:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": "address" }, "id": 124, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1580:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } }, "src": "1555:35:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 130, "nodeType": "IfStatement", "src": "1551:73:1", "trueBody": { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "hexValue": "30", "id": 127, "isConstant": false, "isLValue": false, "isPure": true, "kind": "number", "lValueRequested": false, "nodeType": "Literal", "src": "1622:1:1", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" }, "value": "0" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_rational_0_by_1", "typeString": "int_const 0" } ], "id": 126, "name": "ImplementationProvider", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 452, "src": "1599:22:1", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_ImplementationProvider_$452_$", "typeString": "type(contract ImplementationProvider)" } }, "id": 128, "isConstant": false, "isLValue": false, "isPure": true, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1599:25:1", "typeDescriptions": { "typeIdentifier": "t_contract$_ImplementationProvider_$452", "typeString": "contract ImplementationProvider" } }, "functionReturnParameters": 111, "id": 129, "nodeType": "Return", "src": "1592:32:1" } }, { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 135, "name": "info", "nodeType": "Identifier", "overloadedDeclaration