Blockchain security isn't optional.

Protect your smart contracts and DeFi protocols with Three Sigma, a trusted security partner in blockchain audits, smart contract vulnerability assessments, and Web3 security.

Get a Quote Today

Why Solidity Developers Are Switching to Foundry

Foundry is a Rust-based smart contract toolkit (forge, cast, anvil, chisel) that runs tests and scripts natively in Solidity. By writing tests in Solidity, developers avoid JavaScript’s async/await boilerplate and stay in a single language, making tests concise.

For example, in Hardhat you write tests in JavaScript/TypeScript, whereas Foundry lets you write:

image

Why Solidity Developers Are Switching to Foundry

Foundry is a Rust-based smart contract toolkit (forge, cast, anvil, chisel) that runs tests and scripts natively in Solidity. By writing tests in Solidity, developers avoid JavaScript’s async/await boilerplate and stay in a single language, making tests concise.

For example, in Hardhat you write tests in JavaScript/TypeScript, whereas Foundry lets you write:

[Image]

This native Solidity approach also unlocks built-in features: Foundry runs fast, typically 2–5× faster than alternatives in compile/test times. Indeed, Paradigm’s benchmarks show Foundry compiles libraries up to ~5× faster than Hardhat.

Foundry’s CLI tools are similarly lean: forge (build/test framework), cast (multi-tool EVM CLI), anvil (local EVM node), and chisel (Solidity REPL). In contrast, Hardhat is a Node.js framework with a huge plugin ecosystem, but requires JS knowledge. As one observer notes, Hardhat is “what you’d expect” for JS devs, whereas Foundry “runs better on Unix” and favors auditors or Solidity purists.

While Hardhat’s homepage emphasizes a flexible, JavaScript-centric workflow, Foundry instead highlights speed and native Solidity testing. Hardhat scripts and tests live in JavaScript (with lots of ecosystem tools), whereas Foundry tests are Solidity contracts executed via the forge command. In practice this means faster iteration (no NodeJS startup or transpile) and less external boilerplate.

Foundry’s site uses a forging motif to signal its Rusty, high-performance heritage. Under the hood, Foundry’s cheatcodes (accessed via the special vm object) let you directly manipulate the EVM state in tests. For example, you can instantly advance block.number or impersonate an address, without writing complex scripts. Foundry also manages dependencies simply via forge install and direct GitHub imports. Overall, advanced developers gain from Foundry’s “solidity-in, solidity-out” testing, blazing performance, and powerful built-in features like fuzzing, invariant tests, and low-level cheatcodes to control time, accounts, and more.

This native Solidity approach also unlocks built-in features: Foundry runs fast, typically 2–5× faster than alternatives in compile/test times. Indeed, Paradigm’s benchmarks show Foundry compiles libraries up to ~5× faster than Hardhat.

Foundry’s CLI tools are similarly lean: forge (build/test framework), cast (multi-tool EVM CLI), anvil (local EVM node), and chisel (Solidity REPL). In contrast, Hardhat is a Node.js framework with a huge plugin ecosystem, but requires JS knowledge. As one observer notes, Hardhat is “what you’d expect” for JS devs, whereas Foundry “runs better on Unix” and favors auditors or Solidity purists.

While Hardhat’s homepage emphasizes a flexible, JavaScript-centric workflow, Foundry instead highlights speed and native Solidity testing. Hardhat scripts and tests live in JavaScript (with lots of ecosystem tools), whereas Foundry tests are Solidity contracts executed via the forge command. In practice this means faster iteration (no NodeJS startup or transpile) and less external boilerplate.

Foundry’s site uses a forging motif to signal its Rusty, high-performance heritage. Under the hood, Foundry’s cheatcodes (accessed via the special vm object) let you directly manipulate the EVM state in tests. For example, you can instantly advance block.number or impersonate an address, without writing complex scripts. Foundry also manages dependencies simply via forge install and direct GitHub imports. Overall, advanced developers gain from Foundry’s “solidity-in, solidity-out” testing, blazing performance, and powerful built-in features like fuzzing, invariant tests, and low-level cheatcodes to control time, accounts, and more.

Conclusion

Foundry isn’t just faster. It rethinks how Solidity developers test, script, and simulate smart contracts. For teams that want raw speed, native tooling, and full control over the EVM, it’s becoming the go-to stack. Whether you’re building production contracts or auditing them, staying entirely in Solidity with powerful cheatcodes and no external JS boilerplate is a game-changer.

Simeon Cholakov
Simeon Cholakov

Security Researcher