When a profit/loss is realised through the TokenizedStrategy::report() we implement the _harvestAndReport for accurate acounting of new totalAssets i.e. if the new totalAssets is more than the old totalAssets we have a profit and vice versa.
As we can see from the report function in TokenizedStrategy contract, we use harvestAndReport to calculate any profits/loss.
The problem is our implementation of the internal _harvestAndReport function is inacurate and reports an invalid amount of newTotalAssets.
Lets look for the StrategyOp::_harvestAndReport :
As we can see, the function falis to add claimable amount in the _totalAssets calculation.
The _totalAssets adds unexchanged balance but not claimable which means it will report a loss breaking the strategy and making a loss for the users.
Example:
users deposit 1000 alETH, old totalAsset = 1000
and say we make a 2x profit,
and currently, unexchanged = 1200 alETH, exchanged/claimable = 800 WETH
now, expected new totalAssets = 1200 + 800 = 2000
reported new totalAssets = 1200 only
Note: the comment;
should not be mistaken for the claimable/exchanged tokens because the claimable tokens are held by the transmuter contract.
Also note that the report function is restricted to only the Keeper role but it doesn't matter and will happen regardless.
This issue can also be seen in StrategyMainnet and StrategyArb contracts.
Profit accounting is broken and users are at loss when they should be profiting.
manual
For the StrategyMainnet and StrategyArb, we can also mitigate it by removing the comments, but still we need to make some adjustments which would be more complex than the provided solution above and introduce another issue. So, the given mitigation should be enough for all the contracts.
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.