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

Uninitialized Boolean Variable `useOracle` in `StrategyMainnet.sol`

Summary

The variable useOracle is declared as bool public useOracle; in the StrategyMainnet.sol file but is not explicitly initialized. In Solidity, uninitialized variables are assigned a default value of false. However, the lack of explicit initialization can lead to potential vulnerabilities or misinterpretation of the variable's intended use.

Vulnerability Details

By default, Solidity initializes boolean variables to false. If useOracle controls access to critical logic, such as determining whether to fetch pricing or data from an oracle, its default value might not align with the intended behavior.

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L17

// @audit-issue : useOracle is not initialized .
bool public useOracle;

Impact

If the contract logic relies on useOracle to enable or disable critical functionality, the default false value may unintentionally allow or block certain operations.

Tools Used

Manual Review.

Recommendations

Initialize useOracle with a clear and deliberate value (true or false) in the declaration or constructor, based on the desired default behavior.

Updates

Appeal created

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