tezos-commons / baseDAO

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

Move all inlined constants to storage #138

Closed pasqu4le closed 3 years ago

pasqu4le commented 3 years ago

Clarification and motivation

We should move all the constants that are currently in-lined in the code to the storage.

Currently the LIGO version of the contract has very little of them (due to the config being part of the overall contract storage)., but there may be some. All the ones I can think of are the unfrozen_token_id and frozen_token_id nat values, but we should check carefully.

Some clarifications are needed:

  1. Does "constants" include the lambda used in the configuration as well?
  2. Should this affect the Lorentz version of the contract too, or just the LIGO one?
  3. (a combination of the previous two) If this is an update intended for the Lorentz version, should only the nat/Naturals of its configuration be moved to storage or the code in it be moved to stored lambdas too?

Acceptance criteria

Constants that are part of the storage and not in-lined into the code.

gromakovsky commented 3 years ago

@obstropolos can you please take a look at the "Some clarifications are needed" part? Currently we assume that constants to be moved into storage include only "atomic" constants, i. e. MaxProposals, MaxVotes, MaxQuorumThreshold, MinQuorumThreshold, MaxVotingPeriod and MinVotingPeriod. Is it correct or should we move lambdas to the storage as well? Note that in LIGO everything seems to be in the storage already (we will double-check it), while in Lorentz some pieces of code (lambdas) are inlined, as well as 6 aforementioned constants.

michaeljklein commented 3 years ago

@gromakovsky yes, lambdas are included and need to be moved to storage.

pasqu4le commented 3 years ago

Note: given that the Ligo version only will be updated from now on, we'l limit the changes to that.