Skip to main content
Use this guide when you need verifiable on-chain randomness (e.g. for games, NFTs, or randomized logic) on Berachain. Gelato VRF lets your contract request randomness and receive a fulfilled callback.

Repository

Official documentation

Requirements

  • Node v20.0.0 or greater, npm or yarn
  • Wallet with $BERA — Bepolia Faucet
  • Hardhat

Stack

Solidity, Hardhat, Node.js, Gelato VRF (requester + fulfillment).

Quick start

  1. Clone and install
  2. Configure .env from .env.example: PRIVATE_KEY, DEDICATED_MSG_SENDER, and later SC_ADDRESS (your deployed contract).
  3. Deploy
    Note the deployed address from deployments/ and set SC_ADDRESS in .env.
  4. Create a Gelato VRF task at app.gelato.network/vrf: choose Berachain Bepolia, enter your requester contract address, then launch the VRF instance.
  5. Request randomness
    Monitor execution in the Gelato app.

Key files