Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion api/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ buf export buf.build/cosmos/ibc:e69c8f372b127401762cb251bb7b60371b4cef29 --outpu
buf export buf.build/noble-assets/aura:v2.0.0 --output api/proto
buf export buf.build/noble-assets/authority:v1.0.3 --output api/proto
buf export buf.build/noble-assets/cctp:4285c94ec19438ad1e05ba3e5106a5e7980cfffd --output api/proto
buf export buf.build/noble-assets/dollar:v2.1.0 --output api/proto
buf export buf.build/noble-assets/dollar:v2.2.0-rc.0 --output api/proto
buf export buf.build/noble-assets/fiattokenfactory:5f9bd9dd2c5b5336b94bae4a47195bdf035f04af --output api/proto
buf export buf.build/noble-assets/florin:v2.0.0 --output api/proto
buf export buf.build/noble-assets/forwarding:v2.0.2 --output api/proto
Expand Down
1 change: 1 addition & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,7 @@ func (app *App) RegisterUpgradeHandler() error {
app.AccountKeeper.AddressCodec(),
app.AuthorityKeeper,
app.BankKeeper,
app.DollarKeeper,
),
)

Expand Down
2 changes: 0 additions & 2 deletions app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,6 @@ modules:
denom: uusdn
vaults_minimum_lock: 1e6
vaults_minimum_unlock: 1e6
vaults_season_one_end_timestamp: 1754402400 # Aug 5th, 2025 @ 14:00 UTC
vaults_season_two_yield_collector: noble17m7dleu26hgwk842hrvfmh8mvrtp7p68k4zq8l
- name: forwarding
config:
"@type": noble.forwarding.module.v1.Module
Expand Down
7 changes: 7 additions & 0 deletions e2e/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,13 @@ func modifyGenesisAll(nw *NobleWrapper, setupAllCircleRoles bool) func(cc ibc.Ch
updatedGenesis = append(updatedGenesis, cosmos.NewGenesisKV("app_state.authority.owner", nw.Authority.FormattedAddress()))
}

// Modify the genesis file with the appropriate Dollar Vaults Season One and Two state.
// For v10.1.0, we opt to not set this state as these values were hardcoded in the app wiring!
if cc.Images[0].Version != "v10.1.0" {
updatedGenesis = append(updatedGenesis, cosmos.NewGenesisKV("app_state.dollar.vaults.season_one_ended", true))
updatedGenesis = append(updatedGenesis, cosmos.NewGenesisKV("app_state.dollar.vaults.season_two_yield_collector", nw.Authority.FormattedAddress()))
}

