Gelato
  • Introduction
    • Gelato, The Web3 Cloud Platform
  • Rollup As A Service
    • Introduction
    • Rollup Stacks
      • Arbitrum Orbit
        • Run a Full Orbit Node
      • OP Stack
        • Run OP Node
    • Deploy your Rollup
    • Customization
      • Data Availability
        • Celestia
        • Avail
        • Eigen DA
      • Custom Gas Token
      • Marketplace
        • Gelato Services
        • Data Indexers
        • Block Explorers
        • Oracles
        • Bridges
        • Account Abstraction
        • On & Off-ramp
        • Community
        • Identity & KYC
        • Others
      • Verifier Node Package
    • Public Testnet
  • RPC Nodes
    • Introduction
    • Compute Units
    • Using RPC Nodes
    • Supported Networks
    • Pricing and Plans
    • FAQ
  • Web3 Services
    • Web3 Functions
      • Understanding Web3 Functions
        • Trigger Types
        • Typescript Function
        • Solidity Function
        • Automated Transactions
      • Security Considerations
      • Template & Use Cases
      • Quick Start
        • Writing Typescript Functions
          • Event Trigger
          • Private Typescript Functions
          • Callbacks
        • Test, Deploy & Run Typescript functions
        • Writing Solidity Functions
        • Test, Deploy & Run Solidity Functions
        • Initiate an Automated Transaction
      • Create a Web3 Function Task
        • Using the UI
        • Using the Safe App
        • Using a Smart Contract
        • Using the Automate SDK
      • Analytics & Monitoring
      • Supported Networks
      • Subscription & Payments
      • Legacy Automate Migration Guide
    • Relay
      • What is Relaying?
      • Security Considerations
        • ERC-2771 Delegatecall Vulnerability
      • Templates
      • Quick Start
        • Sponsored Calls
        • Non-Sponsored Calls
      • ERC-2771 (recommended)
        • SponsoredCallERC2771
        • CallWithSyncFeeERC2771
          • Relay Context Contracts ERC2771
      • Non-ERC-2771
        • SponsoredCall
        • CallWithSyncFee
          • Relay Context Contracts
      • Relay API
      • Gelato's Fee Oracle
      • Tracking your Relay Request
      • Supported Networks
      • Subscriptions and Payments
        • 1Balance & Relay
        • SyncFee Payment Tokens
        • Relay Pricing
      • ERC2771 Migration Guide
    • VRF
      • Understanding VRF
      • How does Gelato VRF Work?
      • Security Considerations
      • Template
      • Quick Start
      • Create a VRF Task
        • Create a Fallback VRF
        • Migrating from Chainlink VRF
      • Supported Networks
      • Pricing & Rate Limits
    • Oracles
      • Understanding Gelato Oracles
      • Quick Start
      • Data Providers
        • Stork
        • Choas Labs
      • Migrating from Chainlink Oracles
      • Available Price Feeds
      • Supported Networks
      • Pricing & Rate Limits
    • Account Abstraction
      • Understanding ERC4337
      • Introduction to Gelato Bundler
      • Templates & Examples
      • Quick Start
      • Sponsored UserOps
        • Using 1Balance
        • Using Zerodev Paymaster
      • Non-Sponsored UserOps
        • Pay with Native
        • Pay with ERC20
      • Supported Networks
      • Bundler API Endpoints
        • eth_sendUserOperation
        • eth_estimateUserOperationGas
        • eth_getUserOperationByHash
        • eth_getUserOperationReceipt
        • eth_supportedEntryPoints
        • eth_maxPriorityFeePerGas
        • eth_chainId
    • 1Balance
      • 1Balance Alerts
      • Subscription Plans
      • Subscription Notifications
      • USDC Addresses
    • AI Agents
    • Teams
  • GELATO DAO
    • DAO & Token (GEL)
    • GEL Token Contracts
    • Governance Process
  • Social Media
Powered by GitBook
On this page
  • Understand the Implications
  • Initiate Migration
  • Updating the VRF Coordinator Address
  1. Web3 Services
  2. VRF
  3. Create a VRF Task

Migrating from Chainlink VRF

Quick and simple migration from Chainlink VRF!

PreviousCreate a Fallback VRFNextSupported Networks

Last updated 1 month ago

Already using Chainlink VRF? Here's how you can quickly and easily migrate to GelatoVRF.

Understand the Implications

While this migration option is available, be aware that it can lead to higher gas costs and added development intricacies. We advise this route only if:

  • You've already deployed a Chainlink VRF Consumer.

  • Your Chainlink VRF Consumer has the capability to update its Coordinator address.

Otherwise, for new integrations, we recommend directly implementing the Gelato VRF.

Initiate Migration

If you're set on migrating an existing Chainlink VRF Consumer:

  • Begin by creating your VRF task. In the "VRF Type" selection window, opt for "VRF Compatibility".

  • Choose the blockchain network for deployment.

  • You will then be asked to deploy your Adapter contract:

  • Once deployed, the app will show you the address to which the adapter contract was deployed. You now need to replace the old Coordinator address in your contract by this address.

Updating the VRF Coordinator Address

Here’s a brief example of how you might implement such a function to update the vrfCoordinator in your Consumer Contract:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";

contract VRFConsumer is VRFConsumerBase {
    ...
    function setVRFCoordinator(address _vrfCoordinator) external onlyOwner {
        vrfCoordinator = _vrfCoordinator;
    }
    ...
}

To facilitate the update of the Chainlink VRF Coordinator address in your smart contracts, you can reference the function from.

this deployed contract on Polygon