IDotnsNameEscrowGovernance

Git Source

Title: dotNS Name Escrow governance

Governance calls on the escrow: spending the protocol fee balance.

Kept apart from @custom:contract IDotnsNameEscrow so the interface id that one reports through ERC-165 stays the same. The escrow reports both.

Note: security-contact: admin@parity.io

Functions

withdrawProtocolFees

Sends amount of the protocol fee balance to to.

Restricted to a substrate Root dispatch made to the escrow itself, otherwise

Notes:

  • reverts: NotRoot. to must be non-zero (@custom:reverts IDotnsNameEscrow.InvalidRecipient), amount non-zero (@custom:reverts IDotnsNameEscrow.InvalidAmount) and at most the balance (@custom:reverts ProtocolFeesExceeded). Only the protocol fee balance is spent: deposits, pending withdrawals and refund entries stay out of reach. A recipient that rejects the transfer

  • reverts: ProtocolFeesTransferFailed. Emits @custom:emits ProtocolFeesWithdrawn.

function withdrawProtocolFees(address to, uint256 amount) external;

Parameters

NameTypeDescription
toaddressAddress the fees are sent to.
amountuint256Native amount to send, in wei.

Events

ProtocolFeesWithdrawn

Emitted when governance sends part of the protocol fee balance to to.

event ProtocolFeesWithdrawn(address indexed to, uint256 amount);

Parameters

NameTypeDescription
toaddressAddress the fees were sent to.
amountuint256Native amount sent.

Errors

NotRoot

Thrown when the caller is not a direct substrate Root dispatch.

error NotRoot();

ProtocolFeesExceeded

Thrown when a withdrawal asks for more than the protocol fee balance.

error ProtocolFeesExceeded(uint256 amount, uint256 available);

Parameters

NameTypeDescription
amountuint256Amount asked for.
availableuint256Current protocol fee balance.

ProtocolFeesTransferFailed

Thrown when to does not accept the native transfer.

error ProtocolFeesTransferFailed(address to);

Parameters

NameTypeDescription
toaddressAddress that rejected the transfer.