Why I Finally Ditched Hardhat (And You Should Too)

Smart Contract Development Workflow

Hardhat is still everywhere in Ethereum development. But if you've been doing any serious DeFi work, you know the fucking pain. Three months ago, our test suite hit 8 minutes. Eight fucking minutes on Hardhat 2.14.0 with 73 contracts and ethers v5.7.2. That's enough time to lose your train of thought, check Twitter, grab coffee, and completely forget what bug you were hunting.

This isn't just us being dramatic. Stack Overflow is full of developers bitching about Hardhat 2.12+ getting slower as projects get bigger. We're all suffering together.

The 5-Minute Test Problem That Nobody Mentions in Tutorials

The Hardhat tutorials conveniently skip this: Hardhat 2.x chokes on compilation caching after ~40 contracts. We started with 20 contracts on Hardhat 2.9.3, tests ran in 30 seconds. Hit 50 contracts on 2.14.0? 3 minutes. 100 contracts? Go ahead and grab that coffee because Node.js is having a breakdown.

The final straw: our GitHub Actions CI pipeline hit 15 minutes. Fifteen. Fucking. Minutes. You can't merge, can't deploy, can't fix the obvious syntax error because you're sitting there watching Node.js choke on your test suite.

I ran the same fucking tests on both - Foundry was like 3.5x faster. Not even close. That's not a rounding error - that's productivity murder.

Development Framework Performance

Foundry cut our tests from 8 minutes to 45 seconds. Same contracts, same logic, just not running through Node.js hell.

npm Install Roulette

Every Monday morning: npm install roulette. Will ethers.js play nice with the latest Hardhat? Did OpenZeppelin break something in their weekend update? Is TypeScript going to compile or are we spending an hour debugging phantom type errors again?

Last month, our junior dev ran npm install and boom - deployment scripts dead. @nomiclabs/hardhat-ethers 2.2.3 broke gas estimation when they "fixed" the BigNumber handling. Production deployment shit the bed at 2 AM with Error: cannot estimate gas; transaction may fail even though our tests passed locally. Spent 4 hours figuring out our deployment script wasn't the problem. I learned that shit the hard way at 3am on a Sunday.

JavaScript dependency hell is real. NPM vulnerability alerts popping up every week when you're managing contracts worth millions? Yeah, that keeps you up at night. You shouldn't have to wonder if your dev tools will work tomorrow.

The Console.log Debugging Trap

Hardhat's console.log debugging is a fucking trap. Sure, it's convenient for quick debugging, but you end up with this garbage workflow where you're constantly adding and removing console statements instead of actually understanding what your contract is doing.

The real kick in the teeth? Console logs don't work in production. All that debugging you did locally means jack shit when your contract acts weird on mainnet because gas limits, block times, and MEV bots change everything.

EVM Tracing Example

Foundry's tracing shows you exactly what's happening at the EVM level. No console.log band-aids, just raw execution traces that match what actually happens on-chain. Opcodes, gas usage, state changes - the debugging data that actually matters.

When Hardhat Actually Makes Sense

Don't get me wrong - Hardhat isn't trash for everything. If you're building a simple dApp with React frontend and you already have JavaScript developers, stick with it. The ethers.js integration is genuinely good, and the Hardhat plugin ecosystem is extensive.

But if you're building DeFi protocols, working with complex math, or your tests take more than 2 minutes to run, you need to evaluate alternatives. Your productivity is worth more than the migration pain.

Hell, even Uniswap V3 ditched standard tooling, and Compound uses optimized testing frameworks for their critical financial protocols.

OK, Here's What Actually Matters

Brutal migration timeline: 2-3 weeks of "Why doesn't forge build work like npx hardhat compile?" then you never want to go back. I wasted 6 months on slow tests before switching. You probably are too.

The tools winning right now solve actual problems. Faster tests, better debugging, fewer dependency conflicts. That's not some philosophical bullshit about "developer experience" - that's getting home for dinner instead of babysitting CI runs.

Hardhat Alternatives by How Much Pain You'll Endure

Framework

Pain Level

How Long Till It's Worth It

Why You'd Switch

Why You Might Not

Best For

Foundry

🔥 High (learn Rust concepts)

3-4 weeks of hell

Tests run in 30 seconds vs 8 minutes

Team will revolt over Rust

Anyone tired of slow tests

Ape

🟡 Medium

2-3 weeks

Clean Python, no npm bullshit

Who the fuck uses this?

Python shops, data nerds

Brownie

💀 Dead

Don't bother

Nothing

  • maintainers quit

Dead since 2023

Just don't

Truffle

🟡 Medium

1-2 weeks

Familiar JS, won't break

Somehow slower than Hardhat

Why are you doing this to yourself?

Remix

🟢 Easy

30 minutes

N/A

Toy projects only

Learning Solidity basics

The Only 2 Alternatives That Actually Matter

Fuck the listicles with 10 "amazing" alternatives. There are really only 2 options that won't make you want to quit programming in 2025. Everything else is either dead (RIP Brownie), legacy garbage (Truffle), or browser toys (Remix).

Foundry: For When You're Serious About Performance

Foundry Logo

Foundry is what you switch to when Hardhat's performance finally drives you insane. Built in Rust, tests in Solidity, and it's fast as hell.

Foundry Framework

The Speed Difference is Real

Our DeFi protocol with 127 contracts went from 8 minutes of Hardhat 2.14.0 test hell to like 45 seconds on Foundry 0.2.0. Maybe it was 50 seconds? Either way, stupid fast. Same fucking tests, same logic, just no Node.js choking on ethers.js BigNumber conversions. That's not marketing bullshit - that's the difference between shipping features and staring at loading bars.

Solidity Tests Don't Lie

Writing tests directly in Solidity means what you test is what runs on-chain. No JavaScript translation layer hiding gas costs or behavior differences. When your test uses 50k gas, that's what it'll cost on mainnet.

The Foundry documentation emphasizes this principle: test contracts in the same language they're deployed in.

// This is what your contract actually does
function testRealGasUsage() public {
    uint256 gasBefore = gasleft();
    myContract.expensiveFunction();
    uint256 gasUsed = gasBefore - gasleft();
    assertLt(gasUsed, 100000); // Fails if > 100k gas
}

Fuzzing Finds Real Bugs

Foundry's built-in fuzzing has caught edge cases that would have cost us thousands in gas on failed transactions. It throws random inputs at your functions until something breaks. Found 3 critical bugs in our staking contract that manual tests missed.

Property-based testing with Foundry has become essential for DeFi protocols - Compound Protocol and Aave use similar approaches for critical financial logic.

The Learning Curve Sucks Ass

Learning Foundry means learning some Rust tooling concepts, and your JavaScript team will absolutely lose their shit. Budget 3-4 weeks of "Where's my fucking package.json?", Stack Overflow diving, and "why doesn't forge create work like npx hardhat run?" I spent like 2 weeks just figuring out how to import OpenZeppelin contracts properly. But once you survive that clusterfuck, you'll never want to go back to watching progress bars crawl.

The Foundry learning resources are extensive, and Patrick Collins' course provides 32 hours of hands-on training.

When to Choose Foundry: Your tests take more than 2 minutes and you're tired of waiting, you're building DeFi protocols where gas matters, or you want debugging that actually helps.

Ape: The Python Alternative That Doesn't Suck

Ape Framework

Ape is what Brownie should have been. Modern Python, good performance, and it's actually maintained by ApeWorX.

Python Development

Why Ape Over Dead Brownie

Brownie is officially dead - the maintainers threw in the towel in 2023. Ape is the spiritual successor built by people who got tired of Brownie's broken pytest integration and memory leaks on large projects.

Modern Python patterns, async/await support, and a plugin system that doesn't suck. If you're a Python shop, this is your best bet.

