IDotnsNameEscrowGovernance
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.
tomust be non-zero (@custom:reverts IDotnsNameEscrow.InvalidRecipient),amountnon-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
| Name | Type | Description |
|---|---|---|
to | address | Address the fees are sent to. |
amount | uint256 | Native 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
| Name | Type | Description |
|---|---|---|
to | address | Address the fees were sent to. |
amount | uint256 | Native 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
| Name | Type | Description |
|---|---|---|
amount | uint256 | Amount asked for. |
available | uint256 | Current protocol fee balance. |
ProtocolFeesTransferFailed
Thrown when to does not accept the native transfer.
error ProtocolFeesTransferFailed(address to);
Parameters
| Name | Type | Description |
|---|---|---|
to | address | Address that rejected the transfer. |