IRateRegistry
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
| Name | Type | Description |
|---|---|---|
fromIndex_ | uint256 | Index from which to start (must be < allRates.length). |
count_ | uint256 | The number of items to return. |
Returns
| Name | Type | Description |
|---|---|---|
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
| Name | Type | Description |
|---|---|---|
messageFee | uint64 | The message fee. |
storageFee | uint64 | The storage fee. |
congestionFee | uint64 | The congestion fee. |
targetRatePerMinute | uint64 | The 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
| Name | Type | Description |
|---|---|---|
messageFee | uint64 | The message fee. |
storageFee | uint64 | The storage fee. |
congestionFee | uint64 | The congestion fee. |
targetRatePerMinute | uint64 | The target rate per minute. |
startTime | uint64 | The start time when the rates became effective. |