Scenarios

On this topic, see also our blog article which contains examples of OCaml scenarios and another one with elementary OCaml and Typescript scenarios.

Focus on the high-level

You can use the SDK generated by Factori to write scenarios for your smart contracts. This is useful at all stages of a smart contract's life: prototyping, testing, Dapp development, and deployment.

When you are developing a smart contract, you are bound to make many design changes, each of which might slightly change the interface of your contract. Instead of manually modifying storage and entrypoint parameter encodings each time you add or remove a field, you can just regenerate the interface (it's instantaneous, because Factori is really fast). Because our interfaces are statically typed, if your scenario is no more up to date with respect to the contract, instead of cryptic error from a Tezos node, you will get localized, easily understandable and fixable errors. For instance, if you just added the field admin (of type address to your storage, and your scenario deploys an initial storage without the field admin, you will get an error saying precisely this. In contrast, if you were deploying by hand, you might get an error from the node telling you that it expects a

Pair int (Pair address (Pair (Pair int string) (big_map address int)))


and got a

Pair int (Pair (Pair int string (big_map address int)))


Speed of iteration

It should be easy and fast to write and execute a scenario in Factori, on any Tezos blockchain (from Flextesa to ghostnet to mainnet). Using Flextesa, you can run it as fast as one block per second, which makes it easy to try out quick changes and adjust.

Defaults

Each contract imported from a blockchain comes with a its downloaded storage from the blockchain, so that you can quickly deploy it using the same storage with sensible defaults. Typically, you might deploy a contract with the same initial storage and change the admin to an address you control.