DEV Community

Adebayo Olamilekan
Adebayo Olamilekan

Posted on

Installing foundry toolchain on windows.

As windows users, we mostly suffer when installing complicated software and programs on our machines, just like foundry 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 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

So to use Foundry on our machines we follow the steps given on their site

Linux and MacOs
A couple of commands are just needed to get foundry ready on both mac and Linux machines but not windows.

Windows

*Steps to get Foundry on your Windows PC *

1) Download rust by going to rust.
rust
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

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

No packages yet

  • Then you'll have to download Microsoft Visual Studio here

Download

  • 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

Installation process

installation

  • After a successful downloading and installation then re-run the rust exe and it should look like this

Now
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


Enter fullscreen mode Exit fullscreen mode

or



forge --version


Enter fullscreen mode Exit fullscreen mode

Now you can use foundry in building smart contracts :)

Top comments (1)

Collapse
 
eik_1 profile image
Sarthak Rawat

Not working