class IERC20
Represents a standard interface for fungible tokens, implementing the ERC20 standard.
This abstract class defines a set of functions that tokens must implement to be compatible with the ERC20 standard. It provides basic functionality for tracking token balances, transfers, and approvals.
Methods
allowance(owner, spender)
Name | Type | Description |
---|---|---|
|
|
The address of the token owner. |
|
|
The address of the spender. |
Returns |
|
The amount of tokens approved for the spender to spend on behalf of the owner, as a UInt64. |
abstract allowance(owner: PublicKey, spender: PublicKey): UInt64;
approveSpend(spender, value)
mutations which need
Name | Type | Description |
---|---|---|
|
|
The address to approve as a spender. |
|
|
The amount of tokens to approve. |
Returns |
|
True if the approval was successful, false otherwise. Approval |
abstract approveSpend(spender: PublicKey, value: UInt64): Promise<void>;
balanceOf(owner)
Name | Type | Description |
---|---|---|
|
|
The address of the token owner. |
Returns |
|
The balance of the owner, as a UInt64. |
abstract balanceOf(owner: PublicKey | AccountUpdate): Promise<UInt64>;
burn(receiverAddress, amount)
Burning (destroying) tokens, reducing the total supply. (require signature)
Name | Type | Description |
---|---|---|
|
|
The address of the token holder whose tokens will be burned |
|
|
The amount of tokens to burn |
Returns |
|
abstract burn(receiverAddress: PublicKey, amount: UInt64): Promise<void>;
mint(receiverAddress, amount)
Mints new tokens and assigns them to a receiver. (require signature)
Name | Type | Description |
---|---|---|
|
|
The address of the receiver who will receive the newly minted tokens |
|
|
The amount of tokens to mint |
Returns |
|
abstract mint(receiverAddress: PublicKey, amount: UInt64): Promise<void>;
transferFrom(from, to, value)
mutations which need
Name | Type | Description |
---|---|---|
|
|
The address to transfer tokens from. |
|
|
The address to transfer tokens to. |
|
|
The amount of tokens to transfer. |
Returns |
|
True if the transfer was successful, false otherwise. Transfer |
abstract transferFrom(from: PublicKey, to: PublicKey, value: UInt64): Promise<void>;