Run locally
A static site with no framework and no bundler, plus a separate contracts package.
Requirements
You need Node.js. The contracts package asks for Node 22.10 or newer, and the same version works for the site. The browser-driven tools use a local Chrome through Patchright, which npm install at the project root installs.
Commands
npm install
npm run build
npm run serve
| Command | What it does |
|---|---|
npm run build | Composes the pages in src/ into site/. |
npm run serve | Serves the site at http://localhost:8811 with clean URLs, such as /docs/fees. The operator console is at /operator. |
npm test | Runs the site's 19 Node tests in tools/test: the close engine, the Roll format, and the ABI encoding checked against the compiled selectors. |
npm run e2e | Runs tools/e2e-local.mjs against a local Hardhat node. Needs the contracts package installed. |
npm run e2e:operator | Runs tools/e2e-operator.mjs in a real browser. Needs the server on port 8811 and compiled contracts. |
npm run contrast | Runs tools/contrast.mjs, which flags text under a 3:1 contrast ratio in both themes. Needs the server on port 8811. |
npm run close -- month.json | Runs the monthly close. See Operator guide. |
cd contracts && npm install && npm test | Installs and tests the contracts package. |
File map
| Path | Contents |
|---|---|
site/js/config.js | Addresses, links and fee rates, including RULES.tokenFeeBps and RULES.operatorBps. |
site/js/money.js | Money arithmetic in BigInt, for USDG, shares and prices. |
site/js/close.js | The close engine, Roll format v2, the identity checks and SHA-256. |
site/js/sample-data.js | Six sample fee months, generated from a fixed seed and labelled as sample. |
site/js/data.js | Loads the published Rolls, or falls back to the sample set. |
site/js/abi.js | keccak-256 and ABI encoding and decoding, written without a library. |
site/js/wallet.js | EIP-6963 wallet discovery, chain switching, reads through the public RPC and writes through the wallet. |
site/js/facade.js | The street drawing. Its windows are the days of the month. |
site/js/home.js | The home page. |
site/js/token.js | The /token page. |
site/js/roll.js | The /roll page, including the in-browser verifier. |
site/js/vault.js | The /vault page: deposit and cash out. |
site/js/app.js | The /app dashboard. |
site/js/ui.js | Shared interface helpers. |
site/operator/ | The local operator console. site/.vercelignore excludes it from deploys. |
site/data/rolls/ | The published Roll files, listed by index.json. |
src/pages, src/docs | Page sources. Each file starts with a JSON metadata comment, and the build wraps the body in the site layout. |
tools/build-site.mjs | The build, which composes src/ into site/. |
tools/serve.mjs | The local server. |
tools/close.mjs | The monthly close tool. |
tools/export-operator.mjs | Copies the compiled contract bytecode into site/operator/artifacts.js for the console. |
tools/e2e-local.mjs | Drives the site's wallet layer against the real contracts on a local chain. |
tools/e2e-operator.mjs | Drives the operator console in a real browser: deploy, deposit, settle, publish, pause. |
tools/contrast.mjs | The contrast sweep. |
contracts/ | The Solidity contracts and their tests. See Contracts. |
Third-party code
There is no framework and no bundler. GSAP and Phosphor icons load from jsDelivr, and fonts load from Google Fonts. Everything else, keccak-256 and ABI encoding included, lives in the repository.