A headless prototype of how Matcha will use the 0x API & permit2 smart contracts to swap erc20 tokens.
The purpose of this repo is to serve as a guide when integrating the
api/v2/permit2
standard transaction flow
into Matcha. If successful, the script will grant the permit2 contract on mainnet
an infinite allowance to transfer your WETH tokens.
- Bun (v1.1.0+)
- An Ethereum private key
- Create an
.env
file:
cp .env.example .env
- Add your Etheruem private keys & 0x production API key to it.
- Install dependencies
bun install
- Run the script
bun run start