In the convertAccumulatedFeesToWeth() function, the contract performs asset swaps using a DEX strategy. If a custom multi-DEX swap path is enabled, it calls _performMultiDexSwap()
, otherwise, it selects between single-hop and multi-hop swaps based on whether path
is empty. However, there is no validation to check whether the swap actually succeeded before updating the received WETH balance:
If the swap fails due to slippage, liquidity issues, or an incorrect swap path, tokensSwapped
may return 0
, yet the contract continues processing as if the swap succeeded. This results in receivedWethX18
being set to 0
, but the contract still removes the original asset balance from market.receivedFees
, effectively burning the asset without receiving WETH in return.
Failed swaps result in permanent loss of protocol fees, reducing the amount of WETH distributed to LPs and stakeholders, leading to unfair reward allocation and financial loss for the protocol.
Validate that tokensSwapped > 0
before proceeding with WETH distribution and revert the transaction if the swap fails:
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.