Skip to content

Commit

Permalink
fix(refactor): remove cancancelresubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
zgorizzo69 committed May 6, 2022
1 parent e305865 commit 61dd983
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 51 deletions.
2 changes: 1 addition & 1 deletion contracts/facets/MeTokenRegistryFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ contract MeTokenRegistryFacet is
require(LibMeta.msgSender() == meTokenInfo.owner, "!owner");
require(meTokenInfo.targetHubId != 0, "!resubscribing");
require(
IMigration(meTokenInfo.migration).canCancelResubscribe(meToken),
!IMigration(meTokenInfo.migration).isStarted(meToken),
"cannot cancel resubscribe"
);

Expand Down
10 changes: 0 additions & 10 deletions contracts/interfaces/IMigration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,4 @@ interface IMigration {
/// target hub
/// @param meToken Address of meToken
function finishMigration(address meToken) external;

/// @notice Method returns bool if migration started
/// @param meToken Address of meToken
/// @return started True if migration started else false
function migrationStarted(address meToken)
external
view
returns (bool started);

function canCancelResubscribe(address meToken) external view returns (bool);
}
19 changes: 0 additions & 19 deletions contracts/migrations/SameAssetTransferMigration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,6 @@ contract SameAssetTransferMigration is ReentrancyGuard, Vault, IMigration {
usts = _sameAssetMigration[meToken];
}

/// @inheritdoc IMigration
function migrationStarted(address meToken)
external
view
override
returns (bool started)
{
return _sameAssetMigration[meToken].started;
}

function canCancelResubscribe(address meToken)
external
view
override
returns (bool)
{
return !_sameAssetMigration[meToken].started;
}

/// @inheritdoc Vault
function isValid(
bytes memory /* encodedArgs */
Expand Down
21 changes: 0 additions & 21 deletions contracts/migrations/UniswapSingleTransferMigration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -139,27 +139,6 @@ contract UniswapSingleTransferMigration is ReentrancyGuard, Vault, IMigration {
usts = _uniswapSingleTransfers[meToken];
}

/// @inheritdoc IMigration
function migrationStarted(address meToken)
external
view
override
returns (bool started)
{
return _uniswapSingleTransfers[meToken].started;
}

// TODO: inherit
function canCancelResubscribe(address meToken)
external
view
returns (bool)
{
UniswapSingleTransfer storage usts = _uniswapSingleTransfers[meToken];
// Only applies if a metoken is in a state of resubscription and assets haven't moved to migration vault
return (usts.fee != 0 && !usts.started);
}

/// @inheritdoc Vault
function isValid(bytes memory encodedArgs)
external
Expand Down

0 comments on commit 61dd983

Please sign in to comment.