Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization of NahmiiToken transfers #451

Open
jijordre opened this issue Nov 1, 2019 · 0 comments
Open

Optimization of NahmiiToken transfers #451

jijordre opened this issue Nov 1, 2019 · 0 comments

Comments

@jijordre
Copy link
Contributor

jijordre commented Nov 1, 2019

Description

With the current implementation of NahmiiToken the gas of an invocation of transfer() or transferFrom() is of the order of 250k. This number should be contrasted with transfer costs of other comparable ERC20 tokens whose gas cost often times is in the range from 50k to 100k, or even below this range.

This issue describes the optimization of transfer of NahmiiToken w.r.t. gas cost. It is suggested that its store of balance blocks and holders is removed. The former requires an update of the balance blocks calculation given a span of block numbers so that a balance bin's value of balance blocks be calculated on the fly at claim time. The latter feature is deemed not needed in the contract as the set of holders may be obtained from other sources off-chain.

In the context of updating the balance blocks calculations it is suggested that the calculation itself be delegated to separate contract outside of NahmiiToken. This allows for code reuse as the same logics is also used in the current implementation of TokenHolderRevenueFund to obtain released amount blocks.

Definition of done

  • NahmiiToken has been updated
  • TokenHolderRevenueFund has been updated
  • RevenueTokenManager has been updated
  • Unit tests have been updated

Details & Questions

Depends on

@jijordre jijordre self-assigned this Nov 1, 2019
@jijordre jijordre added this to To do in nahmii contracts via automation Nov 1, 2019
@jijordre jijordre moved this from To do to In progress in nahmii contracts Nov 1, 2019
@jijordre jijordre moved this from In progress to To do in nahmii contracts Nov 1, 2019
@jijordre jijordre removed their assignment Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

1 participant