Skip to content

Development Environment: Foundry vs Hardhat/Truffle #55

Discussion options

You must be logged in to vote

Forge doesn't run tests in Anvil, Hardhat does run tests in a local node. While it's not a full node, it's still slower than what Forge does. In Hardhat tests, calling a function of a contract means: sending a transaction to the local node; mining a block in the local node; processing the block and the transaction receipt. Also, since Hardhat is written in JS, its node uses a slow EVM implementation, which is also written in JS.

Forge doesn't start a node when running tests. Instead, it executes tests in the same process, in an EVM implemented in Rust. So when you call a contract function in a Forge test, it doesn't send a transaction and doesn't mine a block. All tests are executed close…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@samlaf
Comment options

Answer selected by samlaf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants