Install and Initialize a Foundry Application

Noah Hein
InstructorNoah Hein
Share this video with your friends

Social Share Links

Send Tweet

We will learn about how to install foundry, and initialize your project using the forge command line utility.

After creating a new project, we'll learn about the high-level architecture of a forge application.

Here is the documentation on how to install Foundry.

Instructor: [0:02] Foundry, as you can see here, is considered a smart contract element toolchain, which means that it allows you to easily create workflows for writing your contracts, deploying them, and testing them. [0:18] To install Foundry, you can go to the Get Started tab. They will have different commands for all of the different platforms. For me, since I am on Mac, we can just copy this command. Then, we can go over here and paste it. That will install it.

[0:34] Then, what we want to do is we can run foundry up to install our project. Then, wherever you want to create your project, you can run forge init. I will call our project forge egghead. Here, you can see that forge has created a scaffold project for us.

[1:02] What we will be really working on is out of the source and the test folders. Source is where your smart contracts will go. You can see here that this is just an empty smart contract that needs to be filled out with functionality.

[1:17] Then, there's a test contract that inherits the test contract that forge gives us, along with some other nice functionality for writing tests that we will dig into.

[1:28] There's also this lib folder that we will not be making use of in this course, but is worth digging into as you level up in your smart contract writing skills.

[1:38] Whenever you import third-party libraries for various bits of functionality into forge, they will go in your lib folder, and you will import them in your smart contracts through there.