Rivalz Network
  • Introducing Rivalz
  • ROME - Swarm Protocol
    • rAgent Creation
    • What is a PAG?
    • ROME Rewards
      • ROME Season 1 - 25,000,000 $RIZ in rewards
    • Swarms and Swarm Staking
    • Lending Market
    • User Guide - ROME Dashboard
      • PAG
      • Reputation & Rewards
      • Swarm Project Creation
      • Swarm Staking
      • Borrow Market
      • Lending Guide
  • rClients (ROME 🏛️)
    • rClient CLI Guide
  • OCY - DATA
  • ADCS - CONNECTIVITY
    • Overview
    • Core components
    • Create an Adapter
    • Create your consumer smart contract
    • How to automate your contract execution with Gelato
    • How to Become a Provider
    • Developer
  • NOSTRINGS - IDENTITY
  • VORD - APPLICATION
    • VORD
    • Sidelined
    • AI-Powered Telegram Bots (Coming Soon)
  • Rivalz Alliance & Ecosystem
  • Intel Incentivized Testnet
  • zNode (Validators)
    • zNode Utility
    • Running a zNode
    • Delegating a zNode
      • Rivalz zNode - NodeOps Delegation
    • zNode Burn Event (Ended)
  • RIZ Token
    • RIZ Overview & Contracts
    • Airdrop and Eligibility Requirements
      • Airdrop User Guide
      • Claim Page Guide
    • zNode RIZ Drop
    • $RIZ Tokenomics
    • $RIZ Staking User Guide
    • $wRIZ Staking User Guide
    • Stake to Aerodrome Liquidity Pool
    • Wrapping and Unwrapping $wRIZ User Guide
  • Roadmap
  • Official Links
Powered by GitBook
On this page
  • Understanding Adapter Output Formats
  • Create your consumer smart contract.
  1. ADCS - CONNECTIVITY

Create your consumer smart contract

Understanding Adapter Output Formats

Before integrating any adapter into your smart contracts, it's crucial to understand its output format. This understanding is essential for successful integration and preventing potential contract errors.

Create your consumer smart contract.

  • You need to inherit you consumer contract from our list of contracts based on you specific usecase. You can find the list of contracts [here]

  • Some core function of the smart contract you need to implement are:

function requestBytes32Data(
    uint32 _callbackGasLimit,
    bytes32 _jobId,
    string memory _from
        ) external returns (uint256 requestId) {
        ADCS.Request memory req = buildRequest(_jobId, keccak256(abi.encodePacked("bytes32")));
        req.add("from", _from);
    requestId = COORDINATOR.requestData(_callbackGasLimit, req);
    emit DataRequestedBytes32(requestId);
}

You need to specify the _jobId, adapter parameters and _callbackGasLimit for the request.

function fulfillDataRequest(uint256, bytes32 response) internal virtual override {
    lastBytes32 = response;
    /// You business logic here
}

You need to implement your business logic in the fulfillDataRequest function.

Now you can deploy your contract and start requesting data from the ADCS platform

PreviousCreate an AdapterNextHow to automate your contract execution with Gelato

Last updated 1 month ago