On-chain quoter contracts for DEX aggregation. Provides batch query, storage decoding, and compact encoding for tick-based DEX liquidity data.
forge build
forge test
forge test -vvvv # verboseFill in .env (never committed):
ETHERSCAN_API_KEY=your_etherscan_api_key
ETH_RPC_URL=https://...
BASE_RPC_URL=https://...
# ... other chain RPC URLsReplaces hardcoded addresses in Quote.sol with the correct ones for the target chain:
node scripts/prepare_deploy.js <chain>forge script script/DeployImpl.s.sol:Deploy --rpc-url <chain> --broadcast -vvvvnode scripts/post_deploy.js <chain>Copy the generated verify command from the output and run it. Then restore Quote.sol:
git checkout -- src/Quote.solCopy the generated deploy proxy command from step 4 and run it, then run post_deploy.js again to record proxy addresses.
Uses OpenZeppelin TransparentUpgradeableProxy + ProxyAdmin.
Reads proxy, proxyAdmin, stagedImplementation from scripts/deployed/<chain>/index.js:
node scripts/prepare_upgrade.js <chain>Copy and run the dry-run command from the output first, then the broadcast command.
node scripts/post_upgrade.js <chain>Same script, with --rollback flag:
# Rollback to the most recent previous implementation
node scripts/prepare_upgrade.js <chain> --rollback
# Rollback to a specific history entry (0-based index)
node scripts/prepare_upgrade.js <chain> --rollback --to <N>Then dry-run, broadcast, and promote:
node scripts/post_upgrade.js <chain>| Script | Purpose |
|---|---|
scripts/prepare_deploy.js <chain> |
Write chain addresses into src/Quote.sol constants |
scripts/post_deploy.js <chain> |
Read broadcast output, update deployed/<chain>/index.js |
scripts/prepare_upgrade.js <chain> |
Read index.js, output upgrade/rollback forge command |
scripts/post_upgrade.js <chain> |
Read on-chain state, promote config in index.js |
See scripts/deployed/<chain>/index.js for deployed contract addresses on each chain.