diff --git a/e2e/go.sum b/e2e/go.sum index b715a731..37fc83cf 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -1091,6 +1091,7 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/monerium/module-noble/v2 v2.0.0 h1:VZJnM+9yEKaGkvyfgeeQx2QIQusZkxOsL8mZiUHEiaQ= +github.com/monerium/module-noble/v2 v2.0.0/go.mod h1:Zdc3bwH628QVNcyNu6F6C3znA+Uxk+EnuSUUNYJJKlY= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= diff --git a/go.mod b/go.mod index 122273a3..a845bd1c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.4.1 - cosmossdk.io/math v1.3.0 cosmossdk.io/store v1.1.1 cosmossdk.io/tools/confix v0.1.2 cosmossdk.io/x/evidence v0.1.1 @@ -46,6 +45,7 @@ require ( cloud.google.com/go/storage v1.43.0 // indirect cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect + cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/x/tx v0.13.5 // indirect filippo.io/edwards25519 v1.1.0 // indirect github.com/4meepo/tagalign v1.3.4 // indirect diff --git a/upgrade/upgrade.go b/upgrade/upgrade.go index 5383332e..eeaaaf3a 100644 --- a/upgrade/upgrade.go +++ b/upgrade/upgrade.go @@ -21,7 +21,6 @@ import ( "cosmossdk.io/errors" "cosmossdk.io/log" - "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" upgradetypes "cosmossdk.io/x/upgrade/types" "github.com/cosmos/cosmos-sdk/baseapp" @@ -184,12 +183,6 @@ func CreateUpgradeHandler( // Migrate validator accounts to permanently locked vesting. MigrateValidatorAccounts(ctx, accountKeeper, stakingKeeper) - // Safely burn surplus staking token supply. - err = BurnSurplusSupply(ctx, authority, accountKeeper, bankKeeper) - if err != nil { - return vm, err - } - logger.Info(UpgradeASCII) return vm, nil } @@ -231,30 +224,6 @@ func MigrateValidatorAccounts(ctx context.Context, accountKeeper authkeeper.Acco } } -// BurnSurplusSupply performs a burn of the surplus $STAKE supply. -func BurnSurplusSupply(ctx context.Context, authority string, accountKeeper authkeeper.AccountKeeper, bankKeeper bankkeeper.Keeper) error { - supply := bankKeeper.GetSupply(ctx, "ustake") - surplus, err := supply.SafeSub(sdk.NewCoin( - "ustake", math.NewInt(1_000_000_000_000_000), - )) - - if err != nil || !surplus.IsPositive() { - return nil - } - - address, err := accountKeeper.AddressCodec().StringToBytes(authority) - if err != nil { - return err - } - err = bankKeeper.SendCoinsFromAccountToModule(ctx, address, upgradetypes.ModuleName, sdk.NewCoins(surplus)) - if err != nil { - return err - } - - err = bankKeeper.BurnCoins(ctx, upgradetypes.ModuleName, sdk.NewCoins(surplus)) - return err -} - // GetModuleMessages is a utility that returns all messages registered by a module. func GetModuleMessages(registry codectypes.InterfaceRegistry, name string) (messages []string) { for _, message := range registry.ListImplementations(sdk.MsgInterfaceProtoName) {