Appearance
Solidity API
ERC20Base
This contract implements the core functionality of the ERC20 standard It inherits from IERC20Base for interface compliance and ERC20BaseInternal for internal functions
totalSupply
solidity
function totalSupply() external view returns (uint256)Returns the total number of tokens in existence
Returns the total amount of tokens in existence
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The total supply of tokens |
balanceOf
solidity
function balanceOf(address account) external view returns (uint256)Returns the token balance of a given account
Returns the amount of tokens owned by a specific account
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | The address to query the balance of |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The number of tokens owned by the specified address |
allowance
solidity
function allowance(address holder, address spender) external view returns (uint256)Returns the remaining number of tokens that spender is allowed to spend on behalf of holder
Returns the remaining number of tokens that spender will be allowed to spend on behalf of holder through {transferFrom}
Parameters
| Name | Type | Description |
|---|---|---|
| holder | address | The address which owns the tokens |
| spender | address | The address which will spend the tokens |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | uint256 | The number of tokens still available for the spender |
approve
solidity
function approve(address spender, uint256 amount) external virtual returns (bool)Sets the amount of tokens that spender is allowed to spend on behalf of the caller
Sets amount as the allowance of spender over the caller's tokens
Parameters
| Name | Type | Description |
|---|---|---|
| spender | address | The address which will spend the tokens |
| amount | uint256 | The number of tokens to be spent |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | A boolean value indicating whether the operation succeeded |
transfer
solidity
function transfer(address recipient, uint256 amount) external returns (bool)Moves tokens from caller's account to the recipient
Moves amount tokens from the caller's account to recipient
Parameters
| Name | Type | Description |
|---|---|---|
| recipient | address | The address to receive the tokens |
| amount | uint256 | The number of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | A boolean value indicating whether the operation succeeded |
transferFrom
solidity
function transferFrom(address holder, address recipient, uint256 amount) external returns (bool)Moves tokens from holder's account to recipient using the allowance mechanism
Moves amount tokens from holder to recipient using the allowance mechanism Amount is then deducted from the caller's allowance
Parameters
| Name | Type | Description |
|---|---|---|
| holder | address | The address which owns the tokens |
| recipient | address | The address to receive the tokens |
| amount | uint256 | The number of tokens to transfer |
Return Values
| Name | Type | Description |
|---|---|---|
| [0] | bool | A boolean value indicating whether the operation succeeded |