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)
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
1) Download rust by going to 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.
- But in case it doesn't look like the above and like this picture (below)
- Then you'll have to download Microsoft Visual Studio here
- 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]_
- After a successful downloading and installation then re-run the rust exe and it should look like this
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:
Now you can use foundry in building smart contracts :)