Steadefi

Steadefi
DeFiHardhatFoundryOracle
35,000 USDC
View results
Submission Details
Severity: low
Invalid

`minWithdrawTokenAmt` is not enforced for LP token withdrawals

Vulnerability Details

The minWithdrawTokenAmt is supposed to be a guarantee for the minimum amount of withdrawal token that would be received. But in implementation, the check is only made if the withdrawal token is either the long or short token.

function processWithdraw(
GMXTypes.Store storage self
) external {
........ more code
// @audit afterWithdrawChecks containing the check for `minWithdrawTokenAmt` is not made if the token is LP token
if (
self.withdrawCache.withdrawParams.token == address(self.tokenA) ||
self.withdrawCache.withdrawParams.token == address(self.tokenB)
) {
....... more code
GMXChecks.afterWithdrawChecks(self);
}

Impact

Users may be misguided and end up receiving lower amount of tokens than the input minWithdrawTokenAmt

Recommendations

Make a separate check minWithdrawTokenAmt check for LP tokens or mention it in the documentation

Updates

Lead Judging Commences

hans Lead Judge almost 2 years ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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