state.ts file is important

Stackr-CLI has a basic parser that looks for state.ts file in the root directory to extract the STF logic. If you don’t have this file, you will get an error.

However, you are free to add remove any other files in the root directory.

genesis-state.json file is important

Stackr-CLI looks for genesis-state.ts file in the root directory to extract the genesis state and register with the Vulcan Layer.

deployment.json file is important

This file is used to get the appId and rollup’s inbox address. This is automatically generated after you register the rollup using CLI.

Please use top level imports

For libraries like ethers-js there are some default ways of importing functions. However you should use it from the top level and call it from there

example

Do this 👇

import { AbiCoder } from "ethers";

const encoder = AbiCoder.defaultAbiCoder();
encoder.encode(stuff);

Do not do this ❌

import { ethers } from "ethers";

const encoder = ethers.AbiCoder.defaultAbiCoder();
encoder.encode(stuff);

Ideally the Stackr-CLI parses the file and makes this conversion, but it’s not that smart yet for complicated setups.

Do NOT do network calls in the STF

The STF is meant to be a pure function that takes in some input and returns some output. It should not do any network calls or any other side effects.

In case you want to do network calls, you can do it before creating an action, and pass the result to the STF in the submitAction step.