Passer au contenu principal

BaseStrategyChainlinkMultiplePriceFeeds

This contract allows a strategy to store Chainlink price feeds for price retrieval.

priceFeeds

mapping(address => address) priceFeeds

This maps the collection address to a Chainlink price feed address. All prices returned from the price feeds must have 18 decimals.

PriceFeedUpdated

event PriceFeedUpdated(address collection, address priceFeed)

It is emitted when a collection's price feed address is added.

Parameters

NameTypeDescription
collectionaddressNFT collection address
priceFeedaddressChainlink price feed address

constructor

constructor(address _owner) public

Constructor

Parameters

NameTypeDescription
_owneraddressOwner address

setPriceFeed

function setPriceFeed(address _collection, address _priceFeed) external

This function allows the owner to set an NFT collection's Chainlink price feed address.

Only callable by owner. Once the price feed is set for a collection, it is not possible to adjust it after.

Parameters

NameTypeDescription
_collectionaddressNFT collection address
_priceFeedaddressChainlink price feed address