NEW

CCIP is now live for all developers. See what's new.

Create and manage VRF V2.5 subscriptions

Using the VRF Subscription Manager

The VRF Subscription Manager is available to help you create and manage VRF V2.5 subscriptions. You can create and manage new V2.5 subscriptions, and manage existing V2 subscriptions, but you can no longer create new V2 subscriptions in the VRF Subscription Manager. Alternatively, you can create and manage subscriptions programmatically.

Create a subscription

To create a VRF 2.5 subscription:

  1. Use the VRF Subscription Manager at vrf.chain.link. Connect your wallet in the upper right corner and then click Create subscription. The address of your connected wallet is automatically filled in the Admin address field.

  2. When the subscription is successfully created, there will be an alert in the upper right corner telling you that the subscription was successfully created. Click Home to navigate back to your main dashboard.

  3. Your new subscription shows in the My Subscriptions list, along with any previous V2 subscriptions you might have. Click the Subscription ID for your new subscription in the list.

Add a consumer

To add a consuming contract:

  1. On the details page for your subscription, select Add Consumer.

  2. Provide the address of your consuming contract, and then select Add Consumer again. Confirm the resulting prompts in MetaMask or other wallet browser extension.

Fund your subscription

To fund your subscription:

  1. On the page for your subscription, select the Actions menu and then select Fund subscription.

  2. Your subscription has two balances: one for LINK, and one for the native token. Expand the Asset menu to select either LINK or the native token.

  3. In Amount to fund, enter the amount you want to fund your subscription. Your wallet balance is displayed below the Asset field for easier reference. Select Confirm to fund your wallet, and then confirm the resulting prompts in MetaMask or other wallet browser extension.

Cancel your subscription and withdraw funds

To withdraw your funds from a subscription, you must cancel the subscription.

  1. Open the Subscription Manager at vrf.chain.link and click the ID of your new subscription under the My Subscriptions list. The subscription details page opens.

  2. On your subscription details page, expand the Actions menu and select Cancel subscription. A field displays, prompting you to add the wallet address you want to send the remaining funds to.

  3. Enter your wallet address and click Cancel subscription. MetaMask opens and asks you to confirm the transaction. After you approve the transaction, Chainlink VRF closes your subscription account and sends the remaining LINK to your wallet.

If your subscription's admin address is a contract instead of an EOA, you may not be able to cancel the subscription directly. In this case, you must transfer ownership of your subscription to an EOA so that you can cancel the subscription and withdraw your funds.

Create a subscription programmatically

If you prefer to create, fund and manage your subscriptions programmatically, you can either deploy a subscription manager contract or use your network's block explorer:

  1. Create a new subscription for VRF v2.5:

    Deploy the SubscriptionManager contract. On deployment, the contract creates a new subscription and adds itself as a consumer to the new subscription.

  2. Fund your new VRF v2.5 subscription:

    1. Fund your new VRFv2PlusSubscriptionManager contract.
    2. Call topUpSubscription from the VRFv2PlusSubscriptionManager contract. This function uses the LINK token contract's transferAndCall function to fund your new subscription.

Stay updated on the latest Chainlink news