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

Unnecessary State Variables (Unused Functions)

Description:

The contract contains several state variables and functions that are either unused or redundant. These unused elements add unnecessary complexity to the contract and could lead to higher gas costs, making the code harder to maintain and audit.

Unused State Variables:

  • useOracle: Declared as a state variable, but never used in the contract. This variable increases complexity without adding functionality.

Unused Functions:

  • _tend(): This function is marked as an optional override for strategists but is not implemented or called within the contract.

  • _tendTrigger(): Similar to _tend(), this function is not implemented or invoked.

  • _emergencyWithdraw(): This function is a placeholder for emergency withdrawal logic but is not implemented.

  • availableDepositLimit(): This function is designed to implement a deposit limit but lacks logic and is not used.

Impact:

  • Gas Costs: Storing and maintaining unused state variables and functions could unnecessarily increase deployment and transaction costs.

  • Code Maintenance: Unused functions and variables make the contract harder to read, maintain, and audit.

  • Potential Confusion: Developers or auditors might mistakenly assume these variables and functions are part of the logic and impact the contract’s behavior.

Recommendation:

  • Remove Unused Variables and Functions: Remove useOracle, unused mappings (nRoutes, routes, swapParams, pools), and unused functions (_tend(), _tendTrigger(), _emergencyWithdraw(), availableDepositLimit()) from the contract to simplify the code and reduce gas costs.

Updates

Appeal created

inallhonesty Lead Judge 10 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.