Erc20 class

Interface of the ERC20 standard as defined in the EIP.

Inheritance

Constructors

Erc20({required XCBAddress address, required Web3Client client, required int networkId})

Properties

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

Methods

allowance(XCBAddress owner, XCBAddress 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(XCBAddress 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(XCBAddress 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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(ContractFunction function, List params, BlockNum? atBlock) Future<List>
inherited
toString() String
A string representation of this object.
inherited
totalSupply({BlockNum? atBlock}) Future<BigInt>
Returns the amount of tokens in existence.
transfer(XCBAddress 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(XCBAddress sender, XCBAddress 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