Steadefi

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

Excess eth is not refunded

Summary

The deposit of GMXDeposit supports sender in providing eth(msg.value) to be deposted into vault. Now if user has provided more eth than dp.amt then this excess eth is not refunded back to user.

Vulnerability Details

// file: contracts/strategy/gmx/GMXDeposit.sol#L78-L84
if (isNative) {
GMXChecks.beforeNativeDepositChecks(self, dp);
self.WNT.deposit{ value: dp.amt }(); // @audit check if msg.value > dp.amt , and refund to user
} else {
IERC20(dp.token).safeTransferFrom(msg.sender, address(this), dp.amt); // @audit check if value is 0
}

Impact

The remaining ETH is not refunded to the user.

Tools Used

Manual Review

Recommendations

At the end of deposit function, refund the remaining eth back to the user.

Updates

Lead Judging Commences

hans Lead Judge over 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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