A modular, async-ready Rust SDK for interacting with Ethereum smart contracts using ethers-rs.
Includes support for:
- ERC-721 (NFTs)
- DAOs
- Staking contracts
- ERC-20 tokens
- Vault contracts
- Modular design: each contract type is a separate module
- Uses
ethers-rs
for provider, signer, and contract bindings - Works with any Ethereum-compatible chain (Mainnet, Goerli, Polygon, etc.)
- Includes usage examples and
.env
configuration
- Clone this repo and enter the directory:
git clone https://github.com/bitcodr/eth-rust-sdk.git
cd eth-rust-sdk
- Copy the
.env.example
to.env
and add your Infura/Alchemy RPC + private key:
RPC_URL=https://mainnet.infura.io/v3/your_project_id
PRIVATE_KEY=your_private_key_here
- Build the project:
cargo build
Each module includes a sample usage file inside /examples
.
Run them like this:
cargo run --example fetch_nft_metadata
cargo run --example dao_info
cargo run --example staking_balance
nft
: Query token URI, owner, and transferdao
: Read proposals and votestaking
: Stake/unstake and read earningserc20
: Token transfers, approvals, balancesvault
: Deposit, withdraw, and check balances
- Format code:
cargo fmt
- Run unit tests:
cargo test
MIT © bitcodr