Pin a Fork Block in Hardhat to Make Mainnet Tests Reproducible
Fork mainnet at a fixed block and cache state locally to get deterministic integration tests against real deployed contracts without spending gas.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Fork mainnet at a fixed block and cache state locally to get deterministic integration tests against real deployed contracts without spending gas.
The web3.eth.Contract class turns raw JSON-RPC encoding into typed method calls — but only if you understand the call() vs send() split, gas estimation limits, and 1.x vs 4.x differences.
Learn how to listen to smart contract events in real time using Web3.js eth.subscribe, handle reconnections, and weigh the trade‑offs of persistent WebSocket connections.
Choosing between polling and WebSockets in Web3.js involves a trade-off between latency and reliability. Learn why a hybrid approach is the industry standard for production-grade event handling.
An architecture note on consuming Ethereum contract events with web3.js 4.x: why checkpointed getLogs polling beats naive subscriptions, how reorgs and the RPC trust boundary shape the design, and when to move to an indexer.
Learn how to use Web3.js event subscriptions with indexed filters to listen only to the blockchain events you need, reducing node load and enabling real‑time updates.
Learn how to use web3.js to send a contract transaction with automatic gas estimation, including code, pitfalls, and verification steps.
A practical web3.js guide to choosing between .call(), .send(), and getPastEvents — with version caveats, gas estimation, bounded log queries, and polling vs WebSocket trade-offs.
Understanding web3.eth.Contract: when to use .call() vs .send(), how to handle event logs with chunked queries, and the breaking changes from web3.js 1.x to 4.x.