Interface Requirement of a Consumer Contract
In order to consume the data feeds, your consumer contract is required to indicate the owner of the consumer contract.
You must return the address that you will be using to allow the consumer contract to be able to consume the data feeds from at least one of the specified functions.
The specified functions are as follows.
function owner() external view returns (address)
function dataFeedOwner() external view returns (address)
Example 1
This consumer contract implements a function about ownership, which is owner()
. The implemented function returns 0x9f5dc5b73adeccd5d4cee55ab7ec003e1dc6b495
as the owner of the contract. 0x9f5…495
is the only address that can allow the consumer contract to consume the data feeds
Example 2
This consumer contract implements only dataFeedOwner(). The implemented function returns 0xA3E098DCECa0baBeA44bcd10405f1F8c97fd27f0 as the owner of the contract. 0xA3E…7f0 is the only address that can allow the consumer contract to consume the data feeds
Example 3
This consumer contract implements both owner()
and dataFeedOwner()
. The owner()
method returns 0x9f5DC5B73ADECcD5D4cEe55Ab7ec003E1Dc6b495
, and the dataFeedOwner()
method returns 0xA3E098DCECa0baBeA44bcd10405f1F8c97fd27f0
. The consumer contract can be allowed by both 0x9f5…495
and 0xA3E…7f0
. This means it is possible for 0xA3E…7f0
to allow the consumer contract while the consumer contract is being allowed by 0x9f5…495
, resulting in the consumer contract disappearing from 0x9f5…495
’s allowed address list and appearing in 0xA3E…7f0
’s allowed address list instead, as 0x9f5…495
and 0xA3E…7f0
are both considered the owner of the consumer contract, and a consumer contract can only be allowed by only one subscribed token at a time.
Last updated