Api3ReaderProxyV1 deployment
💡 Tip
If API3 representatives have provided you with commands to print Api3ReaderProxyV1 addresses, your proxies should already be deployed and you do not need to follow this page.
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.
💡 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 inbytes32
string form. For example,dapiName
for the ETH/USD data feed is0x4554482f55534400000000000000000000000000000000000000000000000000
.ℹ️ 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 auint256
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 assolidityuint256(keccak256(abi.encodePacked(keccak256(abi.encodePacked(dappAliasAsString)), block.chainid)));
1For the communal Api3ReaderProxyV1 deployments,
dappId
is1
.While deploying an Api3ReaderProxyV1, a
bytes
-typemetadata
is specified, whose hash is used as the CREATE2 salt. It should be left empty, i.e., as0x
.