Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: medium
Valid

Fee can be minted even after vault is closed

Vulnerability Details

Even after the vault is closed by invoking the emergencyClose function, fee can still be minted.

function mintFee() public {
_mint(_store.treasury, GMXReader.pendingFee(_store));
_store.lastFeeCollected = block.timestamp;
}

Impact

Fees will be accrued even when there is no work done for management causing user's who withdraw late to loose their deserved funds.

Recommendations

Avoid fee mints if the vault is closed

diff --git a/contracts/strategy/gmx/GMXVault.sol b/contracts/strategy/gmx/GMXVault.sol
index 4f2ecf8..8d61997 100644
--- a/contracts/strategy/gmx/GMXVault.sol
+++ b/contracts/strategy/gmx/GMXVault.sol
@@ -332,6 +332,7 @@ contract GMXVault is ERC20, Ownable2Step, ReentrancyGuard, IGMXVault, IGMXVaultE
* @notice Mint vault token shares as management fees to protocol treasury
*/
function mintFee() public {
+ require(_store.status != GMXTypes.Status.Closed);
_mint(_store.treasury, GMXReader.pendingFee(_store));
_store.lastFeeCollected = block.timestamp;
}
Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Validated
Assigned finding tags:

Disable mintFee during emergency

Impact: High Likelihood: Low Fee calculation must be stopped during an emergency. Typical problem that can happen for pausable protocols.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.