IRateRegistry

Git Source

Inherits: IMigratable, IRegistryParametersErrors

This interface exposes functionality for updating the rates, tracking them historically.

Functions

initialize

Initializes the contract.

function initialize() external;

updateRates

Updates the rates.

function updateRates() external;

getRates

Returns a slice of the Rates list for pagination.

function getRates(uint256 fromIndex_, uint256 count_) external view returns (Rates[] memory rates_);

Parameters

NameTypeDescription
fromIndex_uint256Index from which to start (must be < allRates.length).
count_uint256The number of items to return.

Returns

NameTypeDescription
rates_Rates[]The subset of Rates.

getRatesCount

The total number of Rates stored.

function getRatesCount() external view returns (uint256 count_);

messageFeeParameterKey

The parameter registry key used to fetch the message fee.

function messageFeeParameterKey() external pure returns (string memory key_);

storageFeeParameterKey

The parameter registry key used to fetch the storage fee.

function storageFeeParameterKey() external pure returns (string memory key_);

congestionFeeParameterKey

The parameter registry key used to fetch the congestion fee.

function congestionFeeParameterKey() external pure returns (string memory key_);

targetRatePerMinuteParameterKey

The parameter registry key used to fetch the target rate per minute.

function targetRatePerMinuteParameterKey() external pure returns (string memory key_);

migratorParameterKey

The parameter registry key used to fetch the migrator.

function migratorParameterKey() external pure returns (string memory key_);

parameterRegistry

The address of the parameter registry.

function parameterRegistry() external view returns (address parameterRegistry_);

Events

RatesUpdated

Emitted when the rates are updated.

event RatesUpdated(uint64 messageFee, uint64 storageFee, uint64 congestionFee, uint64 targetRatePerMinute);

Parameters

NameTypeDescription
messageFeeuint64The message fee.
storageFeeuint64The storage fee.
congestionFeeuint64The congestion fee.
targetRatePerMinuteuint64The target rate per minute.

Errors

ZeroParameterRegistry

Thrown when the parameter registry address is being set to zero (i.e. address(0)).

error ZeroParameterRegistry();

ZeroCount

Thrown when the query count is zero.

error ZeroCount();

FromIndexOutOfRange

Thrown when the fromIndex is out of range.

error FromIndexOutOfRange();

EndIndexOutOfRange

Thrown when the end index (as computed from the fromIndex and count) is out of range.

error EndIndexOutOfRange();

NoChange

Thrown when there is no change to an updated parameter.

error NoChange();

Structs

Rates

The Rates struct holds the fees and the start time of the rates.

struct Rates {
    uint64 messageFee;
    uint64 storageFee;
    uint64 congestionFee;
    uint64 targetRatePerMinute;
    uint64 startTime;
}

Properties

NameTypeDescription
messageFeeuint64The message fee.
storageFeeuint64The storage fee.
congestionFeeuint64The congestion fee.
targetRatePerMinuteuint64The target rate per minute.
startTimeuint64The start time when the rates became effective.