IDistributionManager

Git Source

Inherits: IMigratable, IRegistryParametersErrors

This interface exposes functionality for distributing fees.

Functions

initialize

Initializes the contract.

function initialize() external;

claimProtocolFees

Claims protocol fees.

function claimProtocolFees(uint32[] calldata originatorNodeIds_, uint256[] calldata payerReportIndices_)
    external
    returns (uint96 claimed_);

Parameters

NameTypeDescription
originatorNodeIds_uint32[]The IDs of the originator nodes of the payer reports.
payerReportIndices_uint256[]The payer report indices for each of the respective originator node IDs.

Returns

NameTypeDescription
claimed_uint96The amount of protocol fees claimed.

claim

Claims fees for a node for an array of payer reports.

The node IDs in originatorNodeIds_ don't need to be unique.

function claim(uint32 nodeId_, uint32[] calldata originatorNodeIds_, uint256[] calldata payerReportIndices_)
    external
    returns (uint96 claimed_);

Parameters

NameTypeDescription
nodeId_uint32The ID of the node.
originatorNodeIds_uint32[]The IDs of the originator nodes of the payer reports.
payerReportIndices_uint256[]The payer report indices for each of the respective originator node IDs.

Returns

NameTypeDescription
claimed_uint96The amount of fees claimed.

withdrawProtocolFees

Withdraws protocol fees.

function withdrawProtocolFees() external returns (uint96 withdrawn_);

Returns

NameTypeDescription
withdrawn_uint96The amount of protocol fees withdrawn.

withdrawProtocolFeesIntoUnderlying

Withdraws protocol fees, unwrapped as underlying token.

function withdrawProtocolFeesIntoUnderlying() external returns (uint96 withdrawn_);

Returns

NameTypeDescription
withdrawn_uint96The amount of protocol fees withdrawn.

withdraw

Withdraws fees for a node.

function withdraw(uint32 nodeId_, address recipient_) external returns (uint96 withdrawn_);

Parameters

NameTypeDescription
nodeId_uint32The ID of the node.
recipient_addressThe address to withdraw the fee tokens to.

Returns

NameTypeDescription
withdrawn_uint96The amount of fee tokens withdrawn.

withdrawIntoUnderlying

Withdraws fees for a node, unwrapped as underlying fee token.

function withdrawIntoUnderlying(uint32 nodeId_, address recipient_) external returns (uint96 withdrawn_);

Parameters

NameTypeDescription
nodeId_uint32The ID of the node.
recipient_addressThe address to withdraw the underlying fee tokens to.

Returns

NameTypeDescription
withdrawn_uint96The amount of fee tokens withdrawn.

updatePauseStatus

Updates the pause status.

Ensures the new pause status is not equal to the old pause status.

function updatePauseStatus() external;

updateProtocolFeesRecipient

Updates the protocol fees recipient.

function updateProtocolFeesRecipient() external;

migratorParameterKey

The parameter registry key used to fetch the migrator.

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

pausedParameterKey

The parameter registry key used to fetch the paused status.

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

protocolFeesRecipientParameterKey

The parameter registry key used to fetch the protocol fees recipient.

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

parameterRegistry

The address of the parameter registry.

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

nodeRegistry

The address of the node registry.

function nodeRegistry() external view returns (address nodeRegistry_);

payerReportManager

The address of the payer report manager.

function payerReportManager() external view returns (address payerReportManager_);

payerRegistry

The address of the payer registry.

function payerRegistry() external view returns (address payerRegistry_);

feeToken

The address of the fee token.

function feeToken() external view returns (address feeToken_);

protocolFeesRecipient

The address of the protocol fees recipient.

function protocolFeesRecipient() external view returns (address protocolFeesRecipient_);

owedProtocolFees

The amount of claimed protocol fees owed to the protocol.

function owedProtocolFees() external view returns (uint96 owedProtocolFees_);

totalOwedFees

The total amount of fees owed.

function totalOwedFees() external view returns (uint96 totalOwedFees_);

paused

The pause status.

function paused() external view returns (bool paused_);

getOwedFees

Returns the amount of claimed fees owed to a node.

function getOwedFees(uint32 nodeId_) external view returns (uint96 owedFees_);

Parameters

NameTypeDescription
nodeId_uint32The ID of the node.

Returns

NameTypeDescription
owedFees_uint96The amount of fees owed.

areProtocolFeesClaimed

Returns whether protocol fees associated with a settled payer report have been claimed.

function areProtocolFeesClaimed(uint32 originatorNodeId_, uint256 payerReportIndex_)
    external
    view
    returns (bool areClaimed_);

Parameters

NameTypeDescription
originatorNodeId_uint32The ID of the originator node of the payer report.
payerReportIndex_uint256The index of the payer report.

Returns

NameTypeDescription
areClaimed_boolWhether protocol fees associated with a settled payer report have been claimed.

areFeesClaimed

Returns whether a node has claimed fees associated with a settled payer report.

function areFeesClaimed(uint32 nodeId_, uint32 originatorNodeId_, uint256 payerReportIndex_)
    external
    view
    returns (bool areClaimed_);

Parameters

NameTypeDescription
nodeId_uint32The ID of the node.
originatorNodeId_uint32The ID of the originator node of the payer report.
payerReportIndex_uint256The index of the payer report.

Returns

NameTypeDescription
areClaimed_boolWhether the node has claimed fees associated with a settled payer report.

Events

ProtocolFeesClaim

Emitted when protocol fees are claimed.

event ProtocolFeesClaim(uint32 indexed originatorNodeId, uint256 indexed payerReportIndex, uint96 amount);

Parameters

NameTypeDescription
originatorNodeIduint32The ID of the originator node of the payer report.
payerReportIndexuint256The index of the payer report.
amountuint96The amount of protocol fees claimed.

Claim

Emitted when a claim is made.

event Claim(uint32 indexed nodeId, uint32 indexed originatorNodeId, uint256 indexed payerReportIndex, uint96 amount);

Parameters

NameTypeDescription
nodeIduint32The ID of the node.
originatorNodeIduint32The ID of the originator node of the payer report.
payerReportIndexuint256The index of the payer report.
amountuint96The amount of fees claimed.

ProtocolFeesWithdrawal

Emitted when protocol fees are withdrawn.

event ProtocolFeesWithdrawal(uint96 amount);

Parameters

NameTypeDescription
amountuint96The amount of protocol fees withdrawn.

Withdrawal

Emitted when a withdrawal of owed fees is made.

event Withdrawal(uint32 indexed nodeId, uint96 amount);

Parameters

NameTypeDescription
nodeIduint32The ID of the node.
amountuint96The amount of tokens withdrawn.

PauseStatusUpdated

Emitted when the pause status is set.

event PauseStatusUpdated(bool indexed paused);

Parameters

NameTypeDescription
pausedboolThe new pause status.

ProtocolFeesRecipientUpdated

Emitted when the protocol fees recipient is updated.

event ProtocolFeesRecipientUpdated(address protocolFeesRecipient);

Parameters

NameTypeDescription
protocolFeesRecipientaddressThe new protocol fees recipient.

Errors

ZeroParameterRegistry

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

error ZeroParameterRegistry();

ZeroNodeRegistry

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

error ZeroNodeRegistry();

ZeroPayerReportManager

Thrown when the payer report manager address is being set to zero (i.e. address(0)).

error ZeroPayerReportManager();

ZeroPayerRegistry

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

error ZeroPayerRegistry();

ZeroFeeToken

Thrown when the fee token address is being set to zero (i.e. address(0)).

error ZeroFeeToken();

NotNodeOwner

Thrown when the caller is not the owner of the specified node.

error NotNodeOwner();

ArrayLengthMismatch

Thrown when the lengths of input arrays don't match.

error ArrayLengthMismatch();

AlreadyClaimed

Thrown when a payer report has already been claimed.

error AlreadyClaimed(uint32 originatorNodeId, uint256 payerReportIndex);

PayerReportNotSettled

Thrown when the payer report is not settled.

error PayerReportNotSettled(uint32 originatorNodeId, uint256 payerReportIndex);

NotInPayerReport

Thrown when the node ID is not in a payer report.

error NotInPayerReport(uint32 originatorNodeId, uint256 payerReportIndex);

ZeroRecipient

Thrown when the recipient address is zero (i.e. address(0)).

error ZeroRecipient();

NoFeesOwed

Thrown when the node has no fees owed.

error NoFeesOwed();

ZeroAvailableBalance

Thrown when the contract's available balance is zero.

error ZeroAvailableBalance();

Paused

Thrown when any pausable function is called when the contract is paused.

error Paused();

NoChange

Thrown when there is no change to an updated parameter.

error NoChange();

ZeroProtocolFeeRecipient

Thrown when the protocol fees recipient address is zero (i.e. address(0)).

error ZeroProtocolFeeRecipient();