A more universal router than Uniswap's Universal Router which additionally supports flash swap, chained V2 swaps on any DEX, enabling risk-free arbitrage.
Smart contracts allows EOAs to interact with the blockchain programmatically, to some extent. Unlike Cosmos, each Ethereum transaction can only contain a call to a contract. While the contract called can subsequently call as many other contracts as EVM allows, the sequence of actions is predefined when the contract is deployed. To change the logic or to program the transaction differently, usually a new contract has to be written and deployed, which is a lot of effort and overhead.
While the Multicall contract allows multiple contract calls to be executed
sequentially, it has its limitations. On the one hand, using it requires the knowledge and familiarity
with ABI encoding/decoding. On the other hand, it lacks certain
callback functions required by popular contracts, e.g.
onERC721Received
,
onERC1155Received
,
uniswapV2Call
.
With the advance of Universal Router from Uniswap, one can program transactions offchain and interact with popular contracts/protocols using a more friendly interface without the need to deploy his own contract.
Refer to the original repo.
┌──────┬───────────────────────────────┐
│ 0x00 │ V3_SWAP_EXACT_IN │
├──────┼───────────────────────────────┤
│ 0x01 │ V3_SWAP_EXACT_OUT │
├──────┼───────────────────────────────┤
│ 0x02 │ PERMIT2_TRANSFER_FROM │
├──────┼───────────────────────────────┤
│ 0x03 │ PERMIT2_PERMIT_BATCH │
├──────┼───────────────────────────────┤
│ 0x1e-│ ------- │
│ 0x3f │ │
└──────┴───────────────────────────────┘
yarn install
forge install
yarn run prettier
forge build
forge test
forge snapshot