The StrategyOp contract assumes that the asset and underlying tokens (alETH and WETH) conform to the standard ERC20 behavior, where the amount of tokens transferred is equal to the amount specified in the transfer or transferFrom function calls. However, if a token implements a fee-on-transfer (deflationary token), where a portion of the tokens is burned or taken as a fee during transfers, this assumption fails.
For example, in the _swapUnderlyingToAsset function:
If the underlying token (WETH) were a deflationary token, transferring _amount to the router could result in the router receiving fewer tokens than _amount, potentially causing the swap to fail or receive less output than expected.
Similarly, when depositing or withdrawing from the transmuter, the contract could experience discrepancies in the amounts due to the token's deflationary mechanics.
Swap Failures: Swaps might fail or result in receiving fewer tokens than expected, leading to slippage or unmet minOut requirements.
Incorrect Accounting: The strategy's internal accounting might become inaccurate, leading to potential losses or miscalculations in yields and shares.
Operational Issues: Repeated failures or discrepancies could affect the strategy's performance and reliability.
Scenario:
Assume that the underlying token starts charging a 1% fee on every transfer.
Swap Attempt:
The strategy attempts to swap 100 WETH for alETH.
Due to the fee, only 99 WETH are received by the router.
Outcome:
The swap may fail because the router did not receive the expected amount.
Alternatively, the swap completes but results in fewer asset tokens received, potentially violating the minOut condition.
Implement Amount Checks Post-Transfer:
After transferring tokens, verify the actual amount received or remaining balances to adjust calculations accordingly.
Use safeTransferFrom and Check Return Values:
When using SafeERC20.safeTransferFrom, confirm that the actual transferred amount matches expectations.
Adjust for Fee-on-Transfer Tokens:
Introduce logic to handle tokens with transfer fees.
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.