This repo contains the code for my blog post on how to use Foundry to
- Develop Contract.
- Write Tests in Solidity (instead of ChaiJS).
- Deploy the Contract.
If you wish to follow along I would suggest you browse over to my article published on dev.to . To deploy the contract you need to have Linux or WSL. Make sure to change the environment variables to your required values before following the instructructions below:
- Run
source ./env.sh
to set the required Environment Variables. - Run
forge create --rpc-url $ETH_RPC_URL --constructor-args <CONTRUCTOR ARGUMENTS for your CONTRACT> --private-key $PRIVATE_KEY <CONTRACT NAME> --verify
.
Note:
- The
--verify
flag needs to haveETHERSCAN_API_KEY
variable set. This is done through step 1. - The contract name should be without the .sol extension. For eg., if contract name is
Test.sol
and the contract inside it is calledTest
, then you need to passTest
in the contract name space in the above command.