Preparation
Do you know you can always contact the Binace Oracle team for assistance if you come across any issues using our service. Please feel free to drop us a note if you are interested.
For testing on the BSC testnet, you can go to the faucet and get some tBNB.
Preparation
To connect to Binance Oracle VRF, you need to prepare your smart contract to use the VRF. This involves importing the Binance VRF library contracts (provided below) and calling the requestRandomWords function with the required parameters. You also need to set up a callback function to handle the return value from the VRF. Once you have received the random number from the VRF, you can use it in your dApp.
BSC Mainnet
Environment | BSC Mainnet |
---|---|
VRF Coordinator Contract Address | 0x9632ADE542f12114f5E5AD4d6F8e47fB993955da |
SPACE ID | vrf.boracle.bnb |
keyhash | 0xcd65a78499993598be303c914c3e37b0103ead6b1f279d1dbfa0ef080e7141a4 (The hash of our VRF public key) |
VRFConsumerBase.sol | VRFConsumerBase.sol(abstract contract) |
VRFCoordinatorInterface.sol | VRFCoordinatorInterface.sol (interface contract) |
BSC Testnet
Environment | BSC Testnet |
---|---|
VRF Coordinator Contract Address | 0xa2d23627bC0314f4Cbd08Ff54EcB89bb45685053 |
SPACE ID | vrf.boracle.bnb |
keyhash | 0x617abc3f53ae11766071d04ada1c7b0fbd49833b9542e9e91da4d3191c70cc80 (The hash of our VRF public key) |
VRFConsumerBase.sol | VRFConsumerBase.sol(abstract contract) |
VRFCoordinatorInterface.sol | VRFCoordinatorInterface.sol (interface contract) |
opBnb Mainnet
Environment | opBnb Mainnet |
---|---|
VRF Coordinator Contract Address | 0x4E0C997c986539708aB8903a31447f7456dde212 |
keyhash | 0xcd65a78499993598be303c914c3e37b0103ead6b1f279d1dbfa0ef080e7141a4 (The hash of our VRF public key) |
VRFConsumerBase.sol | VRFConsumerBase.sol(abstract contract) |
VRFCoordinatorInterface.sol | VRFCoordinatorInterface.sol (interface contract) |
opBnb Testnet
Environment | opBnb Testnet |
---|---|
VRF Coordinator Contract Address | 0x2B30C31a17Fe8b5dd397EF66FaFa503760D4eaF0 |
keyhash | 0x617abc3f53ae11766071d04ada1c7b0fbd49833b9542e9e91da4d3191c70cc80 (The hash of our VRF public key) |
VRFConsumerBase.sol | VRFConsumerBase.sol(abstract contract) |
VRFCoordinatorInterface.sol | VRFCoordinatorInterface.sol (interface contract) |
VRFConsumerBase.sol and VRFCoordinatorInterface.sol are required to develop you own consumer contract.