Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 2.83 KB

File metadata and controls

40 lines (26 loc) · 2.83 KB

Api3ReaderProxyV1 deployment

Api3ReaderProxyV1 is designed to be deployed by calling the deployApi3ReaderProxyV1() function of Api3ReaderProxyV1Factory. Purchasing a plan for a data feed on API3 Market deploys a communal Api3ReaderProxyV1 for it automatically, whose address is displayed on the integration page. Alternatively, data-feed-reader-example provides instructions for how (communal and dApp-specific) Api3ReaderProxyV1 contracts can be deployed programmatically.

::: info 💡 Tip

In short, if your dApp has a dApp alias assigned, deploy your own Api3ReaderProxyV1 contracts by referring to the instructions in data-feed-reader-example. Otherwise, use the communal Api3ReaderProxyV1 addresses displayed on the integration pages of the respective data feeds.

With either option, we recommended you to validate the Api3ReaderProxyV1 addresses using @api3/contracts.

:::

Parameters

Deploying Api3ReaderProxyV1 by calling Api3ReaderProxyV1Factory requires three parameters:

  • dapiName is the name of the data feed in bytes32 string form. For example, dapiName for the ETH/USD data feed is 0x4554482f55534400000000000000000000000000000000000000000000000000. ::: info ℹ️ Info

    The term dAPI can be traced back to the API3 whitepaper, and refers to a DAO-governed data feed that is built out of first-party oracles. For the purposes of this page, you can think of the terms dAPI and data feed to be interchangeable.

    :::

  • dappId is a uint256 that API3 has assigned to a specific dApp on a specific chain. It is similar to a chain ID in function. In Solidity, it can be derived as

    uint256(keccak256(abi.encodePacked(keccak256(abi.encodePacked(dappAliasAsString)), block.chainid)));

    For the communal Api3ReaderProxyV1 deployments, dappId is 1.

  • While deploying an Api3ReaderProxyV1, a bytes-type metadata is specified, whose hash is used as the CREATE2 salt. It should be left empty, i.e., as 0x.