#alloy #ethereum #erc20

alloy-erc20

Interact with ERC-20 contracts using Alloy

6 releases (3 breaking)

0.5.0 Oct 25, 2024
0.4.0 Oct 5, 2024
0.2.1 Sep 3, 2024
0.2.0 Jul 28, 2024
0.1.1 Jun 19, 2024

#4 in #erc20

21 downloads per month

MIT license

29KB
681 lines

alloy-erc20

ERC20 is a Rust libary relying on Alloy allowing to interact with ERC-20 contracts.

Installation

Add alloy-erc20 to your Cargo.toml.

alloy-erc20 = "0.5"

Features

  • A basic Token struct and associated extensions methods on Alloy's Provider, allowing to retrieve token decimals, and compute balances as BigDecimal from U256.
  • A TokenStore trait, and a BasicTokenStore impl, allowing to cache Tokens in memory.
  • A LazyToken struct, acting as a wrapper around Alloy contract instance, lazily retrieving name, symbol, decimals and totalSupply from the blockchain.

Dependencies

~40MB
~735K SLoC