ERC20Facet
Inherits: IERC20, ERC20Base, Facet
Functions
ERC20_init
name
Returns the name of the token.
symbol
Returns the symbol of the token.
decimals
Returns the decimals places of the token.
transfer
Moves an amount of tokens from the caller's account to another account.
Parameters
Name | Type | Description |
---|---|---|
|
| The account where the tokens are transferred to. |
|
| The number of tokens transferred. |
Returns
Name | Type | Description |
---|---|---|
|
| Boolean value indicating whether the operation succeeded. |
approve
Sets an amount as the allowance of spender over the caller's tokens.
Parameters
Name | Type | Description |
---|---|---|
|
| The account that is allowed to transfer the tokens. |
|
| The number of tokens that are approved. |
Returns
Name | Type | Description |
---|---|---|
|
| bool value indicating whether the operation succeeded. |
transferFrom
Transferrs an amount of tokens from an account to other using the allowance mechanism.
Amount is deducted from the caller's allowance.
Parameters
Name | Type | Description |
---|---|---|
|
| The account where the tokens are transferred from. |
|
| The account where the tokens are transferred to. |
|
| The number of tokens transferred. |
Returns
Name | Type | Description |
---|---|---|
|
| bool value indicating whether the operation succeeded. |
allowance
Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner.
This value changes when {approve} or {transferFrom} are called and is zero by default.
Parameters
Name | Type | Description |
---|---|---|
|
| The account that owns the tokens. |
|
| The account that is allowed to transfer the tokens. |
totalSupply
Returns the amount of tokens in existence.
balanceOf
Returns the amount of tokens owned by an account.
Parameters
Name | Type | Description |
---|---|---|
|
| The account to get the balance of. |