# 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 %}
