- Create
.env
file with api key
INFURA_API_KEY='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
- Run yarn commands to compile and test
yarn install
yarn compile
yarn test
forge install
forge build
forge test
This bytes string contains 1 byte per command to be executed.
Each command is a bytes1
containing the following 8 bits:
0 1 2 3 4 5 6 7
┌─┬───┬─────────┐
│f│ r | command │
└─┴───┴─────────┘
-
f
is a single bit flag, that signals whether or not the command should be allowed to revert. Iff
isfalse
, and the command reverts, then the entire transaction will revert. -
r
is two bits of reserved space. This will easily allow us to increase the space used for commands, or add new flags in future. -
command
is a 5 bit unique identifier for the command that should be carried out. The value that selects the corresponding call type is described in the table below:'
┌──────┬────────────────────┐
│ 0x00 │ Permit │
├──────┼────────────────────┤
│ 0x01 │ Transfer │
├──────┼────────────────────┤
│ 0x02 │ V3ExactIn │
├──────┼────────────────────┤
│ 0x03 │ V3ExactOut │
├──────┼────────────────────┤
│ 0x04 │ V2ExactIn │
├──────┼────────────────────┤
│ 0x05 │ V2ExactOut │
├──────┼────────────────────┤
│ 0x06 │ Seaport │
├──────┼────────────────────┤
│ 0x07 │ WrapETH │
├──────┼────────────────────┤
│ 0x08 │ UnwrapWETH │
├──────┼────────────────────┤
│ 0x09 │ Sweep │
├──────┼────────────────────┤
│ 0x0a │ NFTX │
├──────┼────────────────────┤
│ 0x0b │ LooksRare721 │
├──────┼────────────────────┤
│ 0x0c │ X2Y2721 │
├──────┼────────────────────┤
│ 0x0d │ LooksRare1155 │
├──────┼────────────────────┤
│ 0x0e │ X2Y21155 │
├──────┼────────────────────┤
│ 0x0f │ Foundation │
├──────┼────────────────────┤
│ 0x10 │ SweepWithFee │
├──────┼────────────────────┤
│ 0x11 │ UnwrapWETHWithFee │
└──────┴────────────────────┘
This array contains the abi encoded parameters to provide for each command.
The command located at commands[i]
has its corresponding input parameters located at inputs[i]
.