Skip to content
LogoLogo

Hardhat & Foundry

deployoor reads compiled artifacts. The only framework-specific input is where those artifacts live — everything else is plain viem.

Auto-detection

ToolchainArtifactsConfig file
Foundryout/ + out/build-info/foundry.toml
Hardhat v2artifacts/hardhat.config.*
forge build && npx deployoor generate
# or
npx hardhat compile && npx deployoor generate

Hardhat: auto-generate on compile

Add @deployoor/hardhat to skip the separate generate step:

pnpm add -D @deployoor/hardhat deployoor viem
// hardhat.config.js
require("@deployoor/hardhat");
 
module.exports = { solidity: "0.8.24" };

Every hardhat compile regenerates ./deployers/:

npx hardhat compile
# deployoor: generated 3 deployer file(s)

Foundry

No Hardhat-style plugin — run deployoor generate after forge build (or add it to your package.json scripts / CI).

Hardhat v3

Not yet supported. Hardhat v3 reworked the artifact layout — first-class v2 + v3 support alongside Foundry is a near-term priority.

Examples

Runnable examples live in the monorepo: