From 089d4bc388e9a4e898e9c19d11ed199e19ebf662 Mon Sep 17 00:00:00 2001 From: harpocryptes Date: Tue, 19 Apr 2022 11:43:09 +0200 Subject: [PATCH 1/2] Update comments since dissolve() requires timeout --- contracts/contract/minipool/RocketMinipoolDelegate.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/contract/minipool/RocketMinipoolDelegate.sol b/contracts/contract/minipool/RocketMinipoolDelegate.sol index 82341f5ce..bb86ede5f 100644 --- a/contracts/contract/minipool/RocketMinipoolDelegate.sol +++ b/contracts/contract/minipool/RocketMinipoolDelegate.sol @@ -420,13 +420,13 @@ contract RocketMinipoolDelegate is RocketMinipoolStorageLayout, RocketMinipoolIn } // Dissolve the minipool, returning user deposited ETH to the deposit pool - // Only accepts calls from the minipool owner (node), or from any address if timed out + // Only accepts calls if the minipool has timed out function dissolve() override external onlyInitialised { // Check current status require(status == MinipoolStatus.Initialised || status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while initialised or in prelaunch"); // Load contracts RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool")); - // Check if being dissolved by minipool owner or minipool is timed out + // Check if minipool has timed out require( (status == MinipoolStatus.Prelaunch && block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout()), "The minipool can only be dissolved once it has timed out" From 8ee11695a4055b868d1fc69c9b6fd4019c8a8543 Mon Sep 17 00:00:00 2001 From: harpocryptes Date: Tue, 19 Apr 2022 12:04:53 +0200 Subject: [PATCH 2/2] Simply dissolve() requires Functionally equivalent since status == MinipoolStatus.Prelaunch was required by the second check. --- contracts/contract/minipool/RocketMinipoolDelegate.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/contract/minipool/RocketMinipoolDelegate.sol b/contracts/contract/minipool/RocketMinipoolDelegate.sol index bb86ede5f..53c1dac62 100644 --- a/contracts/contract/minipool/RocketMinipoolDelegate.sol +++ b/contracts/contract/minipool/RocketMinipoolDelegate.sol @@ -423,12 +423,12 @@ contract RocketMinipoolDelegate is RocketMinipoolStorageLayout, RocketMinipoolIn // Only accepts calls if the minipool has timed out function dissolve() override external onlyInitialised { // Check current status - require(status == MinipoolStatus.Initialised || status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while initialised or in prelaunch"); + require(status == MinipoolStatus.Prelaunch, "The minipool can only be dissolved while in prelaunch"); // Load contracts RocketDAOProtocolSettingsMinipoolInterface rocketDAOProtocolSettingsMinipool = RocketDAOProtocolSettingsMinipoolInterface(getContractAddress("rocketDAOProtocolSettingsMinipool")); // Check if minipool has timed out require( - (status == MinipoolStatus.Prelaunch && block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout()), + block.timestamp.sub(statusTime) >= rocketDAOProtocolSettingsMinipool.getLaunchTimeout(), "The minipool can only be dissolved once it has timed out" ); // Perform the dissolution