Language¶
The Fourier language reference. Each page below covers one construct, grounded in fourier/parser.py and fourier/codegen.py.
Read in this order if you're new:
- Contracts — the top-level
contract { ... }block. What goes inside and theinitfunction. - Types —
uint,address,bool,bytes, plusmap[K, V]andarray[T]for storage. - Storage —
storage NAME: TYPE @ SLOT;declarations and how slots are derived for mappings, arrays, and struct fields. - Functions —
fnvspub fn, selector assignment, parameters, return types. - Statements —
let, assignment,if,while,return,require,emit. - Expressions — operators, precedence, builtins.
- Events —
eventdeclarations,emitsemantics, topic vs data layout. - Errors and reverts — how
requirerevertss, how sub-call failures propagate, the optionalbytesrevert payload. - Cross-contract calls —
call_b,delegatecall_b,staticcall_b, and the one-wordcall. - Address type — semantics, sentinels, comparison rules, builtins that return addresses.
The full grammar lives at fourier/GRAMMAR.md in the repo; this reference is the more detailed, code-grounded companion.