diff --git a/.github/workflows/e2e-tests.yaml b/.github/workflows/e2e-tests.yaml index 38013f66..7e1442c4 100644 --- a/.github/workflows/e2e-tests.yaml +++ b/.github/workflows/e2e-tests.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Build Docker Image - uses: strangelove-ventures/heighliner-build-action@v1.0.2 + uses: strangelove-ventures/heighliner-build-action@v1.0.3 with: registry: "" # empty registry, image only shared for e2e testing tag: local # emulate local environment for consistency in interchaintest cases diff --git a/app/app.go b/app/app.go index 01bd4f09..1f58df73 100644 --- a/app/app.go +++ b/app/app.go @@ -94,7 +94,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/noble-assets/noble/v6/app/upgrades/krypton" + "github.com/noble-assets/noble/v6/app/upgrades/xenon" "github.com/noble-assets/noble/v6/cmd" "github.com/noble-assets/noble/v6/docs" "github.com/noble-assets/noble/v6/x/globalfee" @@ -116,6 +116,10 @@ import ( "github.com/ondoprotocol/usdy-noble/x/aura" aurakeeper "github.com/ondoprotocol/usdy-noble/x/aura/keeper" auratypes "github.com/ondoprotocol/usdy-noble/x/aura/types" + + "github.com/noble-assets/halo/x/halo" + halokeeper "github.com/noble-assets/halo/x/halo/keeper" + halotypes "github.com/noble-assets/halo/x/halo/types" ) const ( @@ -160,6 +164,7 @@ var ( paramauthorityibc.AppModuleBasic{}, forwarding.AppModuleBasic{}, aura.AppModuleBasic{}, + halo.AppModuleBasic{}, ) // module account permissions @@ -174,6 +179,7 @@ var ( stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, cctptypes.ModuleName: nil, auratypes.ModuleName: {authtypes.Burner, authtypes.Minter}, + halotypes.ModuleName: {authtypes.Burner, authtypes.Minter}, } ) @@ -239,6 +245,7 @@ type App struct { CCTPKeeper *cctpkeeper.Keeper ForwardingKeeper *forwardingkeeper.Keeper AuraKeeper *aurakeeper.Keeper + HaloKeeper *halokeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration @@ -277,7 +284,7 @@ func New( paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey, evidencetypes.StoreKey, ibctransfertypes.StoreKey, icahosttypes.StoreKey, capabilitytypes.StoreKey, tokenfactorymoduletypes.StoreKey, fiattokenfactorymoduletypes.StoreKey, packetforwardtypes.StoreKey, stakingtypes.StoreKey, - cctptypes.StoreKey, forwardingtypes.StoreKey, auratypes.ModuleName, + cctptypes.StoreKey, forwardingtypes.StoreKey, auratypes.ModuleName, halotypes.ModuleName, ) tkeys := sdk.NewTransientStoreKeys( paramstypes.TStoreKey, @@ -340,14 +347,27 @@ func New( "ausdy", nil, ) + + app.HaloKeeper = halokeeper.NewKeeper( + appCodec, + keys[halotypes.ModuleName], + "uusyc", + "uusdc", + app.AccountKeeper, + nil, + ) + app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.GetSubspace(banktypes.ModuleName), app.BlockedModuleAccountAddrs(), - ).WithSendCoinsRestriction(app.AuraKeeper.SendRestrictionFn) + ). + WithSendCoinsRestriction(app.AuraKeeper.SendRestrictionFn). + WithSendCoinsRestriction(app.HaloKeeper.SendRestrictionFn) app.AuraKeeper.SetBankKeeper(app.BankKeeper) + app.HaloKeeper.SetBankKeeper(app.BankKeeper) app.StakingKeeper = stakingkeeper.NewKeeper( appCodec, @@ -564,6 +584,7 @@ func New( cctp.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.CCTPKeeper), forwarding.NewAppModule(app.ForwardingKeeper), aura.NewAppModule(app.AuraKeeper), + halo.NewAppModule(app.HaloKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -597,6 +618,7 @@ func New( cctptypes.ModuleName, forwardingtypes.ModuleName, auratypes.ModuleName, + halotypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -625,6 +647,7 @@ func New( cctptypes.ModuleName, forwardingtypes.ModuleName, auratypes.ModuleName, + halotypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -658,6 +681,7 @@ func New( cctptypes.ModuleName, forwardingtypes.ModuleName, auratypes.ModuleName, + halotypes.ModuleName, // this line is used by starport scaffolding # stargate/app/initGenesis ) @@ -896,11 +920,11 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino func (app *App) setupUpgradeHandlers() { app.UpgradeKeeper.SetUpgradeHandler( - krypton.UpgradeName, - krypton.CreateUpgradeHandler( + xenon.UpgradeName, + xenon.CreateUpgradeHandler( app.mm, app.configurator, - app.AuraKeeper, + app.HaloKeeper, app.BankKeeper, ), ) @@ -916,8 +940,8 @@ func (app *App) setupUpgradeHandlers() { var storeLoader baseapp.StoreLoader switch upgradeInfo.Name { - case krypton.UpgradeName: - storeLoader = krypton.CreateStoreLoader(upgradeInfo.Height) + case xenon.UpgradeName: + storeLoader = xenon.CreateStoreLoader(upgradeInfo.Height) } if storeLoader != nil { diff --git a/app/upgrades/krypton/constants.go b/app/upgrades/xenon/constants.go similarity index 84% rename from app/upgrades/krypton/constants.go rename to app/upgrades/xenon/constants.go index 15bf4ae6..04e1af6d 100644 --- a/app/upgrades/krypton/constants.go +++ b/app/upgrades/xenon/constants.go @@ -1,7 +1,7 @@ -package krypton +package xenon // UpgradeName is the name of this specific software upgrade used on-chain. -const UpgradeName = "krypton" +const UpgradeName = "xenon" // MainnetChainID is the Chain ID of the Noble mainnet. const MainnetChainID = "noble-1" diff --git a/app/upgrades/krypton/store.go b/app/upgrades/xenon/store.go similarity index 75% rename from app/upgrades/krypton/store.go rename to app/upgrades/xenon/store.go index c240a481..5c85e163 100644 --- a/app/upgrades/krypton/store.go +++ b/app/upgrades/xenon/store.go @@ -1,15 +1,15 @@ -package krypton +package xenon import ( "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - auratypes "github.com/ondoprotocol/usdy-noble/x/aura/types" + halotypes "github.com/noble-assets/halo/x/halo/types" ) func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader { storeUpgrades := storetypes.StoreUpgrades{ - Added: []string{auratypes.ModuleName}, + Added: []string{halotypes.ModuleName}, } return upgradetypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades) diff --git a/app/upgrades/krypton/upgrade.go b/app/upgrades/xenon/upgrade.go similarity index 56% rename from app/upgrades/krypton/upgrade.go rename to app/upgrades/xenon/upgrade.go index 88840547..ed33ac63 100644 --- a/app/upgrades/krypton/upgrade.go +++ b/app/upgrades/xenon/upgrade.go @@ -1,4 +1,4 @@ -package krypton +package xenon import ( "fmt" @@ -8,13 +8,13 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - aurakeeper "github.com/ondoprotocol/usdy-noble/x/aura/keeper" + halokeeper "github.com/noble-assets/halo/x/halo/keeper" ) func CreateUpgradeHandler( mm *module.Manager, cfg module.Configurator, - auraKeeper *aurakeeper.Keeper, + haloKeeper *halokeeper.Keeper, bankKeeper bankkeeper.Keeper, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { @@ -25,32 +25,34 @@ func CreateUpgradeHandler( switch ctx.ChainID() { case TestnetChainID: - auraKeeper.SetOwner(ctx, "noble1mxe0zwwdvjvn8dg2hnep55q4fc7sqmpud9qsqn") - auraKeeper.SetBlocklistOwner(ctx, "noble1mxe0zwwdvjvn8dg2hnep55q4fc7sqmpud9qsqn") + haloKeeper.SetOwner(ctx, "noble1u0nahk4wltsp89tpce4cyayd63a69dhpkfq9wq") + haloKeeper.SetAggregatorOwner(ctx, "noble1u0nahk4wltsp89tpce4cyayd63a69dhpkfq9wq") + haloKeeper.SetEntitlementsOwner(ctx, "noble1u0nahk4wltsp89tpce4cyayd63a69dhpkfq9wq") case MainnetChainID: - auraKeeper.SetOwner(ctx, "noble1t6ypyedl6ggvvlgx3cn6jvy9xpr3p2395m2dg5") - auraKeeper.SetBlocklistOwner(ctx, "noble1t6ypyedl6ggvvlgx3cn6jvy9xpr3p2395m2dg5") + haloKeeper.SetOwner(ctx, "") // TODO + haloKeeper.SetAggregatorOwner(ctx, "") // TODO + haloKeeper.SetEntitlementsOwner(ctx, "") // TODO default: return vm, fmt.Errorf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID()) } bankKeeper.SetDenomMetaData(ctx, banktypes.Metadata{ - Description: "Ondo US Dollar Yield", + Description: "Hashnote US Yield Coin", DenomUnits: []*banktypes.DenomUnit{ { - Denom: "ausdy", + Denom: "uusyc", Exponent: 0, - Aliases: []string{"attousdy"}, + Aliases: []string{"microusyc"}, }, { - Denom: "usdy", - Exponent: 18, + Denom: "usyc", + Exponent: 6, }, }, - Base: "ausdy", - Display: "usdy", - Name: "Ondo US Dollar Yield", - Symbol: "USDY", + Base: "uusyc", + Display: "usyc", + Name: "Hashnote US Yield Coin", + Symbol: "USYC", }) return vm, nil diff --git a/go.mod b/go.mod index 1b9205b3..382a20ee 100644 --- a/go.mod +++ b/go.mod @@ -14,6 +14,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/noble-assets/forwarding v1.1.0 + github.com/noble-assets/halo v1.0.0-alpha.0 github.com/ondoprotocol/usdy-noble v1.0.0 github.com/rs/zerolog v1.27.0 github.com/spf13/cast v1.5.1 diff --git a/go.sum b/go.sum index 258a3087..13b1cf0d 100644 --- a/go.sum +++ b/go.sum @@ -965,6 +965,8 @@ github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions h1:oQwbCoejkXp2/oz github.com/noble-assets/cosmos-sdk v0.45.16-send-restrictions/go.mod h1:bScuNwWAP0TZJpUf+SHXRU3xGoUPp+X9nAzfeIXts40= github.com/noble-assets/forwarding v1.1.0 h1:2TXBs2Y9vWqgHyDKtdcHht6i7OT+pLaVHE3bPvfpmJY= github.com/noble-assets/forwarding v1.1.0/go.mod h1:o64ZfzCHteRDhOlkpi7GeKAcjlcbWUihC7Y34Er2/3U= +github.com/noble-assets/halo v1.0.0-alpha.0 h1:i5HBbMVi+GQul/aMxRtfFMfn6B4LKbYj10BFIZ0C3u8= +github.com/noble-assets/halo v1.0.0-alpha.0/go.mod h1:zWcppKjRH5v0ZTRXPtxEhoO1XRFE7wi5GhxtnGeFy6I= github.com/nunnatsa/ginkgolinter v0.14.0 h1:XQPNmw+kZz5cC/HbFK3mQutpjzAQv1dHregRA+4CGGg= github.com/nunnatsa/ginkgolinter v0.14.0/go.mod h1:cm2xaqCUCRd7qcP4DqbVvpcyEMkuLM9CF0wY6VASohk= github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= diff --git a/interchaintest/upgrade_grand-1_test.go b/interchaintest/upgrade_grand-1_test.go index a2b7cc82..9619b2e8 100644 --- a/interchaintest/upgrade_grand-1_test.go +++ b/interchaintest/upgrade_grand-1_test.go @@ -148,6 +148,11 @@ func TestGrand1ChainUpgrade(t *testing.T) { { // krypton is a major release that introduced the aura module. upgradeName: "krypton", + image: ghcrImage("v5.0.0-rc.0"), + }, + { + // xenon is a major release that introduced the halo module. + upgradeName: "xenon", image: nobleImageInfo[0], }, } diff --git a/interchaintest/upgrade_noble-1_test.go b/interchaintest/upgrade_noble-1_test.go index 29c44cdd..9332b08a 100644 --- a/interchaintest/upgrade_noble-1_test.go +++ b/interchaintest/upgrade_noble-1_test.go @@ -135,6 +135,11 @@ func TestNoble1ChainUpgrade(t *testing.T) { { // krypton is a major release that introduced the aura module. upgradeName: "krypton", + image: ghcrImage("v5.0.0"), + }, + { + // xenon is a major release that introduced the halo module. + upgradeName: "xenon", image: nobleImageInfo[0], }, }