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

# Migrate from Chainlink VRF

> Quick and simple migration from Chainlink VRF!

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

## Understand the Implications

<Warning>
  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.
</Warning>

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

## Initiate Migration

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

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

2. Choose the blockchain network for deployment.

<img src="https://mintcdn.com/gelato-6540eeb1/8BeiyOhSgNF7mtMT/images/create_vrf_task.png?fit=max&auto=format&n=8BeiyOhSgNF7mtMT&q=85&s=d9634f77ace25c94904c6225245a34f7" alt="Chainlink VRF Network Selection" width="2880" height="1409" data-path="images/create_vrf_task.png" />

3. You will then be asked to deploy your Adapter contract:

<img src="https://mintcdn.com/gelato-6540eeb1/Zts4gqL19HxzBoy9/images/chainlink_vrf_2.png?fit=max&auto=format&n=Zts4gqL19HxzBoy9&q=85&s=a77f6358118b6f4c429b179f89c099b3" alt="Chainlink VRF Adapter Deployment" width="1035" height="638" data-path="images/chainlink_vrf_2.png" />

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:

```solidity theme={null}
// 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](https://polygonscan.com/address/0x81e4e7977310308271082fc5285039e613d47d51#code).
