Code generation
To interact with smart contracts with full type safety, place your ABI JSON files in thesrc/contracts/ folder. Compose automatically generates TypeScript classes when you run compose start or compose deploy.
You can also manually trigger code generation:
Generated classes
For each ABI file (e.g.,src/contracts/USDC.json), Compose generates a typed class that you can access via evm.contracts:
.write or .read suffixes. View functions return their result directly, while state-changing functions return { hash, receipt }.
Decoding event logs
Each generated contract class includes a staticdecodeEventLog() method for decoding onchain events with full type safety: