RepositoryJavaScriptCNTrung Quốc
nemo-crypto

nemo-crypto/Web3

Web3 中文实战教程,涵盖 Papertrade(PAPER 质押与 USDC 分润)、Hyperliquid、HyperEVM、Perp DEX、DeFi、代币经济学、智能合约、钱包、跨链和稳定币支付。Chinese Web3 guides with worked examples and exercises.

113sao
45fork
1issue
0lượt xem

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: web3

#1 Repository của tuần

1
TINIX TRENDING·Chủ đề: dapp

#1 Repository của tuần

1
TINIX TRENDING·Chủ đề: defi

#1 Repository của tuần

🆚 Web3.js vs Ethers.js: Bảng so sánh trọn gói từ khởi tạo tới hiệu năng

So sánh trực tiếp giữa Web3.js và Ethers.js qua ví dụ thực tế: khởi tạo, giao tiếp contract, công cụ hỗ trợ, và performance benchmark.

Đây là kho lưu trữ trọng lực so sánh hai thư viện Web3 phổ biến nhất trong cộng đồng phát triển blockchain: Web3.js (do Ethereum Foundation phát triển) và Ethers.js (thiết kế hiện đại, nhẹ gọn). Dự án minh họa rõ rệt sự khác biệt qua từng thao tác thực tế như kết nối ví, gọi hàm smart contract, chuyển đổi đơn vị, lắng nghe sự kiện...

✨ Điểm nổi bật

  • Khởi tạo provider: Web3.js dùng new Web3.providers.HttpProvider, Ethers.js dùng new ethers.providers.JsonRpcProvider
  • Kết nối MetaMask: Web3.js dùng window.ethereum, Ethers.js bọc bằng Web3Provider + getSigner()
  • Gọi hàm contract: Web3.js cần .methods.xxx().call(), Ethers.js gọi trực tiếp contract.xxx()
  • Chuyển đổi đơn vị: Web3.js dùng utils.toWei/fromWei, Ethers.js dùng parseEther/formatEther
  • Batch request: Web3.js hỗ trợ BatchRequest, Ethers.js dùng Promise.all(provider.getBalance(...))
  • Lắng nghe sự kiện: Web3.js dùng .on('data'), Ethers.js dùng callback trựtiếp trong .on('Transfer', ...)
  • Kích thước gói: Web3.js ~1.5MB, Ethers.js ~116.5KB — khác biệt khổng lồ
  • TypeScript: Ethers.js hỗ trợ nguyên sắc, Web3.js chỉ cơ bản

💡 Vì sao đáng chú ý

Ethers.js thiết kế API theo phong cách Promise/async-await, giúp code sạch và dễ bảo trì hơn Web3.js với phong cách callback hỗn hợp. Đặc biệt, kích thước nhỏ hơn 10 lần giúp tốc độ tải trang nhanh hơn đáng kể — ưu thế rõ rệt khi chạy trên web. Tuy nhiên, Web3.js vẫn mạnh tay trong xử lý batch request và linh hoạt trong lắng nghe sự kiện. Lựa chọn nên dựa trên nhu cầu: dự án nhỏ, cần tốc độ và TypeScript → chọn Ethers.js. Dự án lớn, cần xử lý hàng loạt phức tạp → Web3.js vẫn là lựa chọn ổn định.


#Web3 #Ethersjs #Web3js #Blockchain #SmartContract #TiniX

Dự án tương tự

Khám phá các dự án và mô hình AI khác có sự tương đồng.

Repository
ethereumbook/ethereumbook

Mastering Ethereum: 2nd Edition, by Andreas M. Antonopoulos, Gavin Wood, Carlo Parisi, Alessandro Mazza, Niccolò Pozzolini

21.6k
Oct 12, 2026
RepositoryPython
OffcierCia/DeFi-Developer-Road-Map

DeFi Developer roadmap is a curated Developer handbook which includes a list of the best tools for DApps development, resources and references!

10.9k
Nov 3, 2026
RepositoryJavaScript
pubkey/eth-crypto

Cryptographic javascript-functions for ethereum and tutorials to use them with web3js and solidity

923
Nov 28, 2026
RepositorySolidity
AmazingAng/WTF-Solidity

WTF Solidity 极简入门教程,供小白们使用。Now supports English! 官网: https://wtf.academy

14.1k
Nov 25, 2026
RepositoryTypeScript
NomicFoundation/hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.

8.5k
Nov 26, 2026
RepositoryHTML
ConsenSysDiligence/smart-contract-best-practices

A guide to smart contract security best practices

7.6k
Mar 28, 2025
RepositorySolidity
SunWeb3Sec/DeFiHackLabs

Reproduce DeFi hacked incidents using Foundry.

6.9k
Nov 29, 2026
RepositoryTypeScript
wevm/wagmi

Reactive primitives for Ethereum apps

6.8k
Nov 23, 2026
RepositoryMarkdown
ethereum/ethereum-org-website

Ethereum.org is a primary online resource for the Ethereum community.

6.0k
Nov 30, 2026