Skip to content
This repository has been archived by the owner on Jul 7, 2023. It is now read-only.

Commit

Permalink
C4-519: Fix cancelMinipool to be on minipool creation not rewards sta…
Browse files Browse the repository at this point in the history
…rt time (#215)

* added creation time for cancel fix

* added this back because recreateMinipool uses it

* review comments

* missed this
  • Loading branch information
0xju1ie committed Feb 7, 2023
1 parent 966d8ce commit 9a79014
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions contracts/contract/MinipoolManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,12 @@ contract MinipoolManager is Base, ReentrancyGuard, IWithdrawer {
staking.setRewardsStartTime(mp.owner, mp.initialStartTime);
}

if (staking.getRewardsStartTime(mp.owner) == 0) {
// Edge case where calculateAndDistributeRewards has reset their rewards time even though they are still cycling
// So we re-set it here to their initial start time for this minipool
staking.setRewardsStartTime(mp.owner, mp.initialStartTime);
}

ProtocolDAO dao = ProtocolDAO(getContractAddress("ProtocolDAO"));
uint256 ratio = staking.getCollateralizationRatio(mp.owner);
if (ratio < dao.getMinCollateralizationRatio()) {
Expand Down

0 comments on commit 9a79014

Please sign in to comment.