Skip to content

Add VRF starter kit example#45

Open
thodges-gh wants to merge 1 commit into
mainfrom
feat/vrf-starter-kit
Open

Add VRF starter kit example#45
thodges-gh wants to merge 1 commit into
mainfrom
feat/vrf-starter-kit

Conversation

@thodges-gh

Copy link
Copy Markdown
Contributor

Description

Adds a Chainlink VRF Foundry starter-kit template to chainlink-vrf-skill, mirroring the
existing data-feeds starter kit, so the skill can hand users a complete, runnable project
instead of an isolated snippet.

Template (chainlink-vrf-skill/templates/starter-kit/):

  • src/VRFConsumerV2Plus.sol — a VRF v2.5 subscription consumer (VRFConsumerBaseV2Plus,
    VRFV2PlusClient.RandomWordsRequest struct with extraArgs, uint256 subscription ID,
    calldata callback). Based on the Chainlink Foundry Starter Kit VRFConsumerV2.sol pattern but
    upgraded to v2.5 — the legacy V2 source the skill explicitly refuses to emit would not compile
    against current coordinators.
  • test/VRFConsumerV2Plus.t.sol — 4 tests against the VRFCoordinatorV2_5Mock shipped with
    @chainlink/contracts (no vendored mock).
  • script/VRFConsumerV2Plus.s.sol — defaults to Sepolia (live coordinator + 500 gwei key hash,
    subscription ID via SUBSCRIPTION_ID env); on local chains it deploys and funds a mock and
    wires the consumer end-to-end.
  • foundry.toml, remappings.txt, .gitignore, and a README.md covering dependencies, v2.5
    essentials, default network, and run commands.
  • Dependency metadata includes OpenZeppelin v4.9.6, which chainlink-evm@contracts-v1.5.0
    imports transitively via versioned @openzeppelin/contracts@4.9.6/... paths — without it a
    fresh project fails to compile.

Skill (SKILL.md): added progressive-disclosure and routing entries pointing
project-level/Foundry-starter requests to the template.

Evals (evals/chainlink-vrf-skill/): added a starter-kit rubric, two functional cases and
one trigger-positive case, and the corresponding promptfooconfig.yaml entries and README
updates (10 cases total, 9 smoke-tagged).

Verified in a fresh project with the three documented dependencies installed: forge test --offline passes all 4 tests and forge script ...DeployVRFConsumerV2Plus --offline deploys
successfully.

Justification

The VRF skill could generate consumer snippets but had no scaffolding path, so "give me a
working VRF project I can build and test" requests produced ad-hoc, often non-compiling
projects. A vetted, version-correct starter kit gives users a known-good v2.5 baseline that
builds and tests locally on the first try, keeps generated projects aligned with the skill's
safety defaults (v2.5-only, no invented addresses), and brings VRF to parity with the data-feeds
skill. The included evals guard the behavior against regressions.

@thodges-gh thodges-gh requested review from a team, Nalon and andrejrakic as code owners June 19, 2026 12:32

@ahmetcanerkaplan-crypto ahmetcanerkaplan-crypto left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants