Skip to main content
Use this page when you want a clean local setup before integrating your consumer with the hosted roll.codes coordinator.

Requirements

  • Node.js 20+
  • foundry-zksync
  • A Solidity project where you want to integrate roll.codes

Install foundry-zksync

Abstract uses the zkSync VM, so use the foundry-zksync fork instead of standard Foundry.

Install Solidity dependencies

Add remappings

Your project should include these remappings:

Set the minimum deploy environment

ROLL_COORDINATOR should be the roll.codes coordinator address for the same network as ABSTRACT_RPC_URL. See Deployed addresses for the current network-specific values.

Verify the setup

Run a compile before you move on:
If you are using the starter CLI, you can scaffold first and then run the same verification step in the generated project.

Common setup mistakes

  • using the wrong repo ref in forge install
  • missing the @rollcodes remapping
  • pointing ROLL_COORDINATOR at a different network than ABSTRACT_RPC_URL
  • forgetting that requestRandomNumberWithTraceId is payable on roll.codes and must send requestFee()
  • using plaintext private keys instead of a Foundry keystore account

Quickstart

Continue to the minimal hosted-coordinator integration flow once local setup is ready.

CLI reference

Use the scaffold command and flags to start from a generated project.

Troubleshooting

Fix import, fee, and callback issues if the setup does not compile cleanly.
Last modified on March 9, 2026