This is a consumer contract that allows end users to pay for VRF calls in LINK. The purpose of this contract is to demonstrate how to use the Chainlink VRF Direct Funding method to allow the end user to pay for the service. This contract is not intended to be used in production. It is intended to be used as a reference for developers who want to implement the Chainlink VRF Direct Funding method in their own contracts.
$ git clone https://github.com/smartcontractkit/vrf-direct-funding-example.git
# Network RPCs
export RPC_URL=
# Private key for contract deployment
export PRIVATE_KEY=
# Explorer API key used to verify contracts
export EXPLORER_KEY=
# root
$ make install
# root
$ make deploy
# root
$ make test-contract
⚠️ Disclaimer: "This tutorial represents an educational example to use a Chainlink system, product, or service and is provided to demonstrate how to interact with Chainlink’s systems, products, and services to integrate them into your own. This template is provided “AS IS” and “AS AVAILABLE” without warranties of any kind, it has not been audited, and it may be missing key checks or error handling to make the usage of the system, product or service more clear. Do not use the code in this example in a production environment without completing your own audits and application of best practices. Neither Chainlink Labs, the Chainlink Foundation, nor Chainlink node operators are responsible for unintended outputs that are generated due to errors in code."