Skip to content

Commit

Permalink
Allow just unstakes
Browse files Browse the repository at this point in the history
  • Loading branch information
shahthepro committed Apr 24, 2024
1 parent 8d9a779 commit dbd32c9
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions contracts/Migrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,6 @@ contract Migrator is Governable {
revert MigrationIsInactive();
}

if (newStakeAmount == 0) {
revert InvalidStakeAmount();
}

if (lockupIds.length == 0) {
revert LockupIdsRequired();
}
Expand Down Expand Up @@ -198,19 +194,20 @@ contract Migrator is Governable {
}

uint256 ognToWallet = ognAmountFromWallet - newStakeAmount;

if (ognToWallet > 0) {
ogn.transfer(msg.sender, ognToWallet);
}

// Stake it
ognStaking.stake(
newStakeAmount,
newStakeDuration,
msg.sender,
false,
-1 // New stake
);
if (newStakeAmount > 0) {
// Stake it
ognStaking.stake(
newStakeAmount,
newStakeDuration,
msg.sender,
false,
-1 // New stake
);
}

emit LockupsMigrated(msg.sender, lockupIds, newStakeAmount, newStakeDuration);
}
Expand Down

0 comments on commit dbd32c9

Please sign in to comment.