Skip to content

fix(docs): address tutorial audit issues#135

Merged
mHaines9219 merged 4 commits intomainfrom
docs/frontend-tutorial-and-audit-fixes
Mar 25, 2026
Merged

fix(docs): address tutorial audit issues#135
mHaines9219 merged 4 commits intomainfrom
docs/frontend-tutorial-and-audit-fixes

Conversation

@mHaines9219
Copy link
Copy Markdown
Contributor

Summary

Fixes issues found during end-to-end audit of the Clown Beatdown tutorial:

  • Fix wrong file path in contract Ch 1: packages/contracts/ClownBeatdown.solpackages/contracts/src/ClownBeatdown.sol
  • Add note explaining unused _clownStamina constructor param in Ch 1 (used in Ch 2)
  • Fix stale "shakes" comment in Ch 3 final contract — no shake mechanic exists in ClownBeatdown
  • Fix CLI .env: add both CHAIN_ID (for broadcast path) and VITE_CHAIN_ID (for 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

Test plan

  • Grep for packages/contracts/ClownBeatdown.sol (without /src/) returns 0 results
  • Grep for "shakes" in contract chapters returns 0 results
  • Lychee link checker passes

- 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
mHaines9219 and others added 3 commits March 25, 2026 16:29
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
@mHaines9219 mHaines9219 merged commit 3ceedd8 into main Mar 25, 2026
4 checks passed
@mHaines9219 mHaines9219 deleted the docs/frontend-tutorial-and-audit-fixes branch March 25, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant