Key frameworks, libraries, and practices for frontend development, wallet integration, smart contracts, testing and more.
Library | Purpose | Key Features |
---|---|---|
Ethers.js | Contract interaction, transaction signing, provider management in JS/TS environments | Provides Contract , Provider , Wallet , and Interface abstractions. Deep Hardhat integration. ABI coder, calldata utilities, and ENS support. |
Viem | Modular TypeScript-first library for RPC, contract access, encoding, and data formatting | Tree-shakeable. Supports batching, client-side caching, EIP-1559 fees, multicalls, typed reads/writes. Used by Wagmi. |
Wagmi | React hooks for wallet connection, chain state, and contract calls in frontend apps | Built on Viem. Includes useAccount , useConnect , useContractRead , and event subscriptions. Enables seamless integration with wallet modals. |
Web3.js | Legacy Ethereum contract and RPC library | One of the earliest libraries. Now largely unmaintained. Lacks EIP-1559 support and modern modularity. |
RainbowKit | React component library for wallet connection UI and chain management | Pre-built wallet connect buttons, chain switch UI, and custom themes. Integrates with Wagmi for wallet state management and tx handling. |
Ethers and Viem serve similar purposes, but Viem is optimized for frontend apps. Wagmi builds on Viem. Web3.js is no longer recommended for new projects.
Note Smart contract quality and security depend on a comprehensive testing strategy including but not limited to:The tools and frameworks below provide a foundation for each of these testing layers.
- Unit Tests: Verify individual functions and components
- Property-Based Fuzzing: Test invariants with random inputs
- Code Coverage: Ensure all code paths are tested
- Static Analysis: Detect common vulnerabilities and anti-patterns
forge test
) and rich cheatcodes for state manipulation.forge test --fuzz-runs=N
).forge script
, forge coverage
, and forge snapshot
.hardhat.config.js
), plugin support, and network forking.Tool | Notes |
---|---|
Foundry | Built-in fuzzing; enabled by default when running forge test . |
Echidna | External, property-based fuzzer. Supports invariants and campaigns. |
Tool | Purpose | Typical Command |
---|---|---|
OpenZeppelin Test Helpers | Time travel, event assertions, reverts | JS/TS only. Works with Hardhat + Mocha. |
solidity-coverage | Reports untested branches in Solidity | npx hardhat coverage · forge coverage |
Slither | Static analysis for known vuln patterns | slither . |