Stratax Contracts

First Flight #57
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: low
Likelihood: low

Magic Number 2 Used for Interest Rate Mode Reduces Clarity

Author Revealed upon completion

Magic Number 2 Used for Interest Rate Mode Reduces Clarity

Description:
Borrow uses a hardcoded 2:

aavePool.borrow(..., 2, ...); // Variable interest rate mode

Impact:
Low. Reduces readability and increases chance of mistakes if reused or changed.

Recommended Mitigation:

+ uint256 internal constant VARIABLE_RATE_MODE = 2;
- aavePool.borrow(flashParams.borrowToken, flashParams.borrowAmount, 2, 0, address(this));
+ aavePool.borrow(flashParams.borrowToken, flashParams.borrowAmount, VARIABLE_RATE_MODE, 0, address(this));

Support

FAQs

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

Give us feedback!