diff --git a/package-lock.json b/package-lock.json index ced20807607..1aad79a451e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@astrojs/react": "^3.3.0", "@astrojs/sitemap": "^3.1.4", "@chainlink/components": "^0.4.16", - "@chainlink/contracts": "1.1.1-beta.0", + "@chainlink/contracts": "1.1.0", "@chainlink/contracts-ccip": "1.4.0", "@chainlink/design-system": "^0.1.50", "@chainlink/solana-sdk": "^0.2.2", @@ -1234,9 +1234,9 @@ } }, "node_modules/@chainlink/contracts": { - "version": "1.1.1-beta.0", - "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-1.1.1-beta.0.tgz", - "integrity": "sha512-BeYdCDDtzR3mtLApZ8CacGTYjVGzbjGN7WKPAvCwiQWjIFaUiiZ9Y1uyk19+Rr/enNKBQI+hDkOkWWPbEuSJKw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@chainlink/contracts/-/contracts-1.1.0.tgz", + "integrity": "sha512-J+gDUCnEOJ2ofCvy5L2VLrQ7DVs0NXK31w8MQrW6U1GpjzU1j+it7FOJHZMxZKGg7wDdWI06aWmCgFeiD1H+bA==", "dependencies": { "@changesets/changelog-github": "^0.4.8", "@changesets/cli": "~2.26.2", diff --git a/src/content/vrf/index.mdx b/src/content/vrf/index.mdx index 606a2b227f0..fac320a5e9a 100644 --- a/src/content/vrf/index.mdx +++ b/src/content/vrf/index.mdx @@ -10,10 +10,10 @@ metadata: description: "Learn how to securely generate random numbers for your smart contract with Chainlink VRF (an RNG). This guide uses Solidity code examples." --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import { Aside } from "@components" - + **Chainlink VRF (Verifiable Random Function)** is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability. For each request, Chainlink VRF generates one or more random values and cryptographic proof of how those values were determined. The proof is published and verified onchain before any consuming applications can use it. This process ensures that results cannot be tampered with or manipulated by any single entity including oracle operators, miners, users, or smart contract developers. diff --git a/src/content/vrf/v2-5/best-practices.mdx b/src/content/vrf/v2-5/best-practices.mdx index f0e1142cf61..68a6f277b25 100644 --- a/src/content/vrf/v2-5/best-practices.mdx +++ b/src/content/vrf/v2-5/best-practices.mdx @@ -7,10 +7,10 @@ metadata: description: "Best practices for using Chainlink VRF." --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import { CodeSample } from "@components" - + These are example best practices for using Chainlink VRF. To explore more applications of VRF, refer to our [blog](https://blog.chain.link/). diff --git a/src/content/vrf/v2-5/migration-from-v2.mdx b/src/content/vrf/v2-5/migration-from-v2.mdx index 4153f36869a..d24e740cdcd 100644 --- a/src/content/vrf/v2-5/migration-from-v2.mdx +++ b/src/content/vrf/v2-5/migration-from-v2.mdx @@ -4,11 +4,11 @@ date: Last Modified title: "Migrating from VRF v2" --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import { Aside, CodeSample } from "@components" import { Tabs, TabsContent } from "@components/Tabs" - + ## Benefits of VRF v2.5 @@ -245,7 +245,6 @@ Compare the major changes between V2.5 and V2: pragma solidity 0.8.19; ///// UPDATE IMPORTS TO V2.5 ///// -import {IVRFCoordinatorV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/interfaces/IVRFCoordinatorV2Plus.sol"; import {VRFConsumerBaseV2Plus} from "@chainlink/contracts/src/v0.8/vrf/dev/VRFConsumerBaseV2Plus.sol"; import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/VRFV2PlusClient.sol"; @@ -261,9 +260,8 @@ import {VRFV2PlusClient} from "@chainlink/contracts/src/v0.8/vrf/dev/libraries/V ///// INHERIT NEW CONSUMER BASE CONTRACT ///// contract SubscriptionConsumer is VRFConsumerBaseV2Plus { ... - - ///// USE NEW COORDINATOR ///// - IVRFCoordinatorV2Plus COORDINATOR; + ///// No need to declare a coordinator variable ///// + ///// Use the `s_vrfCoordinator` from VRFConsumerBaseV2Plus.sol ///// ///// SUBSCRIPTION ID IS NOW UINT256 ///// uint256 s_subscriptionId; @@ -278,16 +276,13 @@ contract SubscriptionConsumer is VRFConsumerBaseV2Plus { ... - ///// USE NEW CONSUMER BASE AND COORDINATOR CONSTRUCTORS ///// + ///// USE NEW CONSUMER BASE CONSTRUCTOR ///// constructor( ///// UPDATE TO UINT256 ///// uint256 subscriptionId ) VRFConsumerBaseV2Plus(0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B) { - COORDINATOR = IVRFCoordinatorV2Plus( - 0x9DdfaCa8183c41ad55329BdeeD9F6A8d53168B1B - ); s_subscriptionId = subscriptionId; } @@ -298,7 +293,8 @@ contract SubscriptionConsumer is VRFConsumerBaseV2Plus { { ///// UPDATE TO NEW V2.5 REQUEST FORMAT ///// // To enable payment in native tokens, set nativePayment to true. - requestId = COORDINATOR.requestRandomWords( + // Use the `s_vrfCoordinator` from VRFConsumerBaseV2Plus.sol + requestId = s_vrfCoordinator.requestRandomWords( VRFV2PlusClient.RandomWordsRequest({ keyHash: keyHash, subId: s_subscriptionId, diff --git a/src/content/vrf/v2-5/overview/direct-funding.mdx b/src/content/vrf/v2-5/overview/direct-funding.mdx index 32b536596bc..f0488d4148a 100644 --- a/src/content/vrf/v2-5/overview/direct-funding.mdx +++ b/src/content/vrf/v2-5/overview/direct-funding.mdx @@ -75,7 +75,7 @@ After you submit your request, it is processed using the [Request & Receive Data ## Limits -You can see the configuration for each network on the [Supported networks](/vrf/v2/direct-funding/supported-networks) page. You can also view the full configuration for each VRF v2 Wrapper contract directly in Etherscan. As an example, view the [Ethereum Mainnet VRF v2 Wrapper contract](https://etherscan.io/address/0x5A861794B927983406fCE1D062e00b9368d97Df6#readContract) configuration by calling `getConfig` function. +You can see the configuration for each network on the [Supported networks](/vrf/v2/direct-funding/supported-networks) page. You can also view the full configuration for each VRF v2.5 Wrapper contract directly in Etherscan. As an example, view the [Ethereum Mainnet VRF v2.5 Wrapper contract](https://etherscan.io/address/0x02aae1A04f9828517b3007f83f6181900CaD910c#readContract) configuration by calling `getConfig` function. - Each wrapper has a `maxNumWords` parameter that limits the maximum number of random values you can receive in each request. -- The maximum allowed `callbackGasLimit` value for your requests is defined in the [Coordinator contract supported networks](/vrf/v2/subscription/supported-networks) page. Because the VRF v2.5 Wrapper adds an overhead, your `callbackGasLimit` must not exceed `maxGasLimit - wrapperGasOverhead`. Learn more about [estimating costs](/vrf/v2/estimating-costs). +- The maximum allowed `callbackGasLimit` value for your requests is defined in the [Coordinator contract supported networks](/vrf/v2-5/supported-networks) page. Because the VRF v2.5 Wrapper adds an overhead, your `callbackGasLimit` must not exceed `maxGasLimit - wrapperGasOverhead`. Learn more about [estimating costs](/vrf/v2-5/billing). diff --git a/src/content/vrf/v2-5/overview/subscription.mdx b/src/content/vrf/v2-5/overview/subscription.mdx index 2da46ec22f6..6f78ad9ace3 100644 --- a/src/content/vrf/v2-5/overview/subscription.mdx +++ b/src/content/vrf/v2-5/overview/subscription.mdx @@ -8,12 +8,12 @@ metadata: description: "Learn how to securely generate random numbers for your smart contract with Chainlink VRF v2.5(an RNG). This guide uses the subscription method." --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import { Aside, ClickToZoom } from "@components" import { TabsContent } from "@components/Tabs" import { YouTube } from "@astro-community/astro-embed-youtube" - + This section explains how to generate random numbers using the subscription method. diff --git a/src/content/vrf/v2-5/subscription/create-manage.mdx b/src/content/vrf/v2-5/subscription/create-manage.mdx index fc439f7ad59..9f92f710ead 100644 --- a/src/content/vrf/v2-5/subscription/create-manage.mdx +++ b/src/content/vrf/v2-5/subscription/create-manage.mdx @@ -4,15 +4,15 @@ date: Last Modified title: "Create and manage VRF V2.5 subscriptions" --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import { CodeSample } from "@components" import { Tabs, TabsContent } from "@components/Tabs" - + ## Using the VRF Subscription Manager -The private version of the VRF Subscription Manager is available to help you create and manage VRF V2.5 subscriptions. Alternatively, you can [create and manage subscriptions programmatically](#create-a-subscription-programmatically). +The [VRF Subscription Manager](https://vrf.chain.link/) 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-programmatically). ### Create a subscription diff --git a/src/content/vrf/v2-5/supported-networks.mdx b/src/content/vrf/v2-5/supported-networks.mdx index 3010e7da4c4..b2095fb311f 100644 --- a/src/content/vrf/v2-5/supported-networks.mdx +++ b/src/content/vrf/v2-5/supported-networks.mdx @@ -8,12 +8,12 @@ metadata: image: "/files/OpenGraph_V3.png" --- -import VrfCommon from "@features/vrf/v2-5/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import ResourcesCallout from "@features/resources/callouts/ResourcesCallout.astro" import { Address, Aside, CopyText } from "@components" import { TabsContent } from "@components/Tabs" - + Chainlink VRF allows you to integrate provably fair and verifiably random data in your smart contract. @@ -30,8 +30,6 @@ These parameters are configured in the coordinator contract. You can view these ## Configurations - - VRF v2.5 coordinators for subscription funding are available on several networks. diff --git a/src/content/vrf/v2/direct-funding/supported-networks.mdx b/src/content/vrf/v2/direct-funding/supported-networks.mdx index 971ba2fb668..e0d8e7bdc2d 100644 --- a/src/content/vrf/v2/direct-funding/supported-networks.mdx +++ b/src/content/vrf/v2/direct-funding/supported-networks.mdx @@ -8,11 +8,11 @@ metadata: image: "/files/OpenGraph_V3.png" --- -import VrfCommon from "@features/vrf/v2/common/VrfCommon.astro" +import Vrf2_5Common from "@features/vrf/v2-5/Vrf2_5Common.astro" import ResourcesCallout from "@features/resources/callouts/ResourcesCallout.astro" import { Address, Aside } from "@components" - + Chainlink VRF allows you to integrate provably fair and verifiably random data in your smart contract. @@ -51,6 +51,8 @@ VRF v2 coordinators for direct funding are available on several networks. To see ### Ethereum mainnet + + | Item | Value | | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | LINK Token |
| @@ -66,10 +68,10 @@ VRF v2 coordinators for direct funding are available on several networks. To see ### Sepolia testnet - + + +Testnet LINK and ETH are available from faucets.chain.link. +Testnet ETH is also available from several public ETH faucets. | Item | Value | | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -87,6 +89,8 @@ VRF v2 coordinators for direct funding are available on several networks. To see ### BNB Chain mainnet + +