sim
binary.
sim init
sim.toml
configuration file, a sample listener, and a boilerplate API.
The command initializes a new Git repository, and makes the first commit containing all generated files.
mkdir new-project
and create a new directory before running the init command.
You can optionally scaffold a project from one of the official templates using the --template
flag.
For example, to start from the contract-decoder template:
--template
, the command uses the default sample template.
sim build
forge build
under the hood. This compiles every Solidity contract in your project—including the listener contracts inside listeners/
—along with any imported libraries.
sim test
listeners/test/
.
This command first compiles your contracts and then executes the tests using Foundry.
sim authenticate
sim help
sim --help
or sim -h
for the same functionality.
sim --version
sim abi
sim abi add <file_path>
abis/
(for example, abis/YourContract.json
).sim abi add abis/YourContract.json
pointing to the file you just created.sim abi codegen
abis/
directory. This is useful if the generated files need to be refreshed.
sim abi add
. Use it only when you want to force-regenerate the interfaces.sim listeners
sim abi
, you must append a sub-command after listeners
.
sim listeners evaluate
evaluate
does not persist any data. It is purely a local dry-run to ensure your handler logic behaves as expected.Flag | Required | Description |
---|---|---|
--start-block | Yes | First block to process. |
--chain-id | Conditional* | Chain ID to test against. If omitted, Sim tries to infer it from your addTrigger definitions. Required when your listener has triggers on multiple chains. |
--end-block | No | Last block to process. Provide this if you want to replay more than one block and observe state changes over a range. |
--listeners | No | Specific listener contract to evaluate. Accepts any listener contract within any of the Solidity files in /listener/src . If omitted, the command will run all listener contracts in all files. The command will fail if you specify an unknown listener. |