Skip to content

FtsoRegistry#

Handles registration of assets to the FTSO system.

Functions#

addFtso#

Defined in FtsoRegistry (Docs, Source).

function addFtso(
    contract IIFtso _ftsoContract
) external returns (
    uint256 _assetIndex);

Add a new FTSO contract to the registry.

Only the ftsoManager can call this method.

Parameters Type Description
_ftsoContract contract IIFtso New target FTSO contract.
Returns Type Description
_assetIndex uint256 The FTSO index assigned to the new asset.

cancelGovernanceCall#

Defined in GovernedBase (Docs, Source).

function cancelGovernanceCall(
    bytes4 _selector
) external;

Cancel a timelocked governance call before it has been executed.

Only governance can call this method.

Parameters Type Description
_selector bytes4 The method selector.

constructor#

Defined in FtsoRegistry (Docs, Source).

constructor(
) public;

executeGovernanceCall#

Defined in GovernedBase (Docs, Source).

function executeGovernanceCall(
    bytes4 _selector
) external;

Execute the timelocked governance calls once the timelock period expires.

Only executor can call this method.

Parameters Type Description
_selector bytes4 The method selector (only one timelocked call per method is stored).

getAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

function getAddressUpdater(
) public view returns (
    address _addressUpdater);

Returns the configured address updater.

Returns Type Description
_addressUpdater address The AddresUpdater contract that can update our contract address list, as a response to a governance call.

getAllCurrentPrices#

Defined in FtsoRegistry (Docs, Source).

function getAllCurrentPrices(
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of all supported assets.

Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getAllFtsos#

Defined in FtsoRegistry (Docs, Source).

function getAllFtsos(
) external view returns (
    contract IIFtso[] _ftsos);

Return all currently supported FTSO contracts.

Returns Type Description
_ftsos contract IIFtso[] Array of FTSO contract addresses.

getCurrentPrice#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPrice(
    uint256 _assetIndex
) external view returns (
    uint256 _price,
    uint256 _timestamp);

Public view function to get the current price of a given active FTSO index. Reverts if the index is not supported.

Parameters Type Description
_assetIndex uint256
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.

getCurrentPrice#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPrice(
    string _symbol
) external view returns (
    uint256 _price,
    uint256 _timestamp);

Public view function to get the current price of a given active asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^ASSET_PRICE_USD_DECIMALS.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.

getCurrentPriceWithDecimals#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPriceWithDecimals(
    uint256 _assetIndex
) external view returns (
    uint256 _price,
    uint256 _timestamp,
    uint256 _assetPriceUsdDecimals);

Public view function to get the current price and decimals of a given active FTSO index. Reverts if the index is not supported.

Parameters Type Description
_assetIndex uint256 Index to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals uint256 Number of decimals used to return the _price.

getCurrentPriceWithDecimals#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPriceWithDecimals(
    string _symbol
) external view returns (
    uint256 _price,
    uint256 _timestamp,
    uint256 _assetPriceUsdDecimals);

Public view function to get the current price and decimals of a given active asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_price uint256 Current price of the asset in USD multiplied by 10^_assetPriceUsdDecimals.
_timestamp uint256 Timestamp for when this price was updated, in seconds since UNIX epoch.
_assetPriceUsdDecimals uint256 Number of decimals used to return the _price.

getCurrentPricesByIndices#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPricesByIndices(
    uint256[] _indices
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of a list of indices. Reverts if any of the indices is not supported.

Parameters Type Description
_indices uint256[] Array of indices to query.
Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getCurrentPricesBySymbols#

Defined in FtsoRegistry (Docs, Source).

function getCurrentPricesBySymbols(
    string[] _symbols
) external view returns (
    struct IFtsoRegistry.PriceInfo[]);

Returns the current price of a list of asset symbols. Reverts if any of the symbols is not supported.

Parameters Type Description
_symbols string[] Array of symbols to query.
Returns Type Description
[0] struct IFtsoRegistry.PriceInfo[] Array of PriceInfo structures.

getFtso#

Defined in FtsoRegistry (Docs, Source).

function getFtso(
    uint256 _assetIndex
) external view returns (
    contract IIFtso _activeFtso);

Returns the address of the FTSO contract for a given index. Reverts if unsupported index is passed.

Parameters Type Description
_assetIndex uint256
Returns Type Description
_activeFtso contract IIFtso

getFtsoBySymbol#

Defined in FtsoRegistry (Docs, Source).

function getFtsoBySymbol(
    string _symbol
) external view returns (
    contract IIFtso _activeFtso);

Returns the address of the FTSO contract for a given symbol. Reverts if unsupported symbol is passed.

Parameters Type Description
_symbol string The queried symbol.
Returns Type Description
_activeFtso contract IIFtso

getFtsoHistory#

Defined in FtsoRegistry (Docs, Source).

function getFtsoHistory(
    uint256 _assetIndex
) external view returns (
    contract IIFtso[5] _ftsoAddressHistory);

Get the history of FTSOs for given index. If there are less then MAX_HISTORY_LENGTH the remaining addresses will be 0 addresses. Reverts if index is not supported.

Parameters Type Description
_assetIndex uint256 Asset index to query.
Returns Type Description
_ftsoAddressHistory contract IIFtso[5] History of FTSOs contract for provided index.

getFtsoIndex#

Defined in FtsoRegistry (Docs, Source).

function getFtsoIndex(
    string _symbol
) external view returns (
    uint256 _assetIndex);

Returns the FTSO index corresponding to a given asset symbol. Reverts if the symbol is not supported.

Parameters Type Description
_symbol string Symbol to query.
Returns Type Description
_assetIndex uint256 The corresponding asset index.

getFtsoSymbol#

Defined in FtsoRegistry (Docs, Source).

function getFtsoSymbol(
    uint256 _assetIndex
) external view returns (
    string _symbol);

Returns the asset symbol corresponding to a given FTSO index. Reverts if the index is not supported.

Parameters Type Description
_assetIndex uint256
Returns Type Description
_symbol string The corresponding asset symbol.

getFtsos#

Defined in FtsoRegistry (Docs, Source).

function getFtsos(
    uint256[] _assetIndices
) external view returns (
    contract IFtsoGenesis[] _ftsos);

Get the addresses of the active FTSOs at the given indices. Reverts if any of the provided indices is non-existing or inactive.

Parameters Type Description
_assetIndices uint256[]
Returns Type Description
_ftsos contract IFtsoGenesis[] The array of FTSO addresses.

getSupportedFtsos#

Defined in FtsoRegistry (Docs, Source).

function getSupportedFtsos(
) external view returns (
    contract IIFtso[] _ftsos);

Get array of all FTSO contracts for all supported asset indices. The index of FTSO in returned array does not necessarily correspond to the asset's index. Due to deletion, some indices might be unsupported.

Use getSupportedIndicesAndFtsos to retrieve pairs of correct indices and FTSOs, where possible "null" holes are readily apparent.

Returns Type Description
_ftsos contract IIFtso[] Array of all supported FTSOs.

getSupportedIndices#

Defined in FtsoRegistry (Docs, Source).

function getSupportedIndices(
) external view returns (
    uint256[] _supportedIndices);

Returns the indices of the currently supported FTSOs. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all active FTSO indices in increasing order.

getSupportedIndicesAndFtsos#

Defined in FtsoRegistry (Docs, Source).

function getSupportedIndicesAndFtsos(
) external view returns (
    uint256[] _supportedIndices,
    contract IIFtso[] _ftsos);

Get all supported indices and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

getSupportedIndicesAndSymbols#

Defined in FtsoRegistry (Docs, Source).

function getSupportedIndicesAndSymbols(
) external view returns (
    uint256[] _supportedIndices,
    string[] _supportedSymbols);

Get all supported indices and corresponding symbols. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_supportedSymbols string[] Array of all supported symbols.

getSupportedIndicesSymbolsAndFtsos#

Defined in FtsoRegistry (Docs, Source).

function getSupportedIndicesSymbolsAndFtsos(
) external view returns (
    uint256[] _supportedIndices,
    string[] _supportedSymbols,
    contract IIFtso[] _ftsos);

Get all supported indices, symbols, and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedIndices uint256[] Array of all supported indices.
_supportedSymbols string[] Array of all supported symbols.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

getSupportedSymbols#

Defined in FtsoRegistry (Docs, Source).

function getSupportedSymbols(
) external view returns (
    string[] _supportedSymbols);

Returns the symbols of the currently supported FTSOs. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedSymbols string[] Array of all active FTSO symbols in increasing order.

getSupportedSymbolsAndFtsos#

Defined in FtsoRegistry (Docs, Source).

function getSupportedSymbolsAndFtsos(
) external view returns (
    string[] _supportedSymbols,
    contract IIFtso[] _ftsos);

Get all supported symbols and corresponding FTSO addresses. Active FTSOs are ones that currently receive price feeds.

Returns Type Description
_supportedSymbols string[] Array of all supported symbols.
_ftsos contract IIFtso[] Array of all supported FTSO addresses.

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

initialiseRegistry#

Defined in FtsoRegistry (Docs, Source).

function initialiseRegistry(
    address _addressUpdater
) external;

removeFtso#

Defined in FtsoRegistry (Docs, Source).

function removeFtso(
    contract IIFtso _ftso
) external;

Removes the FTSO and keeps part of the history. Reverts if the provided address is not supported.

From now on, the index this asset was using is "reserved" and cannot be used again. It will not be returned in any list of currently supported assets.

Only the ftsoManager can call this method.

Parameters Type Description
_ftso contract IIFtso Address of the FTSO contract to remove.

switchToProductionMode#

Defined in GovernedBase (Docs, Source).

function switchToProductionMode(
) external;

Enter the production mode after all the initial governance settings have been set. This enables timelocks and the governance can be obtained afterward by calling governanceSettings.getGovernanceAddress(). Emits GovernedProductionModeEntered.

updateContractAddresses#

Defined in AddressUpdatable (Docs, Source).

function updateContractAddresses(
    bytes32[] _contractNameHashes,
    address[] _contractAddresses
) external;

External method called from AddressUpdater only.

Modifiers#

onlyAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

modifier onlyAddressUpdater()

Only the AdressUpdater contract can call this method. Its address is set at construction time but it can also update itself.

onlyFtsoManager#

Defined in FtsoRegistry (Docs, Source).

modifier onlyFtsoManager()

Only the ftsoManager can call this method.

onlyGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyGovernance()

onlyImmediateGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyImmediateGovernance()

Variables#

ftsoManager#

Defined in FtsoRegistry (Docs, Source).

    contract IIFtsoManager ftsoManager

FtsoManager contract that can add and remove assets to the registry.

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

When true, governance is enabled and cannot be disabled. See switchToProductionMode.

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.