adeelhasan / licensing-dapp

9 stars 0 forks source link

checkValidity should not modify state #6

Closed adeelhasan closed 2 years ago

adeelhasan commented 2 years ago

currently checkValidity has an auto renew mechanism, but is better to emit the possibility of a renewal, to be initiated separately by the callee. checkValidity will be the most frequently called method, so has to be more gas efficient and lightweight.

adeelhasan commented 2 years ago
  1. this is more gas efficient, reduced from 3300 to 1300 ish.
  2. the auto renewal option is moved to a separate function, allowing callers a choice.
  3. the notion of a series of cycles has also been factored out, the number of cycles done is removed, always on the current cycle. no need for a billing status either. these are all in the new LicenseeStatus struct