1

I'm curious about your strategies regarding the following questions:

  1. How do you generate your initial storage for deployment ? Where do you store your storage types ? Do you keep your storage definitions in separate files from the code itself?

  2. More generally, how do you organize your code? Do you place all the contract components in one file (types, storage, parameters, main, actions, local functions, views)? I tried to efficiently share some types, particularly the storage (I have a generic factory that needs to know the storage types of each created contract). However, I ended up with numerous small files, which made it very difficult to read. I plan to rework this, but I'm curious to hear some opinions and best practices.

3 Answers 3

0

I use Taquito and define initial storage in my deploy script. You have several exemples of code oragnization and deployment script in template contracts https://packages.ligolang.org/contracts

0

It's common to have separate files. In particular, I've seen separate files for storage - in storage.mligo/storage.jsligo like here. And this storage is #import 'ed in the main contract file like here.

You also might want to look at modular FA2 implementation library (tzgen). Here is an example how to use it and extend FA2 contracts.

0

Taqueria is great for this, it compiles your ligo code into michelson, so you can use your initial storage on deployment

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.