Skip to content

Commit

Permalink
Modify mint params in upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitys7 committed Nov 5, 2024
2 parents 946da07 + 8356719 commit eab2ae7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func (app *RealioNetwork) setupUpgradeHandlers() {
*app.IBCKeeper,
app.BridgeKeeper,
app.AccountKeeper,
app.MintKeeper,
app.EvmKeeper,
app.keys[evmtypes.StoreKey],
),
Expand Down
24 changes: 16 additions & 8 deletions app/upgrades/v2/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
assettypes "github.com/realiotech/realio-network/x/asset/types"
bridgekeeper "github.com/realiotech/realio-network/x/bridge/keeper"
bridgetypes "github.com/realiotech/realio-network/x/bridge/types"
mintkeeper "github.com/realiotech/realio-network/x/mint/keeper"
)

// CreateUpgradeHandler creates an SDK upgrade handler for v2
Expand All @@ -44,6 +45,7 @@ func CreateUpgradeHandler(
ibcKeeper ibckeeper.Keeper,
bridgeKeeper bridgekeeper.Keeper,
accountKeeper authkeeper.AccountKeeper,
mintKeeper mintkeeper.Keeper,
evmKeeper *evmkeeper.Keeper,
evmStoreKey storetypes.StoreKey,
) upgradetypes.UpgradeHandler {
Expand Down Expand Up @@ -110,14 +112,7 @@ func CreateUpgradeHandler(
return nil, err
}
err = bridgeKeeper.RegisteredCoins.Set(ctx, "ario", bridgetypes.RateLimit{
Ratelimit: math.Int(math.NewUintFromString("2000000000000000000000000")),
CurrentInflow: math.ZeroInt(),
})
if err != nil {
return nil, err
}
err = bridgeKeeper.RegisteredCoins.Set(ctx, "arst", bridgetypes.RateLimit{
Ratelimit: math.Int(math.NewUintFromString("1000000000000000000000000")),
Ratelimit: math.Int(math.NewUintFromString("1750000000000000000000000")),
CurrentInflow: math.ZeroInt(),
})
if err != nil {
Expand All @@ -140,6 +135,19 @@ func CreateUpgradeHandler(
if err != nil {
return nil, err
}

mintParams, err := mintKeeper.Params.Get(ctx)
if err != nil {
return nil, err
}

mintParams.InflationRate = math.LegacyNewDecWithPrec(8, 2)

err = mintKeeper.Params.Set(ctx, mintParams)
if err != nil {
return nil, err
}

return newVM, nil
}
}
Expand Down
2 changes: 1 addition & 1 deletion x/mint/types/minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

// Supply cap 1 RIO : 10^18 aRIO (attoRio)
var rioSupplyCap, _ = math.NewIntFromString("75000000000000000000000000")
var rioSupplyCap, _ = math.NewIntFromString("175000000000000000000000000")

// NewMinter returns a new Minter object with the given inflation and annual
// provisions values.
Expand Down

0 comments on commit eab2ae7

Please sign in to comment.