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

Unused Variable in ```_harvestAndReport()```

Summary

While reviewing the StrategyOp contract, I noticed that the variable claimable in the _harvestAndReport() function is declared and assigned the value of transmuter.getClaimableBalance(address(this)) but is never used afterward. This unused variable increases code complexity without contributing to the functionality of the strategy.

Impact

This issue does not pose a direct security risk but could lead to unnecessary gas consumption due to the function call and might confuse developers maintaining the contract. It could also indicate incomplete implementation or leftover code from prior iterations.

Tools Used

VS code / Manual Review

Recommendations

Remove the claimable variable if it is not needed.
Alternatively, integrate its value into the _totalAssets calculation or document why this call is made despite not using the returned value.

Relevant Code

uint256 claimable = transmuter.getClaimableBalance(address(this)); // <--
uint256 unexchanged = transmuter.getUnexchangedBalance(address(this));
uint256 underlyingBalance = underlying.balanceOf(address(this));
_totalAssets = unexchanged + asset.balanceOf(address(this)) + underlyingBalance;
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.