#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

#6 in #erc20

Download history 113/week @ 2024-10-25 12/week @ 2024-11-01 5/week @ 2024-11-08 7/week @ 2024-11-15 6/week @ 2024-11-22 8/week @ 2024-12-06 41/week @ 2025-01-03 56/week @ 2025-01-10 98/week @ 2025-01-17 2/week @ 2025-01-24 11/week @ 2025-01-31 52/week @ 2025-02-07

163 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

~49MB
~758K SLoC