A tutorial that teaches how to set up your development environment to work with Foundry.
Foundryup
, the Foundry’s toolchain installer.
To install Foundryup
you have to run in the terminal:
Foundryup
is installed, you can install Foundry
by running:
.gitmodules
file — this is because Foundry
handles dependencies using Git submodules.
By default the Foundry structure stores smart contracts in the src
folder. You can change this in the foundry.toml
configuration file.
For instance:
foundry.toml
file.
The first thing is the Solidity version.
You need to configure your config file as follows:
forge build
to ensure everything works well.
We also recommend setting up JSON RPC endpoints for Base and the API key for Basescan in the configuration file so that your environment is ready to deploy your smart contracts.
Your configuration file should look like the following:
Base
and Base Sepolia
and similar for the Etherscan section, we included the configuration for Basescan
for Sepolia and Mainnet. Both rely on the same API Key, BASESCAN_API_KEY
.
Foundryup
toolchain installer to creating your first project and configuring Foundry to seamlessly integrate with Base.