> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roll.codes/llms.txt
> Use this file to discover all available pages before exploring further.

# Install and setup

> Set up Foundry, install roll.codes dependencies, and configure your project to use the hosted roll.codes coordinator.

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.

```bash theme={null}
curl -L https://raw.githubusercontent.com/matter-labs/foundry-zksync/main/install-foundry-zksync | bash
foundryup-zksync
forge build --help | grep -A 20 "ZKSync configuration:"
```

## Install Solidity dependencies

```bash theme={null}
forge install roll.codes=jarrodwatts/roll.codes@main --no-git
forge install forge-std=foundry-rs/forge-std --no-git
```

## Add remappings

Your project should include these remappings:

```txt theme={null}
@rollcodes/=lib/roll.codes/src/
forge-std/=lib/forge-std/src/
```

## Set the minimum deploy environment

<Tabs>
  <Tab title="Abstract testnet">
    ```bash theme={null}
    cast wallet import deployer --interactive
    export ABSTRACT_RPC_URL=https://api.testnet.abs.xyz
    export ROLL_COORDINATOR=0x5ab0e04147A2A1BCa1D06da3c1cB48ea04294B5E
    ```
  </Tab>

  <Tab title="Abstract mainnet">
    Mainnet deployment is not live yet.

    ```bash theme={null}
    cast wallet import deployer --interactive
    export ABSTRACT_RPC_URL=<your_abstract_mainnet_rpc_url>
    export ROLL_COORDINATOR=<mainnet_coordinator_address>
    ```
  </Tab>
</Tabs>

`ROLL_COORDINATOR` should be the roll.codes coordinator address for the same network as `ABSTRACT_RPC_URL`.

See [Deployed addresses](/contracts/deployed-addresses) for the current network-specific values.

## Verify the setup

Run a compile before you move on:

```bash theme={null}
forge build --zksync
```

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

## Related pages

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/quickstart">
    Continue to the minimal hosted-coordinator integration flow once local setup is ready.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/cli/create-roll-codes">
    Use the scaffold command and flags to start from a generated project.
  </Card>

  <Card title="Troubleshooting" icon="life-buoy" href="/faq/troubleshooting">
    Fix import, fee, and callback issues if the setup does not compile cleanly.
  </Card>
</CardGroup>
