blocksmith.js is a minimal Javascript testing framework for Ethereum contract development using foundry-rs and ethers. Foundry is great speed-wise but writing tests in Solidity is a disaster and the command-line interface is bad for complex operations. Hardhat is slow, has way too much boilerplate, interacts poorly with modern ESM. Both projects are very "do it our way". The result is that many contracts don't have tests, and the tests that exist aren't end-to-end.
OTOH, blocksmith.js is simple. It gives you a lightweight wrapper around forge
and anvil
, so you can script Foundry however you want. You can use any async JS testing framework, including the default nodejs test runner, or just write simple JS scripts that glue anything you want together.
To properly test an ENS contract with CCIP-Read, you need to deploy a lot of infrastructure: a registry, a resolver, some names, a CCIP-server, and then test all of the interactions. blocksmith.js makes this trivial.
At the moment, you can npm i @adraffy/blocksmith
. I'd like to write tests for more contracts to illustrate how to use blocksmith. This is also an useful learning experience as I get to figure out what features I'm missing or what needs improved. This should expand the feature set and improve ergonomics.
I'd like to explore making end-to-end tests for cross-chain communication so developers can locally simulate things like EVM gateway and other ideas. Running parallel testnets is blocksmith.js is effortless and I see a lot of value in cross-chain tests that can be described in a single JS file.
blocksmith.js History
-
accepted into GG22 OSS - Developer Tooling and Libraries 2 weeks ago.
-
accepted into ENS Ecosystem 3 weeks ago.
-
accepted into ENS Identity 6 months ago.