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

chore: rename UMEE token to UX token part1 #2328

Merged
merged 27 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9a8d82f
bank: rename UMEE token to UX
robert-zaremba Nov 16, 2023
e1c9319
migration
robert-zaremba Nov 16, 2023
bfc47d2
use new token BaseName and introduce IBCBaseName
robert-zaremba Nov 16, 2023
06762bd
Revert "use new token BaseName and introduce IBCBaseName"
robert-zaremba Nov 17, 2023
c9bedd9
rename
robert-zaremba Nov 17, 2023
ecdf28b
Merge branch 'main' into robert/ux-token
robert-zaremba Nov 17, 2023
e3ec745
typo
robert-zaremba Nov 17, 2023
942bb8e
update denom validation regexp
robert-zaremba Nov 17, 2023
169f1c5
rollback UX symbol to UMEE
robert-zaremba Nov 20, 2023
15d81a4
Merge branch 'main' into robert/ux-token
robert-zaremba Nov 20, 2023
27ce256
Merge branch 'main' into robert/ux-token
robert-zaremba Jan 3, 2024
51bd4b1
updates
robert-zaremba Jan 3, 2024
14dcc13
lint
robert-zaremba Jan 3, 2024
964d8a2
lint
robert-zaremba Jan 3, 2024
2c67224
Merge branch 'main' into robert/ux-token
robert-zaremba Feb 8, 2024
d311dc7
Merge remote-tracking branch 'origin/main' into robert/ux-token
robert-zaremba Feb 8, 2024
35b76ab
use DeepEquals
robert-zaremba Feb 8, 2024
f62e63a
fix leverage tests
robert-zaremba Feb 8, 2024
1621e95
fix oracle cli tests
robert-zaremba Feb 8, 2024
c54c3be
fix oracle tests
robert-zaremba Feb 8, 2024
8ac9978
lint
robert-zaremba Feb 8, 2024
2f31a79
lint
robert-zaremba Feb 8, 2024
587266e
lint
robert-zaremba Feb 8, 2024
4dc18fd
Merge branch 'main' into robert/ux-token
robert-zaremba Feb 8, 2024
d32e6c8
update linter settings
robert-zaremba Feb 8, 2024
99f7f16
test
robert-zaremba Feb 8, 2024
8458588
oracle tests: use LegacyDisplayDenom
robert-zaremba Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ type BankModule struct {
bank.AppModuleBasic
}

// DefaultGenesis returns custom Umee x/bank module genesis state.
func (BankModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
umeeMetadata := banktypes.Metadata{
func umeeTokenMetadata() banktypes.Metadata {
return banktypes.Metadata{
Description: "The native staking token of the Umee network.",
Base: appparams.BondDenom,
Base: appparams.BondDenom, // NOTE: must not change
Name: appparams.DisplayDenom,
Display: appparams.DisplayDenom,
Symbol: appparams.DisplayDenom,
Expand All @@ -44,17 +43,20 @@ func (BankModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
Denom: appparams.BondDenom,
Exponent: 0,
Aliases: []string{
"microumee",
"microumee", appparams.BaseExtraDenom,
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
},
},
{
}, {
Denom: appparams.DisplayDenom,
Exponent: 6,
Aliases: []string{},
Aliases: []string{appparams.LegacyDisplayDenom},
},
},
}
}

// DefaultGenesis returns custom Umee x/bank module genesis state.
func (BankModule) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage {
umeeMetadata := umeeTokenMetadata()
genState := banktypes.DefaultGenesisState()
genState.DenomMetadata = append(genState.DenomMetadata, umeeMetadata)

Expand Down
13 changes: 12 additions & 1 deletion app/params/app_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ const (
Name = "umee"

// BondDenom defines the native staking token denomination.
// NOTE: it is used by IBC, and must not change to avoid token migration in all IBC chains.
BondDenom = "uumee"

BaseExtraDenom = "uux"

// DisplayDenom defines the name, symbol, and display value of the umee token.
DisplayDenom = "UMEE"
DisplayDenom = "UX"

// Old display name. We renamed UMEE to UX.
LegacyDisplayDenom = "UMEE"

// DefaultGasLimit - set to the same value as cosmos-sdk flags.DefaultGasLimit
// this value is currently only used in tests.
Expand All @@ -36,4 +42,9 @@ func init() {
if AccountAddressPrefix != Name {
log.Fatal("AccountAddresPrefix must equal Name")
}

sdk.SetCoinDenomRegex(func() string {
// allow "ux" token. Default regexp requires denom to be at least 3 characters long.
return `[a-zA-Z][a-zA-Z0-9/:._-]{1,127}`
})
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
}
17 changes: 17 additions & 0 deletions app/params/app_settings_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package params

import (
"testing"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"
)

func TestDenoms(t *testing.T) {
assert := assert.New(t)

assert.NoError(sdk.ValidateDenom(BondDenom))
assert.NoError(sdk.ValidateDenom(BaseExtraDenom))
assert.NoError(sdk.ValidateDenom(DisplayDenom))
assert.NoError(sdk.ValidateDenom(LegacyDisplayDenom))
robert-zaremba marked this conversation as resolved.
Show resolved Hide resolved
}
1 change: 1 addition & 0 deletions app/params/prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
)

// AccountAddressPrefix defines the Umee network's Bech32 address prefix.
// NOTE: this must not be changed.
const AccountAddressPrefix = "umee"

// Account specific Bech32 prefixes.
Expand Down
6 changes: 6 additions & 0 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ func (app *UmeeApp) registerUpgrade6_2(upgradeInfo upgradetypes.Plan) {
if err != nil {
return fromVM, err
}

// migration UMEE -> UX token metadata
app.BankKeeper.SetDenomMetaData(ctx, umeeTokenMetadata())

// Initialize a new Cosmos SDK 0.47 parameter: MinInitialDepositRatio
govParams := app.GovKeeper.GetParams(ctx)
govParams.MinInitialDepositRatio = sdk.NewDecWithPrec(1, 1).String()
err = app.GovKeeper.SetParams(ctx, govParams)
Expand All @@ -126,6 +131,7 @@ func (app *UmeeApp) registerUpgrade6_2(upgradeInfo upgradetypes.Plan) {
uIBCKeeper := app.UIbcQuotaKeeperB.Keeper(&ctx)
uIBCKeeper.MigrateTotalOutflowSum()
err = uIBCKeeper.SetParams(uibc.DefaultParams())

return fromVM, err
},
)
Expand Down
Loading