Now that weβve mastered unit, fuzz, invariant, and differential testing, itβs time to deploy our battle-tested smart contracts to real networks. Foundry makes deployment simple, scriptable, and even allows you to deploy to multiple chains in one command.
remappings) πWhen you use external libraries like OpenZeppelin, Foundry doesnβt know where to find them by default. You might write:
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
But Foundry has no idea what @openzeppelin means. Itβs just a path alias.
You tell Foundry: βHey, whenever you see @openzeppelin, go look in the lib/openzeppelin-contracts folder.β
First, install OpenZeppelin (or any library) using Forge:
forge install OpenZeppelin/openzeppelin-contracts
This downloads the contracts into your lib/ directory.
Edit your foundry.toml file: