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

Unused Local variables

Vulnerability Details

The codebase contains instances where local variables are declared but remain unused throughout the implementation.

Instance 1:

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

uint256 claimable = transmuter.getClaimableBalance(address(this));

Instance 2:

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/periphery/StrategyAprOracle.sol#L29

address _strategy,

Instance 3:

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/periphery/StrategyAprOracle.sol#L30

int256 _delta

Instances from the test suite:

Instance 4:

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/mock/TokenAdapterMock.sol#L40C17-L40C27

uint256 balBefore = IERC20(IYieldToken(token).underlying()).balanceOf(address(this));
Instance 5:

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/test/Operation.t.sol#L166

(uint256 profit, uint256 loss) = strategy.report();

NOTE: The check in which the above variable are being used is commented in the Test.

Instance 6:

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/test/Oracle.t.sol#L16C53-L16C59

function checkOracle(address _strategy, uint256 _delta) public {

Tools Used

Manual Review and compiler

Recommendations

Remove or Utilize Unused Variables and Parameters: Unused variables and parameters should either be removed or appropriately used to improve clarity and reduce gas costs.

Updates

Appeal created

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

Give us feedback!