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

implement fee burning mechanism #32

Open
brenzi opened this issue Sep 7, 2021 · 2 comments
Open

implement fee burning mechanism #32

brenzi opened this issue Sep 7, 2021 · 2 comments

Comments

@brenzi
Copy link
Collaborator

brenzi commented Sep 7, 2021

Along the tokenomics paper Sec. 6:

We need to

  • count the cumulative number of extrinsics on the chain
  • upon fee payment, burn a fraction of the fees according to the formula in the paper
    • a lookup table with 100 entries is sufficient: yields burning rate resolution of 1%. that's smooth enough.
    • only if more efficient, use fixpoint math instead.
  • transfer the remainder to the treasury

learn more about burning and imbalances: https://blog.polymath.network/substrate-deep-dive-imbalances-8dfa89cc1d1?gi=7948e9237106

@brenzi
Copy link
Collaborator Author

brenzi commented Sep 18, 2021

first step is done in: #43

  • burn a constant fraction (99%), rest to treasury

@brenzi
Copy link
Collaborator Author

brenzi commented Sep 18, 2021

counting extrinsics per block is already done here:
https://github.com/paritytech/substrate/blob/ba153b9ae050eda022f002d74d76f98d1e339a81/frame/system/src/lib.rs#L582
however, AFAIK there is no global monotonic counter yet

Option 1

implement a dedicated pallet that just features on_finalize and adds ExtrinsicCount to the global counter it holds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant