Skip to content

SkucodeContract

SkucodeContract extends ethers.Contract and provides an interface for interacting with smart contract. It includes method for preparing transaction data. It utilieses the following interface internally: SctDetails

Creating Instances

new SkucodeContract( target: string, contractRunner: Signer | Provider )

Creates a new instance of SkucodeContract connected to the specified contract address, using the provided signer or provider for interactions.

To query or retrieve blockchain details, use the Provider, while for executing transactions, use the Signer.

Properties

  • skucodeContract.targetstring

    The target to connect to. This can be an address, ENS name or any Addressable, such as another contract.

  • skucodeContract.contractRunnerSigner | Provider

    The Signer or Provider used for interacting with the contract.

Methods

skucodeContract.prepareTxData ( methodName: string, args: any[], signerAddress: string, memo?: string ) ⇒ Promise< TransactionRequest >

Prepares transaction data for a specific method in the contract.



skucodeContract.getNamestring

Get the token's name



skucodeContract.getSymbolstring

Get the token's symbol.



skucodeContract.getOwnerstring

Retrieves the owner's address of the token contract.



skucodeContract.getDecimalsnumber

Retrieves the number of decimals used by the token.



skucodeContract.getTotalSupplystring

Retrieves the total supply of the token.



skucodeContract.getBalance ( address: string ) ⇒ string

Retrieves the balance of a specific address.



skucodeContract.getBalancesArray<{ accountAddress: string, balance: string }>

Retrieves the balances of all addresses involved in Transfer events.



.

skucodeContract.getAttachmentsArray<{ cid: string, submitter: string }>

Retrieves and parses all AttachmentAdded events from the contract.



skucodeContract.getDetailsPromise< SctDetails >

Retrieves all relevant details of the Skucode token including its name, symbol, owner, decimals, total supply, balances, and attachments.