Pull based oracles
Pull Based Oracle
Pull or also known as Request Based Oracle enables the creation of requests for asset prices on a source blockchain. These requests are sent through a mailbox on the current chain and ultimately delivered to the DIA chain, which retrieves and delivers the required price data.
How It Works
1. Request Creation
A request can be made from the source chain for an asset symbol whose price is required. These requests pass through the chain's mailbox, and the respective mailbox addresses are as follows:
MailBox
DIA Lasernet Testnet:
0xB1869f5e26C7e673ECFF555F5AbAbF83c145044a
Reciepient
DIA Lasernet Testnet:
0x3b64691c14bca163c8230e726c6f880b0e74ab0d
ISM Address
DIA Lasernet Testnet:
0x005Fa5AcC38C06B89274f3b57347F1663e253039
2. Request Body Format
The request body is formatted as follows in JavaScript:
The request body is formatted as follows in solidity:
Message Delivery Process
Once a request is created, it is transmitted to the Hyperlane mailbox. The message is then relayed to the OracleRequestRecipient contract , where the price data is fetched from the Oracle Metadata Contract.
Oracle Metadada Contract:
0x7bf8a5b1bfC7B4D6855d9613fEE279F91B48e7EA
Response and Callback
Upon receiving the request, the DIA chain initiates a transaction to deliver the message back to the end contract on the source chain. The recipient contract on the source chain must implement the IMessageRecipient interface, which includes a handle function that will receive the price quotation.
Recipient
Oracle Request Recipient:
0x97C989740aE765518FA85E64ED61512D39765e43
Example Request Based Oracle
Pull Base Oracle Flow
Last updated