Installing foundry toolchain on windows.
Tags: foundry, smartcontract, web3, windows
Published: 2022-11-02 20:08:39

As windows users, we mostly suffer when installing complicated software and programs on our machines, just like [foundry](https://book.getfoundry.sh/) smart contract tool-chain.

Foundry manages your dependencies, compiles your project, runs tests, deploys, and lets you interact with the chain from the command line and via Solidity scripts. _(from official website)_

Using Foundry to compile, test and deploy is much faster and better compared to other smart contract tools like [hardhat](https://hardhat.org/) or truffle because using foundry is not only faster but testing and deployments are all written in solidity and not JavaScript.

Foundry doesn't only use solidity for testing and deployment, it also has the following interesting tools:

1) **Forge**:This is a command-line tool of foundry, that is used to install dependencies, build contracts, test them, deploy and also verify smart contracts.
2) **Cast**:This helps with smart contracts calls both locally and onchain (awesome right).
3) **Anvil**:This is the last tool of foundry and this serves as a local testnet, just like hardhat local node and ganache.

A Little more details on this on this Twitter [thread](https://twitter.com/Oleanji_sol/status/1579772754517102592?s=20&t=1sanVDzwrVIACuYxwuxUUw)

So to use Foundry on our machines we follow the steps given on their [site] (https://book.getfoundry.sh/) 

![Linux and MacOs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/02tkjkner02rxseqlbar.png)
A couple of commands are just needed to get foundry ready on both mac and Linux machines but not windows.

![Windows](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lnnzrglt5nphq8nx0fr2.png)


## **Steps to get Foundry on your Windows PC **

1) Download rust by going to [rust] (https://rustup.rs/). 
![rust](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0lzezpg0gb3djpsharg.png)
2) After successful installation, run the installed exe file, which should open up a window like command prompt.

  - if the window shows up like this then "Proceed with installation" by either pressing the "Enter" key or 1 and then press the "Enter" key.

![Ready to install forge](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/daw88z2f5n919wsztynx.png)

  - But in case it doesn't look like the above and like this picture (below) 

![No packages yet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0m439tin2rozhj1fgbi.png)

  - Then you'll have to download Microsoft Visual Studio [here] (https://visualstudio.microsoft.com/downloads/) 

![Download](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/srgtx655qhvpmzj66jh5.png)

  - Then install the following packages, i.e tick the boxes ticked here (below) just like what was required in the rust exe window. 
_ [Packages to install: MSVC & Windows 10 SDK]_

![Packages](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i9g615veyhtbelafhk1b.png)

Installation process

![installation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/feuijfzn0ap3z70jxi61.PNG)
 
  - After a successful downloading and installation then re-run the rust exe and it should look like this 

![Now](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h3wo3yerh3o8hfhvle6a.png)
So you can now proceed with the installation.

The installation of foundry (forge, cast, and anvil) might take a while, But after it's done you can check if it's installed by running this command:

```
forge -V
```
or 

```
forge --version
```

Now you can use foundry in building smart contracts :)