L-03. Wrong errors are used for reverts

Submitted by SBSecurity.

Relevant GitHub Links

Summary

There are checks that revert with wrong errors

Vulnerability Details

Reverts:
plain text
File: contracts/strategy/gmx/GMXChecks.sol // Should be Errors.EmptyDepositAmount 68: if (self.depositCache.depositParams.amt == 0) revert Errors.InsufficientDepositAmount(); // Should be Errors.EmptyDepositAmount 74: if (depositValue == 0) revert Errors.InsufficientDepositAmount(); // Should be Errors.EmptyDepositAmount 351: if (self.compoundCache.depositValue == 0) revert Errors.InsufficientDepositAmount();

Impact

This can lead to user confusion as they won't receive the accurate revert reason.

Tools Used

Manual