Examples¶
Annotated references for the canonical Fourier source files shipped in fourier/examples/.
- Counter — minimal contract with init and a single mutating method. Source:
fourier/examples/counter.fou. - Token (ERC-20-flavored) — balances mapping,
transferwith event emission. Source:fourier/examples/token.fou. - Threshold (M-of-N) — pattern reference for an M-of-N approval contract. Built from the multisig stdlib primitives.
- Guestbook — append-only message log using a storage array.
The first two correspond to working .fou files. The second two are pattern references built from primitives in the language and stdlib; v1 does not ship them as separate .fou files.
Page structure¶
Each page:
- Shows the full source.
- Annotates each declaration and function.
- Notes the resulting selector layout, storage slots, and any subtleties.
- Lists variants.
For language-feature deep-dives, see the Language reference. The examples here assume familiarity with the Quick reference.