fix(docs): address tutorial audit issues#135
Merged
mHaines9219 merged 4 commits intomainfrom Mar 25, 2026
Merged
Conversation
- Fix wrong file path in Ch 1: packages/contracts/ClownBeatdown.sol → packages/contracts/src/ClownBeatdown.sol - Add note explaining unused _clownStamina constructor param in Ch 1 - Fix stale "shakes" comment in Ch 3 final contract (no shake mechanic) - Fix CLI .env: add both CHAIN_ID (broadcast path) and VITE_CHAIN_ID (chain selection) to match actual seismic-starter - Add example ABI JSON structure in frontend Ch 2 showing address/chainId fields and where to find the deployed address
sforge does not have a --no-commit flag (it doesn't commit by default). The command should be just `sforge init`. Verified by running the tutorial end-to-end.
## Summary
Walked through the entire Clown Beatdown tutorial end-to-end (project
setup → contract → tests → deploy → CLI → frontend) and fixed every
error that would block a developer.
### Errors found and fixed
**Project Setup**
- **`sforge init` fails without `--force`** — the `packages/contracts`
directory already exists from the monorepo setup step, so `sforge init`
refuses to run. Added `--force` flag.
- **`mv -t src index.ts` fails on macOS** — the `-t` flag is GNU-only
and doesn't exist on macOS. Changed to `mv index.ts src/`.
**Frontend (Chapter 1)**
- **Missing `@vitejs/plugin-react-swc`** — `vite.config.ts` imports
`@vitejs/plugin-react-swc` but the `react-ts` template only installs
`@vitejs/plugin-react`. Added install step.
- **`Config` type import breaks build** — `import { Config,
WagmiProvider }` from wagmi fails in Vite production builds because
`Config` is a type-only export. Fixed to `import { type Config,
WagmiProvider }`.
- **Missing supporting files** — `main.tsx` and `App.tsx` import
`store/store`, `theme`, `pages/Home`, `pages/NotFound`, `App.css`, and
`index.css` but these are never defined in the tutorial. Added a
"Supporting files" section.
**Frontend (Chapter 2)**
- **`ShieldedPublicClient`/`ShieldedWalletClient` type imports break
build** — these are type-only exports from `seismic-viem`. Fixed to
`type` imports.
- **Missing `ExplorerToast` and `useToastNotifications`** —
`useGameActions` imports these but they're never provided. Added a
"Supporting components" section before `useGameActions`.
### What worked correctly
- Contract code compiles and all 9 tests pass with `sforge build &&
sforge test`
- CLI code is structurally correct and type-checks
- Deployment script is valid (though `sforge script --broadcast` crashes
with a known sforge infrastructure bug on shielded writes)
## Test plan
- [ ] Follow the tutorial from scratch on a clean macOS machine
- [ ] Verify `sforge init --force` works in the monorepo setup
- [ ] Verify `mv index.ts src/` works on macOS
- [ ] Verify `bun add -d @vitejs/plugin-react-swc` + `npx vite build`
succeeds
- [ ] Verify all frontend files from the tutorial are accounted for
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes issues found during end-to-end audit of the Clown Beatdown tutorial:
packages/contracts/ClownBeatdown.sol→packages/contracts/src/ClownBeatdown.sol_clownStaminaconstructor param in Ch 1 (used in Ch 2).env: add bothCHAIN_ID(for broadcast path) andVITE_CHAIN_ID(for chain selection) to match actual seismic-starteraddress/chainIdfields and where to find the deployed addressTest plan
packages/contracts/ClownBeatdown.sol(without/src/) returns 0 results