Erc20 class

Interface of the ERC20 standard as defined in the EIP.

Inheritance

Constructors

Erc20({required EthereumAddress address, required Web3Client client, int? chainId})

Properties

chainId int?
finalinherited
client Web3Client
finalinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
self DeployedContract
finalinherited

Methods

allowance(EthereumAddress owner, EthereumAddress spender, {BlockNum? atBlock}) Future<BigInt>
Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transferFrom. This is zero by default. This value changes when approve or transferFrom are called.
approvalEvents({BlockNum? fromBlock, BlockNum? toBlock}) Stream<Approval>
Returns a live stream of all Approval events emitted by this contract.
approve(EthereumAddress spender, BigInt amount, {required Credentials credentials, Transaction? transaction}) Future<String>
Sets amount as the allowance of spender over the caller's tokens. Returns a boolean value indicating whether the operation succeeded. IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 Emits an Approval event.
balanceOf(EthereumAddress account, {BlockNum? atBlock}) Future<BigInt>
Returns the amount of tokens owned by account.
checkSignature(ContractFunction function, String expected) bool
Returns whether the function has the expected selector.
inherited
decimals({BlockNum? atBlock}) Future<BigInt>
Returns the decimal precision of the token.
name({BlockNum? atBlock}) Future<String>
Returns the name of the token.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(ContractFunction function, List params, BlockNum? atBlock) Future<List>
inherited
symbol({BlockNum? atBlock}) Future<String>
Returns the symbol of the token.
toString() String
A string representation of this object.
inherited
totalSupply({BlockNum? atBlock}) Future<BigInt>
Returns the amount of tokens in existence.
transfer(EthereumAddress recipient, BigInt amount, {required Credentials credentials, Transaction? transaction}) Future<String>
Moves amount tokens from the caller's account to recipient. Returns a boolean value indicating whether the operation succeeded. Emits a Transfer event.
transferEvents({BlockNum? fromBlock, BlockNum? toBlock}) Stream<Transfer>
Returns a live stream of all Transfer events emitted by this contract.
transferFrom(EthereumAddress sender, EthereumAddress recipient, BigInt amount, {required Credentials credentials, Transaction? transaction}) Future<String>
Moves amount tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a Transfer event.
write(Credentials credentials, Transaction? base, ContractFunction function, List parameters) Future<String>
inherited

Operators

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