erc20 1.0.0 icon indicating copy to clipboard operation
erc20: ^1.0.0 copied to clipboard

Interface of the ERC20 standard as defined in the EIP-20 Token Standard.

Interface of the ERC20 standard as defined in the EIP-20 Token Standard.

pub package

Features #

  • allowance function.
  • approve function.
  • balanceOf function.
  • decimals function.
  • name function.
  • symbol function.
  • totalSupply function.
  • transfer function.
  • transferFrom function.
  • approvalEvents event.
  • transferEvents event.

Getting started #

In your pubspec.yaml file add:

dependencies:
  erc20: any

Usage #

import 'package:erc20/erc20.dart';
final client = Web3Client('https://mainnet.infura.io/v3/<YOUR_INFURA_PROJECTID>', Client());
final shibaInu = ERC20(
    address: EthereumAddress.fromHex(
        '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce'),
    client: client,
);

final symbol = await shibaInu.symbol();
final name = await shibaInu.name();
final decimals = await shibaInu.decimals();

print(symbol); //SHIB
print(name); // SHIBA INU
print(decimals) // 18;
4
likes
120
pub points
71%
popularity

Publisher

unverified uploader

Interface of the ERC20 standard as defined in the EIP-20 Token Standard.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

web3dart

More

Packages that depend on erc20