Skip to content

Commit

Permalink
[hebao1.2] update UpgraderModule.sol (#2010)
Browse files Browse the repository at this point in the history
  • Loading branch information
kongliangzhong authored Nov 8, 2020
1 parent 87cd91c commit b5d8caf
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions packages/hebao_v1/contracts/modules/upgrade/UpgraderModule.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import "./SecurityStore_1_1_6.sol";
contract UpgraderModule is BaseModule {
ControllerImpl private immutable controller_;

address public immutable walletImplementation;
address[] public modulesToRemove;
address[] public modulesToAdd;

Expand All @@ -27,7 +26,6 @@ contract UpgraderModule is BaseModule {

constructor(
ControllerImpl _controller,
address _walletImplementation,
address[] memory _modulesToAdd,
address[] memory _modulesToRemove,
address _oldSecurityStore,
Expand All @@ -36,28 +34,13 @@ contract UpgraderModule is BaseModule {
BaseModule(_controller)
{
controller_ = _controller;
walletImplementation = _walletImplementation;
modulesToAdd = _modulesToAdd;
modulesToRemove = _modulesToRemove;

oldSecurityStore = SecurityStore_1_1_6(_oldSecurityStore);
newSecurityStore = SecurityStore(_newSecurityStore);
}

function upgradeWalletImplementation(address payable wallet)
external
{
require(msg.sender == address(this), "NOT_ALLOWED");

if (walletImplementation != OwnedUpgradeabilityProxy(wallet).implementation()) {
bytes memory txData = abi.encodeWithSelector(
OwnedUpgradeabilityProxy.upgradeTo.selector,
walletImplementation
);
transactCall(wallet, wallet, 0, txData);
}
}

function migrateSecurityStore(address wallet)
internal
{
Expand Down Expand Up @@ -90,10 +73,6 @@ contract UpgraderModule is BaseModule {
{
address payable wallet = msg.sender;

if (walletImplementation != address(0)) {
try UpgraderModule(address(this)).upgradeWalletImplementation(wallet) {} catch {}
}

BaseWallet w = BaseWallet(wallet);

// Upgrade the controller if different
Expand Down

0 comments on commit b5d8caf

Please sign in to comment.