Data Science Integration That Works

Built for teams that need to analyze on-chain data alongside contract development. Jupyter notebook integration, pandas compatibility, and visualization tools that actually help you understand what your contracts are doing.

The Ape documentation shows how to use NumPy and matplotlib for contract analytics directly within your development workflow.

## Analyze your contract's behavior
import pandas as pd
df = contract.get_all_events('Transfer')
daily_volume = df.groupby('date')['amount'].sum()
daily_volume.plot()  # Actually useful charts

Multi-Chain Without Pain

Ape handles L2s, sidechains, and different EVM variants without making you rewrite configs for each network. Deploy to Polygon, Arbitrum, and Base with the same scripts.

The Ape multi-chain guide shows how to manage dozens of networks from a single configuration.

The Migration Timeline

Python background: Maybe 2 weeks to feel comfortable, 4 weeks to actually get shit done. Coming from JavaScript: add another week of "why doesn't this work like npm?" and learning Python's weird way of doing things.

When to Choose Ape: You're a Python team, need data analysis capabilities, or building multi-chain applications.

The Brutal Truth About Migration

Both options require upfront pain. Foundry needs Rust concepts, Ape needs Python knowledge. But the productivity gains are fucking real:

  • Tests run 10-50x faster (Foundry) or 2-3x faster (Ape) - no more coffee breaks during test runs
  • No more npm dependency hell breaking your Monday morning
  • Real debugging tools instead of console.log prayers
  • Gas estimates that actually match reality

Teams that keep procrastinating are the ones still watching 10-minute CI runs while their competitors ship features. Major DeFi protocols switched years ago because they got tired of the waiting.

Pick Your Poison

Go with Foundry if performance is killing your productivity and you can handle the Rust learning curve.

Go with Ape if you're Python-friendly and need data analysis alongside contract development.

Stick with Hardhat if your team is JavaScript-only, building simple dApps, and tests run under 2 minutes.

The migration pain is temporary. Slow tests are forever.

Frequently Asked Questions

Q

My tests take 5 minutes. Is it time to ditch Hardhat?

A

Fuck yes. Five minutes? Are you kidding me? I switched to Foundry and now tests run in like 30-45 seconds. I get so much actual work done instead of sitting there watching fucking progress bars.

Q

Will my JavaScript team revolt if I make them learn Rust?

A

Yeah, probably.

And honestly, that's fair

  • nobody wants to learn new shit when the old shit kinda works. If your whole team is JS and you're building simple d

Apps, maybe don't rock the boat. But if 2-3 people own the smart contract side, have them learn Foundry while the frontend folks stick with what they know.

Q

Do I have to migrate everything at once or can I do it gradually?

A

Start small. Run Foundry alongside Hardhat

  • they play nice together. Write new tests in Foundry, keep the old ones in Hardhat until you have time to port them. Most teams spend 2-3 months in this hybrid hellscape before fully switching. It works fine and you don't have to bet the whole project on the migration.
Q

What happens to all my Hardhat plugins?

A

They're gone, but be honest

  • you probably only used 3-4 plugins anyway. Gas reporting? Foundry's built-in gas reports are way better. Contract verification? Every framework can talk to Etherscan. Console.log debugging? You'll learn to use proper traces and wonder why you ever relied on console.log garbage.
Q

How do I rewrite 200 JavaScript tests in Solidity without losing my mind?

A

One contract at a time or you'll lose your fucking mind. I tried to do like 20 at once and wanted to quit programming. Use your old JS tests as reference

  • they're probably shit but at least they tell you what should happen. Took me like... I dunno, maybe a day per 10-15 test files? Don't rush it, you'll make mistakes.
Q

Will I break my deployment scripts and CI/CD?

A

Yup, you'll have to rewrite your deployment scripts. Foundry uses forge script, Ape uses Python scripts. Budget 2-3 days of "Error: failed to send transaction" and trying to remember how the old ones worked. But honestly, the new scripts are usually simpler and way more reliable than whatever JavaScript spaghetti deployment mess you had before.

