Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

IERC20Errors

Standard ERC-20 Errors Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.

Errors

ERC20InsufficientBalance

Indicates an error related to the current balance of a sender. Used in transfers.

error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

Parameters

NameTypeDescription
senderaddressAddress whose tokens are being transferred.
balanceuint256Current balance for the interacting account.
neededuint256Minimum amount required to perform a transfer.

ERC20InvalidSender

Indicates a failure with the token sender. Used in transfers.

error ERC20InvalidSender(address sender);

Parameters

NameTypeDescription
senderaddressAddress whose tokens are being transferred.

ERC20InvalidReceiver

Indicates a failure with the token receiver. Used in transfers.

error ERC20InvalidReceiver(address receiver);

Parameters

NameTypeDescription
receiveraddressAddress to which tokens are being transferred.

ERC20InsufficientAllowance

Indicates a failure with the spender’s allowance. Used in transfers.

error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

Parameters

NameTypeDescription
spenderaddressAddress that may be allowed to operate on tokens without being their owner.
allowanceuint256Amount of tokens a spender is allowed to operate with.
neededuint256Minimum amount required to perform a transfer.

ERC20InvalidApprover

Indicates a failure with the approver of a token to be approved. Used in approvals.

error ERC20InvalidApprover(address approver);

Parameters

NameTypeDescription
approveraddressAddress initiating an approval operation.

ERC20InvalidSpender

Indicates a failure with the spender to be approved. Used in approvals.

error ERC20InvalidSpender(address spender);

Parameters

NameTypeDescription
spenderaddressAddress that may be allowed to operate on tokens without being their owner.