Skip to content

Commit

Permalink
Add missing contract variables (#1581)
Browse files Browse the repository at this point in the history
* Add missing contract variables

* Update src/content/vrf/v2/getting-started.mdx

Co-authored-by: yacine-benichou <78235417+yacine-benichou@users.noreply.github.com>

---------

Co-authored-by: yacine-benichou <78235417+yacine-benichou@users.noreply.github.com>
  • Loading branch information
thedriftofwords and yacine-benichou authored Oct 13, 2023
1 parent 0a14f78 commit e8288d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/content/vrf/v2/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ This example is adapted for [Sepolia testnet](/vrf/v2/subscription/supported-net
{/* prettier-ignore */}
```solidity
uint64 s_subscriptionId;
address s_owner;
VRFCoordinatorV2Interface COORDINATOR;
address vrfCoordinator = 0x8103B0A8A00be2DDC778e6e7eaa21791Cd364625;
bytes32 s_keyHash = 0x474e34a077df58807dbe9c96d3c009b23b3c6d0cce433e59bbf5b34f823bc56c;
uint32 callbackGasLimit = 40000;
uint16 requestConfirmations = 3;
uint32 numWords = 1;
```

- `uint64 s_subscriptionId`: The subscription ID that this contract uses for funding requests. Initialized in the `constructor`.
- `address s_owner`: The address of the owner of the contract that you will deploy. This is initialized in the `constructor`, and it will be the address you use when deploying the contract.
- `VRFCoordinatorV2Interface COORDINATOR`: The address of the Chainlink VRF Coordinator contract that this contract will use. Initialized in the `constructor`.
- `address vrfCoordinator`: The address of the Chainlink VRF Coordinator contract.
- `bytes32 s_keyHash`: The gas lane key hash value, which is the maximum gas price you are willing to pay for a request in wei. It functions as an ID of the off-chain VRF job that runs in response to requests.
- `uint32 callbackGasLimit`: The limit for how much gas to use for the callback request to your contract's `fulfillRandomWords` function. It must be less than the `maxGasLimit` on the coordinator contract. Adjust this value for larger requests depending on how your `fulfillRandomWords` function processes and stores the received random values. If your `callbackGasLimit` is not sufficient, the callback will fail and your subscription is still charged for the work done to generate your requested random values.
Expand Down

1 comment on commit e8288d1

@vercel
Copy link

@vercel vercel bot commented on e8288d1 Oct 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.