Seipex Finance
DiscordDragonSwapAstroportOpenSeaPallet
  • Seipex Finance
  • Seipex Digital Assets
    • Seipex Credits (SPEX)
    • Founder's Pass NFT
  • Seipex VRF
    • Integration
      • VRF Consumer Interface
      • Request Randomness
      • Randomness Callback
      • Simplified Example
      • Proof Validation
      • Extended VRF Consumer Interface
      • Extended Randomness Callback
      • Verify Proof
      • Complete Example
      • Security Considerations
      • Gas Cost Considerations
  • Seipex API
    • Available Endpoints
  • Seipex Mercury
    • Available Endpoints
Powered by GitBook
On this page
  1. Seipex VRF
  2. Integration

Randomness Callback

The official Seipex VRF Consumer deployment address is 0x7efDa6beA0e3cE66996FA3D82953FF232650ea67on Sei mainnet.

Finally, declare a randomness callback function which the VRC Consumer will call once the random number is ready.

function randomnessCallback(
        bytes32 randomNumber,
        uint256 requestId,
        bytes memory proof
    ) external {
        require(
            msg.sender == address(0x7efDa6beA0e3cE66996FA3D82953FF232650ea67),
            "Only the VRFConsumer can call this function"
        );
        
        // Callback returns the random number, requestId and proof and
        // you complete your game here when the callback happens      
}

Make sure that only the VRF Consumer address can call this function. It's important that this function exists and does not revert otherwise you will not receive your random number automatically.

PreviousRequest RandomnessNextSimplified Example

Last updated 9 months ago