Skip to main content

VRF

Generate random numbers in blockchain is not a native functionality. You can find a lot of examples but the best and secure way to get one is using chainlink VRF.

How to test it

When you implement VRF contract in your solution may be you want to do integration test to be safe. To do that you have 2 options:

  • Test it using VRF helpers: In this case you have to do a fork of rinkeby testnet and configure your hardhat solution to use it like explains this paper.
  • Create a mock contract for chainlink coordinator and deploy it in your tests to get a hardcoded number that simulates it.

Useful links