How to Create a New Foundry Project

A step-by-step guide to creating a new, empty Foundry project using forge init, with a real-world example from a Code4rena contest.

When I start a new security review, the first thing I do is get the project set up locally. Most projects use Foundry, so forge init is a command I run a lot. This recipe is a quick guide to how I set up a new project for a security contest, using the recent Covenant audit from Code4rena as an example.

The contest repo is here.

To create a new project, you just run forge init with the name of the directory you want to create.

Shell
forge init 2025-10-covenant

This creates a new directory called 2025-10-covenant and sets up a basic Foundry project inside it.

The forge init command has a bunch of useful flags. Here are the ones I use most often.

For the Covenant contest, I wanted to create an empty project inside the contest’s repository structure. Here’s the command I would use:

Shell
forge init 2025-10-covenant --empty --vscode --no-git

This gives me a clean, empty Foundry project ready for the Covenant contracts, with VS Code settings configured and without creating a new, nested git repository. It’s the perfect starting point for a security review.

Other recipes in Project