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

Universalize mint with custom inflation redirection #21

Open
lumtis opened this issue Aug 26, 2022 · 0 comments
Open

Universalize mint with custom inflation redirection #21

lumtis opened this issue Aug 26, 2022 · 0 comments
Labels
mint Mint module

Comments

@lumtis
Copy link
Contributor

lumtis commented Aug 26, 2022

Many self-sovereign blockchains have their own tokenomics that can influence the block rewards:

  • Rewards for incentivization pools (incentivized liquidity pools for ex)
  • Rewards for community pools
  • Rewards for predefined addresses
  • Rewards for insurance funds
  • etc....

The current methodology for a project is to fork one of these customized mint module and change it for the logic of the chain since the SDK mint module doesn't allow for flexibility.
As opened here tendermint/spn#852, customized open sourced mint found in the space also include very few tests for such an important and sensitive component.

The same as the claim module, the idea of this issue is to make mint module under this repo universal and reusable for any other project with minimal changes. Developers can integrate the module with extensive test and plug it into other module for usage of rewards.

Proposed solution

Include as part of the module params:

  • Weight for staking rewards
  • Weight for community pool
  • Generic list of weighted addresses, where a description can be associated with each address
  • Generic list of... let's say "pipes" for customized rewards redirection
{
  StakingWeight sdk.Int
  CommunityPoolWeight sdk.Int
  FundedAddressesWeight sdk.Int
  PipesWeight sdk.Int
}
FundedAddresses []{
  Address string
  Description string
  Weight sdk.Int
}
Pipes []{
  PipeID uint64
  Description string
  Weight sdk.Int
}

The pipe is a generic way to represent a redirection of the block rewards.

In app.go modules can register for a pipe with the following method:

func (MintKeeper) SubscribePipe(pipeID uint64, func (blockRewards sdk.Coins)) error

The method panic is a pipe is subscribed twice.

Example: usage:

// keeper initialization....
//...

app.MintKeeper.SubscribePipe(LiquidityIncentivePipeID, app.LiquidityKeeper.ProvideLiquidityIncentives)
...
@lumtis lumtis added the mint Mint module label Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mint Mint module
Projects
None yet
Development

No branches or pull requests

1 participant