Skip to content

Commit a81179b

Browse files
committed
Consistency in dissolve()
Comments implied it could be used either by anyone when an NO failed to move forward in prelaunch OR by the NO at that same time or while in queue. However, the functionality only allowed the former. Updated code/comments to explicitly only do the former.
1 parent 5f8d4e5 commit a81179b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

contracts/contract/minipool/RocketMinipoolDelegate.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,15 @@ contract RocketMinipoolDelegate is RocketMinipoolStorageLayout, RocketMinipoolIn
420420
}
421421

422422
// Dissolve the minipool, returning user deposited ETH to the deposit pool
423-
// Only accepts calls from the minipool owner (node), or from any address if timed out
423+
// Only accepts calls when in Prelaunch for too long without calling stake()
424+
// In other words, this prevents User ETH from getting stuck when an NO fails to move forward
424425
function dissolve() override external onlyInitialised {
425426
// Check current status
426-
require(status == MinipoolStatus.Initialised || status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while initialised or in prelaunch");
427+
require(status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while in prelaunch");
427428
// Load contracts
428429
RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool"));
429-
// Check if being dissolved by minipool owner or minipool is timed out
430430
require(
431-
(status == MinipoolStatus.Prelaunch && block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout()),
431+
(block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout()),
432432
"The minipool can only be dissolved once it has timed out"
433433
);
434434
// Perform the dissolution

0 commit comments

Comments
 (0)