Keepers have the ability to call a function to harvest and record all profits accrued or losses incurred within the strategy. This function is utilized in the TokenizedStrategy implementation contract on Yearn Finance:
https://github.com/yearn/tokenized-strategy/blob/master/src/TokenizedStrategy.sol#L1081
During this call, specific code in the BaseStrategy will be executed to retrieve the total assets currently held:
All three strategies override the _harvestAndReport call with the same logic.
https://github.com/Cyfrin/2024-12-alchemix/blob/main/src/StrategyMainnet.sol#L172
The main purpose of this function is to return an accurate count of alETH held by the strategy along with its idle tokens, enabling the report call within the strategy to accurately calculate new fees and assets. This function also includes the balance of WETH that has not yet been swapped, as noted in the comment. However, this dormant WETH won't be swappable since the only place where WETH is swapped is during the claimAndSwap call, which takes WETH from the Transumer contract, not directly from the strategy contract itself.
This will lead to inaccurate totalAssets reported by the _harvestAndReport() function because it includes the WETH balance that can't be swapped for alETH. This miscalculation will be used by the report function, leading to consequences like:
Virtually increased profit and minting shares for fee recipients for assets not actually held by the strategy.
Invalid totalAssets updates that do not reflect the real, available amount of alETH.
Likelihood: Medium
For this to happen, there must be some WETH directly held by the strategy. Although WETH is not meant to be directly held by the strategy, as it would be immediately sold during the claimAndSwap, it is possible to donate some WETH directly to this contract. This would then be locked and erroneously included in the accounting during the harvest call.
Impact: Medium
New fee shares will be minted for assets not held by the strategy, which will dilute the price of the share. Also, totalAssets won't represent the real assets held by the strategy.
Manual review.
When calculating totalAssets during the harvest and report call, two options are available:
Swap all WETH held by the strategy to alETH during the call.
Exclude WETH from the totalAssets calculation and implement a separate method that will swap WETH directly held by the contract.
The first option is more gas-consuming since it requires a swap to be executed on every report from the keeper. Therefore, the second approach is recommended. This new method is not expected to be called frequently, only when there are some locked underlying tokens.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.