Q

Is learning Foundry worth it if I only have 5 contracts?

A

Probably not. If your tests run under 2 minutes and your project is simple, don't torture yourself. Foundry's learning curve only makes sense if Hardhat's performance is actively pissing you off and wasting your time.

Q

What about TypeScript? I don't want to lose type safety.

A

Foundry tests are in Solidity (strongly typed). Ape uses Python with type hints. You'll have different type safety, not less. And let's be real

  • most TypeScript in Hardhat projects is just any types and ceremony anyway.
Q

How do I handle OpenZeppelin imports in Foundry?

A

forge install OpenZeppelin/openzeppelin-contracts. Done. Then import like normal Solidity. No npm bullshit, no version conflicts, no "Error: Cannot find module @openzeppelin/contracts" at 3am when you're trying to deploy a hotfix. Just git submodules that actually work.

Q

Will gas optimization get harder without Hardhat's tools?

A

Hell no, the opposite. Foundry's gas reporting shows exactly what each function costs, with detailed traces showing where every gas unit gets burned. Way better than Hardhat's shitty basic gas reporter plugin that barely tells you anything useful.

Q

Should I migrate if I'm building on L2s?

A

Yes, especially for L2s. Foundry handles multiple networks better than Hardhat's network switching. And faster tests matter more when you're testing on 5 different L2s with different gas costs.

Q

What if I migrate and hate it?

A

Keep your Hardhat config around for a month or two, just in case. But honestly, I don't know anyone who switched back. Once you get used to tests finishing in like 30 seconds, going back to watching 5-minute progress bars feels like actual torture.

Q

Can I use Foundry just for tests and keep Hardhat for everything else?

A

Absolutely. Lots of teams do this. Foundry for fast unit tests, Hardhat for deployment and integration tests. Use each tool where it's strongest instead of forcing yourself into one framework.

Reality Check: What Actually Works in 2025

Framework

Small Project (5 contracts)

Medium Project (20 contracts)

Large Project (50+ contracts)

Reality

Hardhat 3

30-60 seconds

2-4 minutes

5-15 minutes

Gets slower, memory leaks

Foundry

5-15 seconds

20-60 seconds

1-3 minutes

Fast AF, consistent

Ape

20-45 seconds

1-3 minutes

3-8 minutes

Meh, Python slow

Brownie

Who cares

Don't use

Dead

Maintainers quit

Truffle

1-2 minutes

5-10 minutes

Why bother?

Somehow worse than Hardhat

Related Tools & Recommendations

compare
Similar content

Hardhat vs Foundry: Best Smart Contract Frameworks for Devs

Compare Hardhat vs Foundry, Truffle, and Brownie to pick the best smart contract framework. Learn which tools are actively supported and essential for modern bl

Hardhat
/compare/hardhat/foundry/truffle/brownie/framework-selection-guide
100%
tool
Similar content

Foundry: Fast Ethereum Dev Tools Overview - Solidity First

Write tests in Solidity, not JavaScript. Deploy contracts without npm dependency hell.

Foundry
/tool/foundry/overview
53%
tool
Similar content

Truffle is Dead: Smart Contract Migration & Alternatives

Explore why the Truffle framework was discontinued, its role in smart contract development, and essential migration options and alternatives for your decentrali

Truffle Suite
/tool/truffle/overview
45%
tool
Similar content

Brownie Python Framework: The Rise & Fall of a Beloved Tool

RIP to the framework that let Python devs avoid JavaScript hell for a while

Brownie
/tool/brownie/overview
43%
tool
Similar content

Debugging Broken Truffle Projects: Emergency Fix Guide

Debugging Broken Truffle Projects - Emergency Guide

Truffle Suite
/tool/truffle/debugging-broken-projects
40%
tool
Similar content

