ERC20Contract inherits Contract
See the above code example for creating an Instance which will (in addition to the Contact methods and properties) automatically add the additional properties defined in abi to a Contract connected to address using the providerOrSigner.
Properties(inheritted from Contract)
This is the address (or ENS name) the contract was constructed with.
This is a promise that will resolve to the address the Contract object is attached to. If an Address was provided to the constructor, it will be equal to this; if an ENS name was provided, this will be the resolved address.
If the Contract object is the result of a ContractFactory deployment, this is the transaction which was used to deploy the contract.
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.
If a signer was provided to the constructor, this is that signer.
Methods(inheritted from Contract)
Returns a new instance of the Contract attached to a new address. This is useful if there are multiple similar or identical copies of a Contract on the network and you wish to interact with each of them.
Events(inheritted from Contract)
Return Events that match the event.
Return the number of listeners that are subscribed to event. If no event is provided, returns the total count of all events.
Return a list of listeners that are subscribed to event.
Unsubscribe listener to event.
Subscribe to event calling listener when the event occurs.
Subscribe once to event calling listener when the event occurs.
Unsubscribe all listeners for event. If no event is provided, all events are unsubscribed.
Since the Contract is a Meta-Class, the methods available here depend on the ABI which was passed into the Contract.
Returns the number of decimal places used by this ERC-20 token. This can be used with parseUnits when taking input from the user or [formatUnits](utils-formatunits] when displaying the token amounts in the UI.
Returns the balance of owner for this ERC-20 token.
Returns the symbol of the token.
Transfers amount tokens to target from the current signer. The return value (a boolean) is inaccessible during a write operation using a transaction. Other techniques (such as events) are required if this value is required. On-chain contracts calling the transfer
function have access to this result, which is why it is possible.
Performs a dry-run of transferring amount tokens to target from the current signer, without actually signing or sending a transaction.
This can be used to preflight check that a transaction will be successful.
Returns an estimate for how many units of gas would be required to transfer amount tokens to target.
Returns an UnsignedTransaction which could be signed and submitted to the network to transaction amount tokens to target.
When you perform a static call, the current state is taken into account as best as Ethereum can determine. There are many cases where this can provide false positives and false negatives. The eventually consistent model of the blockchain also means there are certain consistency modes that cannot be known until an actual transaction is attempted.
Since the Contract is a Meta-Class, the methods available here depend on the ABI which was passed into the Contract.
Returns a new Filter which can be used to query or to subscribe/unsubscribe to events.
If fromAddress is null or not provided, then any from address matches. If toAddress is null or not provided, then any to address matches.