Skip to content

Erc20Contract

Erc20Contract extends ethers.Contract and provides an interface for interacting with smart contract. It includes method for preparing transaction data.

Creating Instances

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

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

Properties

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

  • erc20Contract.contractRunner ⇒ Signer | Provider
    The Signer or Provider used for interacting with the contract.

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

Methods

erc20Contract.prepareTxData ( methodName: string, args: any[], signerAddress: string ) ⇒ Promise< TxData >

Prepares the transaction data for invoking a method on the contract by generating the required data.


Note: The Erc20Contract class also allows interaction with the deployed Erc20 Contract's functions. For more details, refer to the Erc20 Contract Artifact.