if setupAllCircleRoles {
allFiatTFRoles := []cosmos.GenesisKV{
cosmos.NewGenesisKV("app_state.fiat-tokenfactory.masterMinter", fiattokenfactorytypes.MasterMinter{Address: nw.FiatTfRoles.MasterMinter.FormattedAddress()}),
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
cosmossdk.io/x/evidence v0.1.1
cosmossdk.io/x/feegrant v0.1.1
cosmossdk.io/x/upgrade v0.1.4
dollar.noble.xyz/v2 v2.1.0
dollar.noble.xyz/v2 v2.2.0-rc.0
github.com/bcp-innovations/hyperlane-cosmos v1.0.1
github.com/circlefin/noble-cctp v0.0.0-20241031192117-4285c94ec194
github.com/circlefin/noble-fiattokenfactory v0.0.0-20250123235012-5f9bd9dd2c5b
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -645,8 +645,8 @@ cosmossdk.io/x/tx v0.13.8/go.mod h1:V6DImnwJMTq5qFjeGWpXNiT/fjgE4HtmclRmTqRVM3w=
cosmossdk.io/x/upgrade v0.1.4 h1:/BWJim24QHoXde8Bc64/2BSEB6W4eTydq0X/2f8+g38=
cosmossdk.io/x/upgrade v0.1.4/go.mod h1:9v0Aj+fs97O+Ztw+tG3/tp5JSlrmT7IcFhAebQHmOPo=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
dollar.noble.xyz/v2 v2.1.0 h1:HUHo5aHAps/dxWe5N+0oEk0LbxXO++yCLI1pbuwFKf0=
dollar.noble.xyz/v2 v2.1.0/go.mod h1:ZPbvn4T4hu9aWBIXQVM3VsMUIWKPDNaKRDRVmXXFuGY=
dollar.noble.xyz/v2 v2.2.0-rc.0 h1:winjwoxv1jGELfXM6gR+ljdwh0MblCZyw1/1wG0u574=
dollar.noble.xyz/v2 v2.2.0-rc.0/go.mod h1:ZPbvn4T4hu9aWBIXQVM3VsMUIWKPDNaKRDRVmXXFuGY=
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
gioui.org v0.0.0-20210308172011-57750fc8a0a6/go.mod h1:RSH6KIUZ0p2xy5zHDxgAM4zumjgTw83q2ge/PI+yyw8=
Expand Down
2 changes: 2 additions & 0 deletions local_net/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ update_genesis() {
touch $TEMP && jq '.app_state.bank.denom_metadata += [{ "description": "Hashnote US Yield Coin", "denom_units": [{ "denom": "uusyc", "exponent": 0, "aliases": ["microusyc"] }, { "denom": "usyc", "exponent": 6 }], "base": "uusyc", "display": "usyc", "name": "Hashnote US Yield Coin", "symbol": "USYC" }]' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state.bank.denom_metadata += [{ "description": "Monerium EUR emoney", "denom_units": [{ "denom": "ueure", "exponent": 0, "aliases": ["microeure"] }, { "denom": "eure", "exponent": 6 }], "base": "ueure", "display": "eure", "name": "Monerium EUR emoney", "symbol": "EURe" }]' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state.bank.denom_metadata += [{ "description": "Noble Dollar", "denom_units": [{ "denom": "uusdn", "exponent": 0, "aliases": ["microusdn"] }, { "denom": "usdn", "exponent": 6 }], "base": "uusdn", "display": "usdn", "name": "Noble Dollar", "symbol": "USDN" }]' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state.dollar.vaults.season_one_ended = true' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state.dollar.vaults.season_two_yield_collector = '$AUTHORITY'' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state."fiat-tokenfactory".mintingDenom = { "denom": "uusdc" }' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state."fiat-tokenfactory".paused.paused = false' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
touch $TEMP && jq '.app_state.staking.params.bond_denom = "ustake"' $HOME1/config/genesis.json > $TEMP && mv $TEMP $HOME1/config/genesis.json
Expand Down
48 changes: 48 additions & 0 deletions upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import (
"cosmossdk.io/core/address"
"cosmossdk.io/log"
upgradetypes "cosmossdk.io/x/upgrade/types"
dollarkeeper "dollar.noble.xyz/v2/keeper"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
Expand All @@ -36,6 +38,7 @@ func CreateUpgradeHandler(
addressCodec address.Codec,
authorityKeeper *authoritykeeper.Keeper,
bankKeeper bankkeeper.Keeper,
dollarKeeper *dollarkeeper.Keeper,
) upgradetypes.UpgradeHandler {
return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
vm, err := mm.RunMigrations(ctx, cfg, vm)
Expand All @@ -48,6 +51,11 @@ func CreateUpgradeHandler(
return vm, err
}

err = UpdateVaultsState(ctx, addressCodec, authorityKeeper, dollarKeeper)
if err != nil {
return vm, err
}

logger.Info(UpgradeASCII)

return vm, nil
Expand Down Expand Up @@ -85,3 +93,43 @@ func ClaimDistributionFunds(ctx context.Context, logger log.Logger, addressCodec

return nil
}

// UpdateVaultsState sets state variables around Vaults Season One and Season
// Two. We do this so that we can remove these values from the app.yaml file,
// allowing us to ship one binary for both mainnet and testnet.
func UpdateVaultsState(ctx context.Context, addressCodec address.Codec, authorityKeeper *authoritykeeper.Keeper, dollarKeeper *dollarkeeper.Keeper) error {
switch sdk.UnwrapSDKContext(ctx).ChainID() {
case TestnetChainID:
err := dollarKeeper.VaultsSeasonOneEnded.Set(ctx, true)
if err != nil {
return errors.New("unable to mark vaults season one as ended")
}

authority, err := authorityKeeper.Owner.Get(ctx)
if err != nil {
return errors.New("unable to get underlying authority address from state")
}
authorityBz, err := addressCodec.StringToBytes(authority)
if err != nil {
return errors.New("unable to decode underlying authority address")
}
err = dollarKeeper.VaultsSeasonTwoYieldCollector.Set(ctx, authorityBz)
if err != nil {
return errors.New("unable to set vaults season two yield collector")
}
case MainnetChainID:
// NOTE: Vaults Season One has already been marked as ended on mainnet
// via the v10.1 Ember upgrade, so we safely skip that update here.

yieldCollector, err := addressCodec.StringToBytes("noble17m7dleu26hgwk842hrvfmh8mvrtp7p68k4zq8l")
Comment thread
0xstepit marked this conversation as resolved.
if err != nil {
return errors.New("unable to decode vaults season two yield collector")
}
err = dollarKeeper.VaultsSeasonTwoYieldCollector.Set(ctx, yieldCollector)
if err != nil {
return errors.New("unable to set vaults season two yield collector")
}
}

return nil
}