Expand description
§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’sProvider
, allowing to retrieve token decimals, and compute balances asBigDecimal
fromU256
. - A
TokenStore
trait, and aBasicTokenStore
impl, allowing to cacheToken
s in memory. - A
LazyToken
struct, acting as a wrapper around Alloy contract instance, lazily retrievingname
,symbol
,decimals
andtotalSupply
from the blockchain.
Modules§
Structs§
- Basic
Token Store - A basic
TokenStore
implementation. - Error
- Token related error.
- Lazy
Token - A token with an embedded contract instance that lazily query the blockchain.
- LruToken
Store lru-store
- A basic
TokenStore
implementation. - Store
Iter - A store iterator.
- Token
- A token.
Enums§
- Entry
- A view into a single entry in a map, which may either be vacant or occupied.
- TokenId
- A token identifier.
Traits§
- Erc20
Provider Ext - Extends Alloy
Provider
trait with ERC-20 related features. - Token
Store - A
Token
store