class IBasicTokenContract

Defines the basic interface for a token contract.

All token contracts should inherit from this class and implement its methods.

This class is designed to provide a standardized way of interacting with token contracts, ensuring consistency and interoperability across different implementations.

Methods

burn(receiverAddress, amount)

Burning (destroying) tokens, reducing the total supply. (require signature)

Parameters
Name Type Description

receiverAddress

PublicKey

The address of the token holder whose tokens will be burned

amount

UInt64

The amount of tokens to burn

Returns

Promise<void>

Signature
abstract burn(receiverAddress: PublicKey, amount: UInt64): Promise<void>;

burnWithSignature(receiverAddress, amount, adminSignature)

Burning (destroying) tokens with signature, reducing the total supply.

Parameters
Name Type Description

receiverAddress

PublicKey

The address of the token holder whose tokens will be burned

amount

UInt64

The amount of tokens to burn

adminSignature

Signature

A signature from an authorized administrator, required to approve the burning

Returns

Promise<void>

Signature
abstract burnWithSignature(receiverAddress: PublicKey, amount: UInt64, adminSignature: Signature): Promise<void>;

deploy()

Deploys the token contract to the blockchain.

This method should handle all necessary steps for deploying the contract, such as configuring ownership.

Signature
abstract deploy(): Promise<void>;

init()

Initializes the token contract after deployment.

This method is used to perform any additional setup tasks after the contract is deployed, such as setting initial token balances or defining access control rules.

Signature
abstract init(): void;

mint(receiverAddress, amount)

Mints new tokens and assigns them to a receiver. (require signature)

Parameters
Name Type Description

receiverAddress

PublicKey

The address of the receiver who will receive the newly minted tokens

amount

UInt64

The amount of tokens to mint

Returns

Promise<void>

Signature
abstract mint(receiverAddress: PublicKey, amount: UInt64): Promise<void>;

mintWithSignature(receiverAddress, amount, adminSignature)

Mints new tokens with signature and assigns them to a receiver.

Parameters
Name Type Description

receiverAddress

PublicKey

The address of the receiver who will receive the newly minted tokens

amount

UInt64

The amount of tokens to mint

adminSignature

Signature

A signature from an authorized administrator, required to approve the minting

Returns

Promise<void>

Signature
abstract mintWithSignature(receiverAddress: PublicKey, amount: UInt64, adminSignature: Signature): Promise<void>;

sendTokens(senderAddress, receiverAddress, amount)

Sends tokens from one address to another.

Parameters
Name Type Description

senderAddress

PublicKey

The address of the sender who is transferring the tokens

receiverAddress

PublicKey

The address of the receiver who will receive the tokens

amount

UInt64

The amount of tokens to transfer

Returns

Promise<void>

Signature
abstract sendTokens(senderAddress: PublicKey, receiverAddress: PublicKey, amount: UInt64): Promise<void>;
© OpenNautilus 2024-