Guides
Getting started
Requirements#
- Node.js 22
- npm
- A local clone of the JETH repository
JETH is currently pre-release. Use the repository entry point until a versioned jethc package and standalone binary are published.
Install and verify#
npm install
npm run build
npm testCompile the bundled counter example:
npm run jethc -- examples/Counter.jeth --abi --bin --layoutWrite artifacts to a directory:
npm run jethc -- examples/Counter.jeth -o build/The CLI loads relative imports, handles multi-contract entries, writes complete artifact sets, and provides human or structured output:
jethc <entry.jeth> [options]
-o, --output <dir> write artifacts
--contract <name> select one contract
--evm-version <name> select the EVM target
--emit <kinds> select artifact files
--abi, --bin, --yul print compiler outputs
--layout print storage layout JSON
--json emit structured JSON
--config <file> load project defaults
--standard-json read JSON from stdinCreate a contract#
Create Hello.jeth:
class Hello {
value: u256 = 0n;
setValue(next: u256): External<void> {
this.value = next;
}
get readValue(): External<u256> {
return this.value;
}
}Compile it:
npm run jethc -- Hello.jeth -o build/The output directory contains ABI, creation bytecode, runtime bytecode, Yul, storage layout, and versioned metadata. See Compiler, CLI, and tooling for imports, multi-contract selection, configuration, standard JSON, and exit codes.
Read JETH syntax correctly#
- Integer literals use BigInt syntax:
1n, not1. u256means an EVMuint256, not a JavaScript number.- A bare class is a contract.
- A bare field is storage.
- A method returning
External<T>is externally callable. - A
getmethod is read-only; the compiler inferspureorview. - A method without
External<T>orPayable<T>is internal. - Arithmetic is checked unless it is inside
unchecked: { ... }.
Next steps#
- Take the language tour.
- Browse progressively larger examples.
- Use the language reference for exact syntax.
- Check SUPPORTED.md before relying on an advanced shape.
- Read security considerations and the compiler correctness model before deploying anything.
- Open BURG at burg.a16k.org to write and compile JETH contracts in the browser with no install required.