Contributing
Setup#
Requires Node 22 or later.
npm ci
npm test
npm run build # library and CLI into dist/
npm run dev:site # website into site-dist/, served locally
The website is static. scripts/build-site.mjs renders it from site/ and the Markdown
in docs/, and Vercel deploys it on every push to main (see vercel.json).
Before opening a pull request#
npm run lint,npm run typecheck,npm testandnpm run build:sitemust pass.- Add user-facing changes to
CHANGELOG.mdunder "Unreleased". - Keep
src/core/free of I/O. Network, file and DOM code belongs insrc/rpc/,src/cli/andsrc/ui/. - Use
bigintfor every on-chain quantity. No floating point in the core. - Every figure shown to a user carries a label:
observed,derivedorassumed. - Commits follow Conventional Commits (
feat:,fix:,test:,docs:,chore:), one logical change each.
Protocol changes#
Protocol facts come from the pinned upstream commit, never from memory. To move the pin:
- Check out the new upstream commit.
- Run
npm run abi:extract -- /path/to/continuous-clearing-auction. - Re-run the differential test against that checkout (see below) and update
docs/ABI.md.
Differential test#
test/differential.test.ts replays random auctions on the real contract with Foundry and
compares every fill and refund to the TypeScript engine. It is skipped unless you point it
at an upstream checkout with submodules:
git clone --recurse-submodules --branch v2.1.0 \
https://github.com/Uniswap/continuous-clearing-auction.git /tmp/cca
CCA_UPSTREAM_DIR=/tmp/cca CCA_DIFF_CASES=300 npx vitest run test/differential.test.ts
Open work is tracked in GitHub issues.