Hardhat Ethereum Development: Debug, Test & Deploy Smart Contracts

Smart contract development finally got good - debugging, testing, and deployment tools that actually work

Hardhat
/tool/hardhat/overview
39%
compare
Recommended

Web3.js is Dead, Now Pick Your Poison: Ethers vs Wagmi vs Viem

Web3.js got sunset in March 2025, and now you're stuck choosing between three libraries that all suck for different reasons

Web3.js
/compare/web3js/ethersjs/wagmi/viem/developer-ecosystem-reality-check
37%
tool
Similar content

Hardhat 3 Migration Guide: Speed Up Tests & Secure Your .env

Your Hardhat 2 tests are embarrassingly slow and your .env files are a security nightmare. Here's how to fix both problems without destroying your codebase.

Hardhat
/tool/hardhat/hardhat3-migration-guide
37%
tool
Similar content

Hardhat Production Deployment: Secure Mainnet Strategies

Master Hardhat production deployment for Ethereum mainnet. Learn secure strategies, overcome common challenges, and implement robust operations to avoid costly

Hardhat
/tool/hardhat/production-deployment
28%
howto
Similar content

Polygon Dev Environment Setup: Fix Node.js, MetaMask & Gas Errors

Fix the bullshit Node.js conflicts, MetaMask fuckups, and gas estimation errors that waste your Saturday debugging sessions

Polygon SDK
/howto/polygon-dev-setup/complete-development-environment-setup
28%
tool
Similar content

Hardhat Advanced Debugging & Testing: Debug Smart Contracts

Master console.log, stack traces, mainnet forking, and advanced testing techniques that actually work in production

Hardhat
/tool/hardhat/debugging-testing-advanced
27%
howto
Similar content

Deploy Smart Contracts on Optimism: Complete Guide & Gas Savings

Stop paying $200 to deploy hello world contracts. Here's how to use Optimism like a normal person.

/howto/deploy-smart-contracts-optimism/complete-deployment-guide
25%
tool
Similar content

Stacks Blockchain: Bitcoin Smart Contracts & Development Guide

Bitcoin L2 for smart contracts that actually inherits Bitcoin security - works way better since the October 2024 upgrade.

Stacks Blockchain
/tool/stacks/overview
24%
tool
Similar content

Anchor Framework: Solana Smart Contract Development with Rust

Simplify Solana Program Development with Rust-based Tools and Enhanced Security Features

Anchor Framework
/tool/anchor/overview
24%
tool
Recommended

Foundry Debugging - Fix Common Errors That Break Your Deploy

Debug failed transactions, decode cryptic error messages, and fix the stupid mistakes that waste hours

Foundry
/tool/foundry/debugging-production-errors
22%
compare
Recommended

Remix vs SvelteKit vs Next.js: Which One Breaks Less

I got paged at 3AM by apps built with all three of these. Here's which one made me want to quit programming.

Remix
/compare/remix/sveltekit/ssr-performance-showdown
22%
compare
Recommended

Framework Wars Survivor Guide: Next.js, Nuxt, SvelteKit, Remix vs Gatsby

18 months in Gatsby hell, 6 months testing everything else - here's what actually works for enterprise teams

Next.js
/compare/nextjs/nuxt/sveltekit/remix/gatsby/enterprise-team-scaling
22%
tool
Recommended

Remix - HTML Forms That Don't Suck

Finally, a React framework that remembers HTML exists

Remix
/tool/remix/overview
22%
tool
Recommended

Fix Ethers.js Production Nightmares - Debug Guide for Real Apps

When MetaMask breaks and your users are pissed - Updated for Ethers.js v6.13.x (August 2025)

Ethers.js
/tool/ethersjs/production-debugging-nightmare
21%
tool
Recommended

Viem - The Ethereum Library That Doesn't Suck

integrates with Viem

Viem
/tool/viem/overview
21%

Recommendations combine user behavior, content similarity, research intelligence, and SEO optimization