Skip to content

snippets of functionalities that I might use in other projects.

Notifications You must be signed in to change notification settings

vantwoutmaarten/solidity-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

solidity-snippets

chainlink-vrf-snippet This will be the most barebone version of getting a random number with Chainlink.

The minimum requirements are:

  • Create a subscription manager and subscription and add some link to the subscribtion manager. - After you have subscribption account deploy VRF v2 compatible contract, a VRFV2Consumer.sol. contract randomNumberConsumer is VRFV2Consumer...

Some terms to know: The subscription is funded with link, so you can have an account for multiple consumer contracts.

  • keyhash identifies which oracle.

  • fee is how much you pay the node to get the number

  • randomresult is the result you get back.

  • construct vrf consumerbase(arg1, arg2) arg1 = the contract address that will check if a number was really random. , arg2 link token address

  • getRandomNumber returns requestId, just the id of the request

    fullfillrandomness give the randomnumber for that id

    • fullFillRandomNess(requestId, randomNess) internal override { randomResult = randomNess. } }

About

snippets of functionalities that I might use in other projects.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published