Skip to main content

Class: ContractBase

contract.ContractBase

Abstract implementation of a contract extended by the Contract class and generated contract types.

Hierarchy

Constructors

constructor

new ContractBase(instance, artifact, wallet): ContractBase

Parameters

NameTypeDescription
instanceContractInstanceWithAddressThe deployed contract instance definition.
artifactContractArtifactThe Application Binary Interface for the contract.
walletWalletThe wallet used for interacting with this contract.

Returns

ContractBase

Properties

artifact

Readonly artifact: ContractArtifact

The Application Binary Interface for the contract.


instance

Readonly instance: ContractInstanceWithAddress

The deployed contract instance definition.


methods

methods: Object = {}

An object containing contract methods mapped to their respective names.

Index signature

▪ [name: string]: ContractMethod


wallet

wallet: Wallet

The wallet used for interacting with this contract.

Accessors

address

get address(): AztecAddress

Address of the contract.

Returns

AztecAddress


partialAddress

get partialAddress(): Fr

Partial address of the contract.

Returns

Fr

Methods

withWallet

withWallet(wallet): this

Creates a new instance of the contract wrapper attached to a different wallet.

Parameters

NameTypeDescription
walletWalletWallet to use for sending txs.

Returns

this

A new contract instance.