Initialize the contracts subdirectory
Navigate to the contracts subdirectory:
cd packages/contractsInitialize a project with
sforge:
sforge init --no-commit && rm -rf .githubThis command will:
Create the contract project structure (e.g.,
src/,test/,foundry.toml).Automatically install the Forge standard library (
forge-std) as a submodule.Remove the
.githubworkflow folder (not required)
Edit the
.gitignorefile to be the following:
.env
broadcast/
cache/Delete the default contract, test and script files (
Counter.solandCounter.t.solandCounter.s.sol) and replace them with theirWalnutcounterparts (Walnut.sol,Walnut.t.sol and Walnut.s.sol ):
# Remove the Counter files
rm -f src/Counter.sol test/Counter.t.sol script/Counter.s.sol
# Create empty Walnut files in the same locations
touch src/Walnut.sol test/Walnut.t.sol script/Walnut.s.solThese files are empty for now, but we will add to them as we go along.
Last updated

