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 testUseful 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:
| Variable | Required | Meaning |
|---|---|---|
RAILGUN_ADDRESS | yes | the deployed RailgunSmartWallet |
TREASURY_ADDRESS | yes | receives the taker fee skimmed from payouts |
CLAIM_WINDOW | yes | seconds a filler has to claim after filling; must be greater than zero |
NOTE_REQUIREMENTS_VERIFIER_ADDRESS | no | reuse 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 --verifyThe 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.jsonSet 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
- Integrating - drive the protocol from a wallet or filler bot.
- Contract reference - the deployed addresses and full interface.