From 94c9b7156cc9504f9b02c1207b169a254222847f Mon Sep 17 00:00:00 2001 From: The3D Date: Tue, 13 Oct 2020 10:35:06 +0200 Subject: [PATCH] Added InitializableImmutableAdminUpgradeabilityProxy --- .../ImmutableAdminUpgradeabilityProxy.sol | 35 ------------------- ...zableImmutableAdminUpgradeabilityProxy.sol | 26 ++++++++++++++ 2 files changed, 26 insertions(+), 35 deletions(-) delete mode 100644 contracts/libraries/aave-upgradeability/ImmutableAdminUpgradeabilityProxy.sol create mode 100644 contracts/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol diff --git a/contracts/libraries/aave-upgradeability/ImmutableAdminUpgradeabilityProxy.sol b/contracts/libraries/aave-upgradeability/ImmutableAdminUpgradeabilityProxy.sol deleted file mode 100644 index 5ee8f914..00000000 --- a/contracts/libraries/aave-upgradeability/ImmutableAdminUpgradeabilityProxy.sol +++ /dev/null @@ -1,35 +0,0 @@ -// SPDX-License-Identifier: agpl-3.0 -pragma solidity ^0.6.8; - -import './BaseImmutableAdminUpgradeabilityProxy.sol'; -import '../openzeppelin-upgradeability/UpgradeabilityProxy.sol'; - -/** - * @title AdminUpgradeabilityProxy - * @dev Extends from BaseAdminUpgradeabilityProxy with a constructor for - * initializing the implementation, admin, and init data. - */ -contract ImmutableAdminUpgradeabilityProxy is BaseImmutableAdminUpgradeabilityProxy, UpgradeabilityProxy { - /** - * Contract constructor. - * @param _logic address of the initial implementation. - * @param _admin Address of the proxy administrator. - * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. - * It should include the signature and the parameters of the function to be called, as described in - * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. - * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. - */ - constructor( - address _logic, - address _admin, - bytes memory _data - ) public payable UpgradeabilityProxy(_logic, _data) BaseImmutableAdminUpgradeabilityProxy(_admin) { - } - - /** - * @dev Only fall back when the sender is not the admin. - */ - function _willFallback() internal override(BaseImmutableAdminUpgradeabilityProxy, Proxy) { - BaseImmutableAdminUpgradeabilityProxy._willFallback(); - } -} diff --git a/contracts/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol b/contracts/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol new file mode 100644 index 00000000..9e24d896 --- /dev/null +++ b/contracts/libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: agpl-3.0 +pragma solidity ^0.6.8; + +import './BaseImmutableAdminUpgradeabilityProxy.sol'; +import '../openzeppelin-upgradeability/InitializableUpgradeabilityProxy.sol'; + +/** + * @title InitializableAdminUpgradeabilityProxy + * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for + * initializing the implementation, admin, and init data. + */ +contract InitializableImmutableAdminUpgradeabilityProxy is + BaseImmutableAdminUpgradeabilityProxy, + InitializableUpgradeabilityProxy +{ + + constructor(address admin) public BaseImmutableAdminUpgradeabilityProxy(admin) { + } + + /** + * @dev Only fall back when the sender is not the admin. + */ + function _willFallback() internal override(BaseImmutableAdminUpgradeabilityProxy, Proxy) { + BaseImmutableAdminUpgradeabilityProxy._willFallback(); + } +}