Learn how to build smart contracts that use randomness to determine outcomes.
Create a Foundry project
Install Absmate
Configure remappings
remappings.txt
file to use Absmate’s contracts.VRNGConsumer
.
Create a test contract
MockVRNGSystem
contract to mock the VRNG system in your tests.Pass its contract address to your game contract, by providing it to the _setVRNG
function (here we do it via a constructor argument to the CoinFlipGame
contract).Test your contract with request/fulfill pattern mocks
randomNumberCallback
.Run your tests
Create a deploy script
Run the deploy script
Contact the Proof of Play team
randomNumberCallback
function to be called.Contact the Proof of Play team to whitelist your smart contract address.