tezos-commons / baseDAO

BaseDAO - a generic smart contract framework for DAOs on Tezos
57 stars 15 forks source link

Stop using lambdas for instantiation and make compile-time choices instead #263

Closed pasqu4le closed 2 years ago

pasqu4le commented 3 years ago

Clarification and motivation

Currently the various instantiation of the DAO (trivialDAO, registryDAO and treasuryDAO, as well as custom DAOs) all have the same contract code and they only differ by stored lambdas, custom entrypoints and fields.

Such a setup however has a heavy cost, mainly due to:

This also poorly reflects on the UX as packing is necessary for many entrypoint calls and that's inconvenient.

The alternative is to create different contract code (as well as storage) at compile time for the different instantiations.

Known LIGO tecniques based on #if/#define/#include can be used for this, however some consideration about import ordering might be necessary and non-trivial.

Acceptance criteria