FeedRegistry

Git Source

Inherits: IFeedRegistry

State Variables

WRAPPED_NATIVE_TOKEN

address internal immutable WRAPPED_NATIVE_TOKEN;

WRAPPED_BTC_TOKEN

address internal immutable WRAPPED_BTC_TOKEN;

Functions

constructor

constructor(address _wrappedNativeToken, address _wrappedBTCToken);

batchRegisterFeedMappings

Registers mappings of ERC20 token, and denomination (ETH, BTC, or USD) to feed

function batchRegisterFeedMappings(FeedMappingArgs[] memory args) external virtual;

Parameters

NameTypeDescription
argsFeedMappingArgs[]The arguments for the new mappings

feed

Returns the feed for token and denomination

function feed(address token, address denomination) external view returns (address);

Parameters

NameTypeDescription
tokenaddressThe exchange token (ERC20 token)
denominationaddressThe Chainlink token denomination to quote against (ETH, BTC, or USD)

Returns

NameTypeDescription
<none>addressThe feed address

_feed

Returns the feed for token and denomination

function _feed(address token, address denomination) internal view returns (address);

_feedExists

Returns true if a feed exists for token and denomination

function _feedExists(address token, address denomination) internal view returns (bool);

_tokenToDenomination

Returns the denomination mapped to token, if it has one

Should only map wrapped tokens which are guaranteed to have a 1:1 ratio

function _tokenToDenomination(address token) internal view returns (address);

_mapToDenominationAndSort

Returns the sorted and mapped tokens for tokenA and tokenB

function _mapToDenominationAndSort(address tokenA, address tokenB) internal view returns (address, address);

_mapToDenomination

Returns the mapped tokens for tokenA and tokenB

function _mapToDenomination(address tokenA, address tokenB)
    internal
    view
    returns (address mappedTokenA, address mappedTokenB);