Skip to content
Zeno Docs

Quickstart

Prerequisites

Foundry for the contract, and Node.js for the subgraph. The nargo and bb toolchains are only needed to regenerate the note-requirements verifier, which is already committed.

Build and test

Dependencies are git submodules, so fetch them recursively before the first build:

git submodule update --init --recursive
forge build
forge test

Useful variants:

forge test -vvv                        # verbose, matches CI
forge test --match-contract ZenoLOPTest
forge fmt                              # CI runs `forge fmt --check`

Tests run against mocks: a stand-in for the RAILGUN smart wallet that reproduces the adapt-contract binding without snark verification, plus a mock note verifier.

Deploy the contract

The deploy script reads its arguments from the environment:

VariableRequiredMeaning
RAILGUN_ADDRESSyesthe deployed RailgunSmartWallet
TREASURY_ADDRESSyesreceives the taker fee skimmed from payouts
CLAIM_WINDOWyesseconds a filler has to claim after filling; must be greater than zero
NOTE_REQUIREMENTS_VERIFIER_ADDRESSnoreuse an existing UltraHonk verifier; if unset, a fresh one is deployed
RAILGUN_ADDRESS=0x... \
TREASURY_ADDRESS=0x... \
CLAIM_WINDOW=86400 \
  forge script script/DeployZenoLOP.s.sol:DeployZenoLOP \
    --rpc-url "$RPC_URL" --private-key "$PRIVATE_KEY" --broadcast --verify

The script sanity-checks every address and the claim window before broadcasting, so a misconfiguration fails before any transaction is sent.

Deploy the subgraph

After a contract change, regenerate the ABI so the subgraph matches the events:

jq '.abi' out/ZenoLOP.sol/ZenoLOP.json > subgraph/abis/ZenoLOP.json

Set the deployed address, network, and start block in subgraph/networks.json and subgraph.yaml, then build and deploy:

cd subgraph
npm install
npm run codegen
npm run build
goldsky subgraph deploy ZenoLOP/<version> --path .

Next steps