The function _swapUnderlyingToAsset in StrategyArb.sol
contract uses the block.timestamp
as the deadline
for the IRamsesRouter(router).swapExactTokensForTokens
call:
Using block.timestamp
as the deadline is effectively a no-operation that has no effect nor protection, since block.timestamp
will take the timestamp value when the transaction gets mined. This provides no meaningful protection against delayed transaction during congested network conditions, potentially leading to unfavorable swaps.
Lack of deadline enforcement can result in swap execution at significantly different prices than anticipated, leading to slippage or losses.
Manual Review
Add a deadline parameter to the _swapUnderlyingToAsset
function. This parameter should define a future timestamp (e.g., block.timestamp + X seconds) to provide effective protection against stale or delayed transactions:
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.