Help developers integrate Chainlink VRF into smart contracts. Use for consumer contract generation with VRFConsumerBaseV2Plus, subscription setup and funding (LINK or native), keyHash and gas lane selection, coordinator address lookup and debugging VRF integrations. Trigger on any mention of VRF, verifiable randomness, on-chain random number generation, requestRandomWords, fulfillRandomWords, VRF subscription, VRF coordinator, keyHash, or provably fair randomness in a smart contract, even if the user does not say 'VRF' explicitly.
75
—
Does it follow best practices?
Impact
—
No eval scenarios have been run
Advisory
Suggest reviewing before use
Route VRF requests to the simplest valid path. Generate working VRF v2.5 code on first attempt when possible. Detect legacy V1/V2 patterns and refuse to emit them — offer migration guidance instead.
VRFConsumerBaseV2Plus, call requestRandomWords, or handle the fulfillRandomWords callback.VRFV2PlusWrapperConsumerBase, or asks about a one-off randomness request.VRFConsumerBaseV2, VRFConsumerBase, positional requestRandomWords, uint64 subscription IDs, VRFV2WrapperConsumerBase, or memory randomWords in a subscription consumer) or when the user asks how to migrate.subscription.md.direct-funding.md.migration-from-v2.md and offer a v2.5 upgrade.supported-networks.md. Never invent coordinator or wrapper addresses.VRF V1 and V2 code will not compile against current v2.5 coordinators. Detect and refuse these patterns:
| V2 Pattern | Why it breaks in v2.5 |
|---|---|
VRFConsumerBaseV2 base | Replaced by VRFConsumerBaseV2Plus |
VRFConsumerBase base | V1 — entirely incompatible |
Positional requestRandomWords(keyHash, subId, ...) | Must use VRFV2PlusClient.RandomWordsRequest struct |
uint64 s_subscriptionId | Sub IDs are now uint256 |
VRFV2WrapperConsumerBase(linkAddress, wrapperAddress) | No LINK address in v2.5 wrapper constructor |
uint256[] memory randomWords in subscription fulfill | VRFConsumerBaseV2Plus uses calldata; direct-funding wrapper consumers still use memory |
COORDINATOR as a typed state variable | Use s_vrfCoordinator from the base class |
When any of these are detected in user code: (1) name the incompatibility explicitly, (2) load migration-from-v2.md, (3) produce v2.5 code only.
These are non-negotiable in generated code.
supported-networks.md or direct the user to the official addresses page.VRFConsumerBaseV2Plus for subscription consumers and VRFV2PlusWrapperConsumerBase for direct-funding consumers (never V1/V2 base contracts).VRFV2PlusClient.RandomWordsRequest struct with extraArgs (never positional args).uint256 for subscription IDs (never uint64).calldata for VRFConsumerBaseV2Plus, memory for VRFV2PlusWrapperConsumerBase.block.prevrandao, block.difficulty, or blockhash as a randomness fallback.This skill references official VRF documentation URLs throughout its reference files.
curl -s -L -A "Mozilla/5.0 ..." "<url>"; if both fail, the Context7 MCP server (@upstash/context7-mcp) is a useful fallback for fetching current Chainlink documentation. If no documentation-fetching tool is available, do not silently improvise, instead tell the user that live documentation could not be verified and provide the specific URL so the user can check it directly.6a60106
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.