Skip to main content

Errors

Git Source

Title: Errors

Common custom errors shared across contracts.

Errors​

Unauthorized​

Thrown when the account is not authorized to perform the action.

Intended for access control checks in contracts that do not use the ROLES module.

error Unauthorized(address account, string reason);

Parameters

NameTypeDescription
accountaddressThe unauthorized account.
reasonstringAn identifier of the role or capability the account was expected to hold (e.g. "owner").

InvalidRecipient​

Thrown when a recipient address is invalid (e.g. the zero address).

error InvalidRecipient();

BadInput​

Thrown when an input argument fails.

error BadInput(string parameter);

Parameters

NameTypeDescription
parameterstringA short identifier of the offending input (e.g. the parameter name).