Seismic Book
  • Welcome
  • introduction
    • Why
    • What
    • How
  • onboarding
    • Installation
    • Quickstart
    • Tutorial
      • Setting Up Your Walnut App Project
        • Verify devtool installation
        • Create project structure and monorepo workspace
        • Initialize the contracts subdirectory
        • Initialize the CLI subdirectory
      • Writing, testing and deploying the contract
        • Chapter 1: Making the Kernel
        • Chapter 2: Making the Shell and revealing the Kernel
        • Chapter 3: Reset Mechanism, Rounds, and a more conditional Kernel Reveal
        • Chapter 4: Testing your Walnut contract
        • Deploying your contract
      • Interacting with the contract via a CLI
        • Quick primer: seismic-viem
        • Chapter 1: Defining the constants and utilities
        • Chapter 2: Writing the core app
        • Chapter 3: Bringing it all together
      • Understanding the Walnut contract
  • core
    • Basics
      • suint / sint
      • saddress
      • sbool
    • Collections
    • Clients
  • Appendix
    • Devnet
Powered by GitBook

Contact us

  • Telegram
  • Twitter
  • Email
On this page
Export as PDF
  1. onboarding
  2. Tutorial
  3. Setting Up Your Walnut App Project

Initialize the contracts subdirectory

  1. Navigate to the contracts subdirectory:

cd packages/contracts
  1. Initialize a project with sforge :

sforge init --no-commit && rm -rf .github

This 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 .github workflow folder (not required)

  1. Edit the .gitignore file to be the following:

.env
broadcast/
cache/
  1. Delete the default contract, test and script files (Counter.sol and Counter.t.sol and Counter.s.sol ) and replace them with their Walnut counterparts (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.sol

These files are empty for now, but we will add to them as we go along.

PreviousCreate project structure and monorepo workspaceNextInitialize the CLI subdirectory

Last updated 2 months ago