- AsyncCSMM - hook contract
- Router - add liquidity, swap & fill async orders
- Live Demo Frontend
- Video Walkthrough
- Transaction Ordering rules walkthorugh video
To install dependencies in all our packages in packages/*
bun installInstall foundry dependencies (v4-periphery)
forge installTip
We suggest you set up local anvil account with cast.
cast wallet import --mnemonic "test test test test test test test test test test test junk" anvil- This will allow you to use
--account anvilin the deploys scripts in.dev/start_script.sh
Run local anvil node with Unichain fork
anvil --fork-url https://unichain.drpc.org
# or simulate block mining and finality
anvil --block-time 13Run deployment script
./dev/start_script.sh # scripts that you use --account setup of you choiceNote
The start scripts will do the following:
- Deploy local PoolManger
./script/00_DeployPoolManager.s.sol - Deploy Hook & Router contracts
./script/01_DeployHook.s.sol - Initialize a pool with your hook attached
./script/02_InitilizePool.s.sol - Add liqudity to previously initialized pool
./script/03_AddLiquidity.s.sol - Submit an async swap transaction through custom router
./script/04_Swap.s.sol - Fill previously submitted swap transaction
./script/05_ExecuteOrder.s.sol
Run tests
forge test -vvvvHuff tests:
# sender is poolManager address
hnc src/AsyncSwap.huff test --sender 0x0000000000000000000000000000000000000000Start local indexer
bun run devTip
- If you need typescript abi for your contracts on frontend or indexer use this script
./dev/generateAbi.sh
./dev/generateAbi.shGo to http://localhost:42069 to query orders from hook events
View documentation:
forge doc --serve --port 4000 --watch
Thanks to Atrium Academy, over the past 2 months we build this project during Uniswap Hook incubator program.
Team Socials: