IPackVRFDirect Contract
This interface defines the functions and events of the VRFDirect contract. It provides a way for external contracts to interact with the VRFDirect contract and utilize its functionality.
Features
- Provides an interface for external contracts to interact with the VRFDirect contract.
- Allows for requesting random numbers directly from the VRFDirect contract.
- Emits events for successful and failed VRF requests.
Usage
To utilize the VRFDirect functionality, an external contract can implement this interface and call the relevant functions. The contract can then receive random numbers through the events emitted by the VRFDirect contract.
Example Usage
// Example usage
contract MyContract {
IPackVRFDirect vrfDirect;
constructor(address _vrfDirect) {
vrfDirect = IPackVRFDirect(_vrfDirect);
}
function requestRandomNumber() {
vrfDirect.requestRandomNumber();
}
function onRandomNumberReceived(uint256 randomNumber) {
// Handle the received random number
}
}