Oraichain
  • ORAICHAIN
    • Introduction
    • System Overview
      • AI Layer 1 for Data Economy & blockchain oracle services
      • Layer 2 Rollups and Subnetworks
      • Verifiable and trustless AI Execution
      • Protocol Messages
      • IBC Integration
    • Use Cases
    • Token Economics
  • DEVELOPER GUIDES
    • General
      • Blockchain details
    • CosmWasm Contracts
      • Compile a Contract
      • Deploy a Contract
      • Query a Contract
      • Send tokens to a Contract
      • Manage Contracts using design patterns
      • End-to-end CosmWasm testing with CW-simulate
    • Local testnet chain
    • Wallet
      • OWallet
    • Price Feed
      • CW Oracle Hub
    • VRF 2.0
      • Introduction to Oraichain VRF 2.0
      • Get a Random Value from API
        • Get VRF Value from different networks
        • Contract Addresses and Pricing
        • Validate a Group Signature
      • Security Remarks
      • API Reference
      • Get support from Oraichain team
    • OraiDEX
      • ORAIX Token
      • OBridge
        • OraiBTC
        • TON Bridge
          • TON Blockchain 101
      • Decentralization
    • Indexers
      • SubQuery
    • OraichainEVM
      • Getting started
      • Smart Contracts
        • Oraichain EVM Precompiled Contracts
        • Address
        • Bank
        • Wasm
        • Authz
      • Guides
        • Metamask
        • Remix
        • Foundry
        • Hardhat
        • Tools
        • Oraichain EVM RPC
  • GOVERNANCE
    • Privacy Policy
  • NODES & VALIDATORS
    • Networks
      • Joining Mainnet
        • Build Linux binary from source and become a Sentry Node Operator
        • Become a Validator
      • Joining Testnet
        • Become Testnet Fullnode From Source
        • StateSync Testnet
        • Faucet Testnet
    • Oraichain Tutorials
      • Migrate one Oraichain node to another
      • Cosmovisor
      • Update validator image
      • Tenderduty
      • Grafana
      • Tracking Unvoted Proposals
      • Tmtop
Powered by GitBook
On this page
  • Index
  • Constructors
  • �Funtions

Was this helpful?

Edit on GitHub
  1. DEVELOPER GUIDES
  2. VRF 2.0

API Reference

Index

Constructors

Description

Constructors

Oracle vrf initialization

Functions

Description

randomnessRequest

Make a request to generate random numbers

fulfillRandomness

VRF Oracle will call back when receiving valid VRF proof data

Constructors

constructor (address _oraiToken, address _oracle) public {
    fee = 1000000000000000000;
    orai = _oraiToken;
    oracle = _oracle;
}

�Funtions

randomnessRequest

function randomnessRequest(uint256 _seed, bytes memory _data) public returns (bytes32 reqId);
  • _seed : a random number provided by the caller

  • _data : the result of callbackAddress and callbackFunc after encoding

bytes memory data = abi.encode(address(this), this.fulfillRandomness.selector);
  • callbackAddress: smart contract address receive random number

  • callbackFunct : hen a function is called, the first 4 bytes of calldata specifies which function to call.

fulfillRandomness

function fulfillRandomness(bytes32 reqId, bytes calldata _data, uint8 v, bytes32 r, bytes32 s) external;
  • reqId: request id generated when calling function randomnessRequest

  • _data: includes callbackAddress and callbackFunc after encode

  • v,r,s: proof vrf

PreviousSecurity RemarksNextGet support from Oraichain team

Last updated 3 years ago

Was this helpful?