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-rsfor provider, signer, and contract bindings - Works with any Ethereum-compatible chain (Mainnet, Goerli, Polygon, etc.)
- Includes usage examples and
.envconfiguration
- Clone this repo and enter the directory:
git clone https://github.com/bitcodr/eth-rust-sdk.git
cd eth-rust-sdk- Copy the
.env.exampleto.envand 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 buildEach 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_balancenft: 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 testMIT © bitcodr