This repository contains two protocol layers:
Zoltar: the forkable oracle base layerAugur Placeholder: the prediction-market application layer built on top of Zoltar
The codebase is split into two main parts:
solidity/contains the contracts, tests, and generated contract artifactsui/contains the Preact frontend that reads from those contracts
Protocol documentation lives in docs/:
- Bun 1.3+
- Foundry
anvilfor local chain work
On a fresh checkout, start with the root dependency install:
bun install --frozen-lockfileThen run the full bootstrap:
bun run setupInstall anvil if it is not already available:
bun run install:anvilImportant:
bun run setupis the fastest way to get to a working repo after the root install.- Standalone commands like
bun tsc,bun run tsc, andbun run testassume the root dependencies are already installed. - If you skip the initial
bun install --frozen-lockfile, fresh checkouts can fail with missing packages such asbun-types.
Start a local chain with anvil, then run the setup step once and launch the app:
- Start
anvil - Run
bun run setup - Run
bun run app:serve
If you are iterating on the app and want rebuilds, use:
bun run app:watchThe UI read backend defaults to https://ethereum.dark.florist, but you can override it without changing code:
- Add
?rpcUrl=https://your-rpc.exampleto the app URL - Set
localStorage['zoltar.rpcUrl'] - Set
globalThis.__ZOLTAR_RPC_URL__before bootstrapping the app - Set the
ZOLTAR_RPC_URLenvironment variable for environments that injectprocess.env
The UI also supports a walletless browser-local simulation mode for manual QA.
- Run
bun run setup - Run
bun run app:serve - Open
http://localhost:12345/?simulate=1
This mode does not require a wallet extension or anvil. Instead, it boots a Tevm-backed in-browser chain, seeds the QA accounts with ETH, WETH, and REP, and leaves the application contracts undeployed so the UI starts on the deploy flow.
Simulation mode details:
- The activation flag is
?simulate=1 - The flag is intentionally not restricted to localhost or development builds; production deployments may expose it as a browser-local demo and manual-QA path
- The default seeded scenario is
?simulate=1&simScenario=baseline - Supported seeded scenarios are
simScenario=baseline,simScenario=deployed,simScenario=security-pool, andsimScenario=securitypoolx2 - The yellow simulation banner exposes developer-only controls for account switching, reset, block mining, time travel, blockchain time, block count, transaction count, and artificial transaction receipt delay
- Uniswap-backed REP pricing is intentionally disabled in simulation mode, so quote-dependent UI paths degrade instead of using mainnet liquidity
- The simulation chain is ephemeral and exists only in the current browser tab session
Run the full app in development mode. This includes contract generation and the frontend build pipeline:
bun run app:serveWatch and rebuild the full app pipeline:
bun run app:watchBuild the full app:
bun run app:buildRegenerate contract bindings and UI vendor assets:
bun run generateCompile the Solidity contracts:
bun run compile-contractsRun the full test suite:
bun run testRun fast coverage checks:
bun run coverageRun full coverage, including the slow Solidity bytecode trace phase:
bun run coverage:fullType-check the TypeScript code:
bun run tscFormat the codebase:
bun run formatRun linting:
bun run lintAuto-fix lint issues:
bun run lint:fixRun dead-code analysis:
bun run knipAuto-fix dead-code findings:
bun run knip:fixMeasure Solidity gas costs:
bun run gas-costsBy default, gas-costs starts an isolated Anvil node. To measure against an existing local node instead, start Anvil in one terminal:
anvil --host 127.0.0.1 --port 8545 --chain-id 1 --block-base-fee-per-gas 0 --gas-price 0 --no-priority-feeThen run gas-costs against it from another terminal:
ANVIL_RPC=http://127.0.0.1:8545 bun run gas-costsUse ANVIL_RPC=http://host.docker.internal:8545 bun run gas-costs when the command runs from a container that reaches the host through Docker routing.
bun run setupis the quickest way to bootstrap a fresh checkout.bun install --frozen-lockfilemust be run before standalone commands likebun run tscon a fresh checkout.bun run tscis a pure typecheck for the app TypeScript, the Solidity-side TypeScript utilities, and the Bun build/dev scripts. It does not regenerate shared assets or vendor output.bun run testruns the TypeScript check first, then executes the test suite.bun run coverageruns the fast UI and contract TypeScript coverage phases. Usebun run coverage:fullwhen you also need the slower Solidity bytecode trace coverage phase.- The legacy
ui:*commands still exist as compatibility aliases, butapp:*names are the clearer entrypoints because they run more than frontend-only work. - The repo uses exact dependency versions for reproducible installs.