Skip to content
Lattice

IERC20

Git Source

Title: IERC20

Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol)

Interface for the ERC-20 token standard plus ERC-20 metadata extension.

Functions

totalSupply

Returns the total token supply.

function totalSupply() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256

balanceOf

Returns the token balance of account.

function balanceOf(address account) external view returns (uint256);

Parameters

NameTypeDescription
accountaddress

Returns

NameTypeDescription
<none>uint256

transfer

Transfers value tokens from the caller to to.

function transfer(address to, uint256 value) external returns (bool);

Parameters

NameTypeDescription
toaddress
valueuint256

Returns

NameTypeDescription
<none>bool

allowance

Returns the remaining number of tokens that spender can spend on behalf of owner.

function allowance(address owner, address spender) external view returns (uint256);

Parameters

NameTypeDescription
owneraddress
spenderaddress

Returns

NameTypeDescription
<none>uint256

approve

Sets value as the allowance of spender over the caller's tokens.

function approve(address spender, uint256 value) external returns (bool);

Parameters

NameTypeDescription
spenderaddress
valueuint256

Returns

NameTypeDescription
<none>bool

transferFrom

Transfers value tokens from from to to using the caller's allowance.

function transferFrom(address from, address to, uint256 value) external returns (bool);

Parameters

NameTypeDescription
fromaddress
toaddress
valueuint256

Returns

NameTypeDescription
<none>bool

name

Returns the name of the token.

function name() external view returns (string memory);

Returns

NameTypeDescription
<none>string

symbol

Returns the symbol of the token.

function symbol() external view returns (string memory);

Returns

NameTypeDescription
<none>string

decimals

Returns the number of decimals.

function decimals() external view returns (uint8);

Returns

NameTypeDescription
<none>uint8

Events

Transfer

Emitted when value tokens are moved from from to to.

event Transfer(address indexed from, address indexed to, uint256 value);

Parameters

NameTypeDescription
fromaddress
toaddress
valueuint256

Approval

Emitted when the allowance of a spender for an owner is set.

event Approval(address indexed owner, address indexed spender, uint256 value);

Parameters

NameTypeDescription
owneraddress
spenderaddress
valueuint256

Errors

ERC20InsufficientBalance

The sender's balance is insufficient for the operation.

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

Parameters

NameTypeDescription
senderaddress
balanceuint256
neededuint256

ERC20InvalidSender

sender is the zero address.

error ERC20InvalidSender(address sender);

Parameters

NameTypeDescription
senderaddress

ERC20InvalidReceiver

receiver is the zero address.

error ERC20InvalidReceiver(address receiver);

Parameters

NameTypeDescription
receiveraddress

ERC20InsufficientAllowance

The spender does not have enough allowance.

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

Parameters

NameTypeDescription
spenderaddress
allowanceuint256
neededuint256

ERC20InvalidApprover

The approver is the zero address.

error ERC20InvalidApprover(address approver);

Parameters

NameTypeDescription
approveraddress

ERC20InvalidSpender

The spender is the zero address.

error ERC20InvalidSpender(address spender);

Parameters

NameTypeDescription
spenderaddress