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:
large Michelson types that have to be explicitly paid for in the storage (for lambdas, etc.)
unpacking of data from bytes to allow for generality between the various versions
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
the various contract instantiation are obtained at compile-time and produce different code
there are no more lambdas and big_maps in the storage to contain custom functions/entrypoints/fields
there is a way to create custom DAOs by means of a template-like module, whose usage is documented.
Clarification and motivation
Currently the various instantiation of the DAO (
trivialDAO
,registryDAO
andtreasuryDAO
, 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:
bytes
to allow for generality between the various versionsThis 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 asstorage
) 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