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

Add max-supply param to mint module #13308

Closed
Tracked by #19761
anilcse opened this issue Sep 15, 2022 · 10 comments · Fixed by #19896
Closed
Tracked by #19761

Add max-supply param to mint module #13308

anilcse opened this issue Sep 15, 2022 · 10 comments · Fixed by #19896

Comments

@anilcse
Copy link
Collaborator

anilcse commented Sep 15, 2022

Summary

Currently a number of Cosmos based chains are announcing max-supply for their tokens but practically there's no hard-limit configurable in cosmos-sdk

Proposal

Introduce a new genesis param max-supply for mint module.
Newly minted tokens should consider this limit

@tac0turtle
Copy link
Member

tac0turtle commented Sep 16, 2022

teams that have a max supply are not using the cosmos-sdk mint module, they have forked. We should see what they have added and upstream (evmos, osmosis are two that come to mind)

@alexanderbez
Copy link
Contributor

What would adding this parameter do exactly? Say we add it, we don't actually use or enforce maximum supply? Or are you suggesting that we add this param and limit minted tokens?

@anilcse
Copy link
Collaborator Author

anilcse commented Sep 16, 2022

What would adding this parameter do exactly? Say we add it, we don't actually use or enforce maximum supply? Or are you suggesting that we add this param and limit minted tokens?

Yes, this param will limit minting

@alexanderbez
Copy link
Contributor

I mean I'm not necessarily opposed to it. But also, there really isn't any chain I know of that uses x/mint and has a capped supply.

@akure
Copy link

akure commented Nov 1, 2022

This is a good feature to be added to the mint module. This is actually an invariant though.
What should be the default behavior of the chain after it reaches the max_supply value? Maybe it can continue running and validators will stop getting the inflation part as there will not be any inflation. The rest of the logic should be dependent on chains about what solution they bring to incentivize delegators and validators.

@anilcse
Copy link
Collaborator Author

anilcse commented Nov 1, 2022

I mean I'm not necessarily opposed to it. But also, there really isn't any chain I know of that uses x/mint and has a capped supply.

Akash and Passage have capped supply (on paper), they are planning to adjust the inflation (based on estimated timeline)

@tac0turtle
Copy link
Member

would the interaction with the cap be effected by token burns?

@anilcse
Copy link
Collaborator Author

anilcse commented Nov 1, 2022

would the interaction with the cap be effected by token burns?

Hmm, not sure. But I think it should consider burned tokens or they should be sent to a burn address (such that IBC mint/burn doesn't get effected with this)

@akure
Copy link

akure commented Nov 1, 2022

I think - Effectively, It should be like.

current_total_supply = total minted so far + total burned so far

Two cases should be handled -

  1. Case 1 -
    If current_total_supply + expected_new_minting > max_supply then mint the diff ( max_supply - current_total_supply) and set the current_total_supply = max_supply
  2. Case 2 -
    If current_total_supply = max_supply, don't do anything.

Though this should be checked continuously on each block due to the possibility of burning. Whenever sufficient burn will happen, current_total_supply will be less than max_supply.

@tac0turtle
Copy link
Member

Im open to adding this feature. We can add it in the simplest form of only a max of supply + burned and later one refactor it base of better calculations of mint and burn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

5 participants