From dbd32c9246b73d3ff759e218ae9728eca8d2e43c Mon Sep 17 00:00:00 2001 From: Shahul Hameed <10547529+shahthepro@users.noreply.github.com> Date: Wed, 24 Apr 2024 10:21:57 +0530 Subject: [PATCH] Allow just unstakes --- contracts/Migrator.sol | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/contracts/Migrator.sol b/contracts/Migrator.sol index d253565e..3aa1a8b9 100644 --- a/contracts/Migrator.sol +++ b/contracts/Migrator.sol @@ -167,10 +167,6 @@ contract Migrator is Governable { revert MigrationIsInactive(); } - if (newStakeAmount == 0) { - revert InvalidStakeAmount(); - } - if (lockupIds.length == 0) { revert LockupIdsRequired(); } @@ -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); }