Compose allows you to interact with smart contracts with type safety and flexible wallet options. See wallets for details on the different types of wallets.Documentation Index
Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
Use this file to discover all available pages before exploring further.
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:
.compose/generated/index.js. On compose deploy, the CLI bundles this file alongside your tasks so the same typed classes are available in the cloud.
Generated classes
For each ABI file (e.g.,src/contracts/BitcoinOracleContract.json), Compose generates a typed class that you can access via evm.contracts:
.write or .read suffixes. View/pure functions return their decoded value directly, while state-changing functions return { hash, receipt, userOpHash? } (the userOpHash is present only when gas sponsoring routes the transaction through a bundler).
Decoding event logs
Each generated contract class includes a staticdecodeEventLog() method for decoding onchain events with full type safety. This is commonly used in tasks triggered by onchain events:
decodeEventLog with a generic type parameter for a single known event type:
Direct wallet methods
You can also interact with contracts directly through wallet methods without generated classes. This is useful for one-off calls or contracts you don’t want to check an ABI into the repo for:Integer return types (
uint*/int*) are serialized as strings over IPC, so use string as the generic type for readContract when the return is a numeric type. Parse into BigInt if you need to do arithmetic.writeContract, readContract, and sendTransaction signatures, gas handling, confirmations, and reorg protection options.