LogoLogo
WebsiteDiscordTelegramTwitter
  • 🏠Witnet Oracle Docs
  • Introduction
    • ❓What is Witnet?
      • ⚙️Oracle Architecture
      • 🪙The Witnet Coin (Wit)
      • 👛Wallets
      • 🤔Frequently Asked Questions
      • 😎Awesome Witnet
    • 🚀Quick Tutorials
      • 📈Price Feeds
      • 🎲Randomness
      • 🌐APIs and HTTP GET/POST
      • ⛏️Mining Wit
  • Smart contracts developers
    • ⛓️Supported chains
    • 🔮Wit/Oracle
      • HTTP GET Requests in Solidity
      • HTTP POST Requests in Solidity
      • Query GraphQL APIs in Solidity
      • Dynamic Requests in Solidity
      • UsingWitnet Inheritance
      • API Reference
        • Solidity API
          • Solidity Contracts
            • WitnetRequestBoard
        • Javascript API
        • RADON API
          • RADON Type System
          • RADON Errors
      • Multi-chain Addresses
    • 💹Wit/Price Feeds
      • How To Use Witnet Price Feeds
      • Update Conditions
      • Code Examples
      • API Reference
      • Multi-chain Addresses
        • Arbitrum Price Feeds
        • Avalanche Price Feeds
        • Base Price Feeds
        • Boba Price Feeds
        • Celo Price Feeds
        • Conflux Price Feeds
        • Cronos Price Feeds
        • Dogechain Price Feeds
        • Elastos Price Feeds
        • Ethereum Price Feeds
        • Gnosis Chain Price Feeds
        • Kaia Price Feeds
        • Kava Price Feeds
        • KCC Price Feeds
        • Mantle Price Feeds
        • Meter Price Feeds
        • Metis Price Feeds
        • Moonbeam Price Feeds
        • OKX Price Feeds
        • Optimism Price Feeds
        • Polygon Price Feeds
        • Reef Price Feeds
        • Scroll Price Feeds
        • Syscoin Price Feeds
        • Ultron Price Feeds
        • Request new price feed or chain support
    • 🎲Wit/Randomness
      • Generating Randomness
      • WitnetRandomness Contract
      • Low-level Requests
      • Code Examples
      • API Reference
      • Multi-chain Addresses
    • 🏗️Guides
      • 📖Solidity Contracts
        • Appliances
          • 📃WitnetPriceFeeds
          • 📃WitnetRandomness
        • Core
          • 📃WitnetOracle
          • 📃WitnetRadonRegistry
          • 📃WitnetRequest
          • 📃WitnetRequestFactory
          • 📃WitnetRequestTemplate
        • Mockups
          • 📃UsingWitnet
          • 📃UsingWitnetRandomness
          • 📃UsingWitnetRequest
          • 📃UsingWitnetRequestTemplate
          • 📃WitnetRandomnessRequestConsumer
          • 📃WitnetRequestConsumer
          • 📃WitnetRequestTemplateConsumer
      • 🧙Solidity Wizard
    • 🎓Tutorials
      • Building a Satoshi/Wei custom price feed
  • Witnet Node Operators
    • 🖥️Requirements
    • 🚀Witnet Node Quick Start Guide (Docker)
    • 🔎Next steps
    • 📄CLI Reference
    • 🤓Advanced Setups
      • Run Witnet as a systemd service
      • Run Witnet as a docker compose service
      • Paranoid mode (Witnet over proxies and Tor)
      • Configuration file
  • Witnet Node Developers
    • 🏗️Integration Guide
      • Node API Reference
      • Wallet API Reference
    • 🗜️Compile witnet-rust from Source Code
Powered by GitBook
On this page
  • Constructor
  • Modifiers
  • Properties
  • Internal methods
  • Events

Was this helpful?

Edit on GitHub
  1. Smart contracts developers
  2. Guides
  3. Solidity Contracts
  4. Mockups

WitnetRequestConsumer

PreviousWitnetRandomnessRequestConsumerNextWitnetRequestTemplateConsumer

Last updated 5 months ago

Was this helpful?

Constructor

Parameters
Type
Description

_witnetRequest

WitnetRequest

_baseFeeOverheadPercentage

uint16

Percentage over base fee to pay when querying new data updates.

_callbackGasLimit

uint24

Maximum gas expected to be spent by the callback methods.

Modifiers

Modifier
Description

onlyFromWitnet

To be added on callback methods for attending query results from the Wit/Oracle.

witnetQuerySolved(uint256 queryId)

Provides a convenient way for consuming contracts to block execution of the contract's logic until a particular randomness query gets ultimately reported from the Wit/Oracle blockchain.

Properties

Name
Visibility
Description

dataRequest

Immutable public

__witnet

Immutable internal

__witnetBaseFeeOverheadPercentage

Internal

Percentage over base fee to pay when querying new data updates. Defaults to 33%.

__witnetCallbackGasLimit

Internal

Maximum gas expected to be spent by the callback methods.

__witnetDefaultSLA

Internal

Default Service Level Agreement parameters to be fulfilled by the Wit/Oracle blockchain when solving data updates.

__witnetRequestRadHash

Immutable internal

Immutable RAD hash identifying the actual sources and computations being solved by the Wit/Oracle upon every data update.

Internal methods

Methods
Description

_witnetCheckQueryResponseStatus(uint256)

Check current WitnetV2.ResponseStatus of the specified query.

_witnetCheckQueryResultAvailability(uint256)

Check if the specified query was already reported back from the Wit/Oracle blockchain.

_witnetCheckQueryResultError(uint256)

Get detailed Witnet.ResultError for the specified query.

_witnetEstimateEvmReward()

Estimate the minimum reward required for posting a data request, using tx.gasprice as a reference.

__witnetRequestData(uint256 _evmReward)

Post a data query in expectation that it will get eventually solved and reported from the Wit/Oracle blockchain, specifying how much fee to pay out from this contract's balance.

__witnetRequestData(uint256, RadonSLA)

Post a data query in expectation that it will get eventually solved and reported, specifying how much fee to pay and the SLA parameters to be fulfilled by the Wit/Oracle blockchain.

Events

Events
Arguments
Description

WitnetQuery

address evmRequester

uint256 evmGasPrice

uint256 evmReward

uint256 queryId

bytes32 queryRadHash

RadonSLA querySLA

WitnetQueryUpgrade

uint256 queryId

address evmSender

uint256 evmGasPrice

uint256 evmReward

Emitted if the EVM reward for solving a previously posted randomize is increased by anyone in any amount.

Address of the instance to use as reference when querying data updates to .

Address of the instance passed in the constructor.

Address of the instance to directly interact with.

Emitted every time a new randomize query gets posted to the contract.

🏗️
📖
📃
🧙Solidity Wizard
WitnetRequest
WitnetOracle
WitnetRequest
WitnetOracle
WitnetOracle