IERC20
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
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
balanceOf
Returns the token balance of account.
function balanceOf(address account) external view returns (uint256);Parameters
| Name | Type | Description |
|---|---|---|
| account | address |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | uint256 |
transfer
Transfers value tokens from the caller to to.
function transfer(address to, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| to | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| owner | address | |
| spender | address |
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| spender | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
name
Returns the name of the token.
function name() external view returns (string memory);Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
symbol
Returns the symbol of the token.
function symbol() external view returns (string memory);Returns
| Name | Type | Description |
|---|---|---|
| <none> | string |
decimals
Returns the number of decimals.
function decimals() external view returns (uint8);Returns
| Name | Type | Description |
|---|---|---|
| <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
| Name | Type | Description |
|---|---|---|
| from | address | |
| to | address | |
| value | uint256 |
Approval
Emitted when the allowance of a spender for an owner is set.
event Approval(address indexed owner, address indexed spender, uint256 value);Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | |
| spender | address | |
| value | uint256 |
Errors
ERC20InsufficientBalance
The sender's balance is insufficient for the operation.
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);Parameters
| Name | Type | Description |
|---|---|---|
| sender | address | |
| balance | uint256 | |
| needed | uint256 |
ERC20InvalidSender
sender is the zero address.
error ERC20InvalidSender(address sender);Parameters
| Name | Type | Description |
|---|---|---|
| sender | address |
ERC20InvalidReceiver
receiver is the zero address.
error ERC20InvalidReceiver(address receiver);Parameters
| Name | Type | Description |
|---|---|---|
| receiver | address |
ERC20InsufficientAllowance
The spender does not have enough allowance.
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | |
| allowance | uint256 | |
| needed | uint256 |
ERC20InvalidApprover
The approver is the zero address.
error ERC20InvalidApprover(address approver);Parameters
| Name | Type | Description |
|---|---|---|
| approver | address |
ERC20InvalidSpender
The spender is the zero address.
error ERC20InvalidSpender(address spender);Parameters
| Name | Type | Description |
|---|---|---|
| spender | address |