# Ethereum Data Oracle

{% hint style="info" %}
This feature is in beta, so please fill out [this form](https://airtable.com/shrKT6HrHi2oDcmrf) to get in touch with the Succinct team about using it.
{% endhint %}

The Telepathy Ethereum data oracle allows developers to trustlessly request data from Ethereum Mainnet on \*\*\*\* any other chain. This can be useful, for example, to obtain data that makes cross-chain airdrops or cross-chain ENS name usage possible.

## Requesting Data

1\) To request data from a different chain, you simply call the `oracle.requestCrossChain` function. Here is an example of requesting the `ERC721.ownerOf` function for mainnet.

```solidity
telepathyOracle.requestCrossChain(
    address(mainnetContractAddress),
    abi.encodeWithSelector(IERC721.ownerOf.selector, _tokenId),
    address(myCallbackAddress)
);
```

2\) To process the data that the oracle returns, you will want to extend the `OracleCallbackBase` contract and implement the `handleOracleResponse` function. The base contract ensures that the function is only called on a valid response message.

```solidity
abstract contract OracleCallbackBase is IOracleCallbackReceiver {
    error NotFromOracle(address sender);

    address private _oracle;

    constructor(address oracle) {
        _oracle = oracle;
    }

    function rawHandleOracleResponse(
        uint256 nonce,
        bytes memory responseData,
        bool responseSuccess
    ) external override {
        if (msg.sender != _oracle) {
            revert NotFromOracle(msg.sender);
        }
        handleOracleResponse(nonce, responseData, responseSuccess);
    }

    function handleOracleResponse(
        uint256 nonce,
        bytes memory responseData,
        bool responseSuccess
    ) internal virtual;
}
```

{% hint style="info" %}
Ethereum Data Oracle is currently in an experimental state. For updates and assistence, please join our [Discord](https://discord.gg/succinctlabs).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.telepathy.xyz/build-with-telepathy/interchain-data-oracle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
