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

`harvestAndReport()` does not execute expected reward claiming and redeployment functionality

Summary

The _harvestAndReport() function is documented and expected to handle "harvesting, rewards selling, accrual, redepositing etc." However, the current implementation only calculates balances without executing any of the core harvesting functionality. Specifically:

  1. While it retrieves the claimable balance, it never claims it from the transmuter

  2. The underlying token swapping logic is commented out

  3. No redeployment of funds occurs

This means the strategy is not automatically compounding rewards or redeploying idle funds during harvest calls as would be expected based on the documentation and typical yield strategy patterns as documented in the yearn v3 strategy docs.
https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L178-L198

function _harvestAndReport()
internal
override
returns (uint256 _totalAssets)
{
uint256 claimable = transmuter.getClaimableBalance(address(this));
if (claimable > 0) {
// transmuter.claim(claimable, address(this));
}
// NOTE : we can do this in harvest or can do seperately in tend
// if (underlying.balanceOf(address(this)) > 0) {
// _swapUnderlyingToAsset(underlying.balanceOf(address(this)));
// }
uint256 unexchanged = transmuter.getUnexchangedBalance(address(this));
// NOTE : possible some dormant WETH that isn't swapped yet (although we can restrict to only claim & swap in one tx)
uint256 underlyingBalance = underlying.balanceOf(address(this));
_totalAssets = unexchanged + asset.balanceOf(address(this)) + underlyingBalance;
}

This is the specs from the official docs:
https://docs.yearn.fi/developers/v3/strategy_writing_guide#_harvestandreport

Purpose:
Called during every report. This should harvest and sell any rewards, reinvest any proceeds, perform any position maintenance and return a full accounting of a trusted amount denominated in the underlying asset the strategy holds.

Updates

Lead Judging Commences

inallhonesty Lead Judge
6 months ago

Appeal created

inallhonesty Lead Judge 6 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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