DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Invalid

Typo in the _freeFunds function

Summary

In the _freeFunds function of all three smart contracts (StrategyArb.sol, StrategyMainnet.sol, StrategyOp.sol), a local variable totalAvailabe is introduced with a typo. While this does not impact functionality, it may reduce code readability and maintainability.

Vulnerability Details

The _freeFunds function includes a typo in the declaration of the local variable totalAvailabe (misspelled as "Availabe" instead of "Available"). This variable is used three times within the function, making the typo more prominent and increasing the likelihood of confusion or future errors.

Affected Code:

function _freeFunds(uint256 _amount) internal override {
uint256 totalAvailabe = transmuter.getUnexchangedBalance(address(this));
if (_amount > totalAvailabe) {
transmuter.withdraw(totalAvailabe, address(this));
} else {
transmuter.withdraw(_amount, address(this));
}
}

Impact

This typo has the following implications:

  • Reduced Readability: The typo might make the code harder to read and understand.

  • Credibility Concerns: Such errors can lower confidence in the code's quality, especially during audits.

  • Potential for Future Errors: Misunderstandings or additional errors might be introduced during subsequent updates or maintenance.

Tools Used

Manual inspection.

Recommendations

Update the variable name from totalAvailabe to totalAvailable to improve code readability and adhere to best practices.

Updates

Appeal created

inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
inallhonesty Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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