Contract class

A Contract is an abstraction of code that has been deployed to the blockchain.

A Contract may be sent transactions, which will trigger its code to be run with the input of the transaction data.

Available Extensions
Annotations
  • @JS("Contract")

Constructors

Contract(String address, dynamic abi, dynamic providerOrSigner)
Contruct Contract object for invoking smart contract method.

Properties

address String
This is the address (or ENS name) the contract was constructed with.
no setter
hashCode int
The hash code for this object.
no setterinherited
interface Interface
This is the ABI as an Interface.
no setter
provider Provider
If a Provider was provided to the constructor, this is that provider. If a Signer was provided that had a Provider, this is that provider.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signer Signer?
If a Signer was provided to the constructor, this is that signer.
no setter

Methods

connect(dynamic providerOrSigner) Contract
Returns a new instance of the Contract, but connected to Provider or Signer.
listenerCount([String? eventName]) int
Returns the number of listeners for the eventName events. If no eventName is provided, the total number of listeners is returned.
listeners(String eventName) List
Returns the list of Listeners for the eventName events.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeAllListeners([String? eventName]) → dynamic
Remove all the listeners for the eventName events. If no eventName is provided, all events are removed.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited