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.
:::
Deploying Api3ReaderProxyV1 by calling Api3ReaderProxyV1Factory requires three parameters:
-
dapiNameis the name of the data feed inbytes32string form. For example,dapiNamefor the ETH/USD data feed is0x4554482f55534400000000000000000000000000000000000000000000000000. ::: info ℹ️ InfoThe 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.
:::
-
dappIdis auint256that 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 asuint256(keccak256(abi.encodePacked(keccak256(abi.encodePacked(dappAliasAsString)), block.chainid)));
For the communal Api3ReaderProxyV1 deployments,
dappIdis1. -
While deploying an Api3ReaderProxyV1, a
bytes-typemetadatais specified, whose hash is used as the CREATE2 salt. It should be left empty, i.e., as0x.