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

feat: Municipal Inflation #162

Merged
merged 11 commits into from
Aug 12, 2023
Merged

feat: Municipal Inflation #162

merged 11 commits into from
Aug 12, 2023

Conversation

Jonathansumner
Copy link
Member

@Jonathansumner Jonathansumner commented Aug 7, 2023

Implements the Municipal Inflation mechanism.

Municipal(= Local) GOVERNANCE of distribution
The defining feature is the governance of the tokens generated(minted) by Municipal Inflation - tokens are minted on to predefined target address, and whoever controls access to that adress (e.g. it can be related private key, multisig wallet, contract, or possibly address of cosmos-sdk module) fully controls dictribution of tokens generated by the municipal inflation at that target address - hence the "Municipal" name (as opposed to trully decentralised governance distribution model(e.g. distrubution based on proportionality of users stake agains over all staked amount)).

If required, the Decentralisation can be achieved by using contract (which implements decentralised distribution of the inflated tokens) and setting address of such contract in to target_address. This will “convert” Municipal distribution governance do Decentralised one, so to speak.

CONFIGURATION
Municipal inflation is configured in genesis.json located in the mint.minter.municipal_inflation node - see below the example.

  • IMMUTABILITY: The configuration node is intentionally located under the min.minter node in order to make the configuartion immutable = by design, it is NOT possible to change configuration of Municipal Inflation while network is running (e.g. via governance proposal). The only way how to change the configuration of Municipal Inflation is to restart the network.
  • Value Represesentation: The value represents ANNUAL value of inflation in [1] unit ([%] = 100x[1]), what means that "value": 0.03 equals to 3% annual inflation
  • MULTI-Denomination support: the Municipal Inflation can be configured for multiple denominations individually = each configured denomination has its own insulated stup (target address & inflation value)
"municipal_inflation": [
  {
    "denom": "denomA",
    "inflation": {
      "target_address": "fetch123...abc",
      "value": "0.03"
      }
  },
  {
    "denom": "denomB",
    "inflation": {
      "target_address": "fetch234...bcd",
      "value": "0.05"
      }
  },
  {
    "denom": "denomC",
    "inflation": {
      "target_address": "fetch345...cde",
      "value": "0.1"
      }
  }
]

@codecov-commenter
Copy link

codecov-commenter commented Aug 7, 2023

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 63.97059% with 49 lines in your changes missing coverage. Please review.

Project coverage is 60.51%. Comparing base (1d996e8) to head (6027a27).
Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
x/mint/abci.go 0.00% 26 Missing ⚠️
x/mint/keeper/grpc_query.go 0.00% 7 Missing ⚠️
x/mint/keeper/querier.go 0.00% 7 Missing ⚠️
x/mint/types/inflations.go 86.66% 2 Missing and 2 partials ⚠️
x/mint/types/minter.go 57.14% 3 Missing ⚠️
x/mint/keeper/keeper.go 33.33% 2 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   60.45%   60.51%   +0.05%     
==========================================
  Files         600      601       +1     
  Lines       38791    38920     +129     
==========================================
+ Hits        23452    23551      +99     
- Misses      13366    13386      +20     
- Partials     1973     1983      +10     
Files with missing lines Coverage Δ
x/mint/client/testutil/suite.go 100.00% <100.00%> (ø)
x/mint/genesis.go 57.14% <100.00%> (+7.14%) ⬆️
x/mint/module.go 57.14% <ø> (ø)
x/mint/keeper/keeper.go 64.51% <33.33%> (ø)
x/mint/types/minter.go 71.42% <57.14%> (-0.80%) ⬇️
x/mint/types/inflations.go 86.66% <86.66%> (ø)
x/mint/keeper/grpc_query.go 56.25% <0.00%> (-43.75%) ⬇️
x/mint/keeper/querier.go 59.37% <0.00%> (-16.63%) ⬇️
x/mint/abci.go 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

---- 🚨 Try these New Features:

@pbukva pbukva changed the title Feat: municipal inflation feat: Municipal Inflation Aug 8, 2023
pbukva added 2 commits August 8, 2023 14:35
* fix: [Cosmetic] Go linting
* CI test run - setting golang v1.18.10
Copy link
Contributor

@pbukva pbukva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pbukva pbukva merged commit 43f6e51 into main Aug 12, 2023
@pbukva pbukva deleted the feat/municipal-inflation branch August 12, 2023 10:29
@pbukva pbukva restored the feat/municipal-inflation branch August 12, 2023 10:44
@liton650
Copy link

@@ Coverage Diff @@

main #162 +/-

==========================================

  • Coverage 60.45% 60.51% +0.05%
    ==========================================
    Files 600 599 -1
    Lines 38791 38885 +94
    ==========================================
  • Hits 23452 23530 +78
  • Misses 13366 13374 +8
  • Partials 1973 1981 +8

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

Successfully merging this pull request may close these issues.

4 participants