DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Invalid

Token swaps can be manipulated on Arbitrum by sequencers

Summary

Block timestamps are usually set based on the sequencer's clock. In some cases in can be manuplated to make a bad swaps.

Vulnerability Details

As it says in the Arbitrum official documentation the sequencer can slightly adjust the timestamp of the block to account for the delays and prevent any potential reorganisations of the chain:

https://docs.arbitrum.io/build-decentralized-apps/arbitrum-vs-ethereum/block-numbers-and-time#timestamp-boundaries-of-the-sequencer

The swaps in StrategyArb contract has a block.timestamp argument in the swap function:

function _swapUnderlyingToAsset(uint256 _amount, uint256 minOut, IRamsesRouter.route[] calldata _path) internal {
// TODO : we swap WETH to ALETH -> need to check that price is better than 1:1
// uint256 oraclePrice = 1e18 * 101 / 100;
require(minOut > _amount, "minOut too low");
uint256 underlyingBalance = underlying.balanceOf(address(this));
require(underlyingBalance >= _amount, "not enough underlying balance");
@> IRamsesRouter(router).swapExactTokensForTokens(_amount, minOut, _path, address(this), block.timestamp);
}

So in some cases a sequecer can manipulate a timestamp to frontrun the tx and implement a swap to get profit.

Or, as it sas here:

https://docs.arbitrum.io/for-devs/troubleshooting-building#how-do-blocknumber-and-blocktimestamp-work-on-arbitrum

Solidity calls to block.timestamp on Arbitrum are not linked to the timestamp of the L1 block. It is updated every L2 block based on the sequencer's clock.

In this case the tx may be reversed as the timestamp is passed.

Impact

Swaps can be manipulated on Arbitrum chain.

Tools Used

Manual review.

Recommendations

Consider providing additional time for swaps to be executed.

Updates

Appeal created

inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
inallhonesty Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.