diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 61d31397..ab41619a 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -2,6 +2,8 @@ package keepers import ( "fmt" + "github.com/cosmos/cosmos-sdk/x/nft" + nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" tokenfactorykeeper "github.com/cybercongress/go-cyber/v4/x/tokenfactory/keeper" tokenfactorytypes "github.com/cybercongress/go-cyber/v4/x/tokenfactory/types" "path/filepath" @@ -105,6 +107,7 @@ var maccPerms = map[string][]string{ stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, + nft.ModuleName: nil, ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, ibcfeetypes.ModuleName: nil, wasmtypes.ModuleName: {authtypes.Burner}, @@ -137,6 +140,7 @@ type AppKeepers struct { EvidenceKeeper evidencekeeper.Keeper TransferKeeper ibctransferkeeper.Keeper FeeGrantKeeper feegrantkeeper.Keeper + NFTKeeper nftkeeper.Keeper AuthzKeeper authzkeeper.Keeper ConsensusParamsKeeper consensusparamkeeper.Keeper @@ -422,6 +426,9 @@ func NewAppKeepers( govtypes.DefaultConfig(), govModAddress, ) + + appKeepers.NFTKeeper = nftkeeper.NewKeeper(keys[nftkeeper.StoreKey], appCodec, appKeepers.AccountKeeper, appKeepers.CyberbankKeeper.Proxy) + appKeepers.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( // register governance hooks diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 60a9034f..d3003529 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -15,6 +15,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/feegrant" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + nftkeeper "github.com/cosmos/cosmos-sdk/x/nft/keeper" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -41,7 +42,7 @@ func (appKeepers *AppKeepers) GenerateKeys() { minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey, govtypes.StoreKey, paramstypes.StoreKey, upgradetypes.StoreKey, evidencetypes.StoreKey, capabilitytypes.StoreKey, - authzkeeper.StoreKey, feegrant.StoreKey, + authzkeeper.StoreKey, feegrant.StoreKey, nftkeeper.StoreKey, consensusparamtypes.StoreKey, crisistypes.StoreKey, ibcexported.StoreKey, diff --git a/app/modules.go b/app/modules.go index 6a24809b..70bf695d 100644 --- a/app/modules.go +++ b/app/modules.go @@ -31,6 +31,8 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/cosmos-sdk/x/mint" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + "github.com/cosmos/cosmos-sdk/x/nft" + nftmodule "github.com/cosmos/cosmos-sdk/x/nft/module" sdkparams "github.com/cosmos/cosmos-sdk/x/params" paramstypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/slashing" @@ -93,6 +95,7 @@ var ModuleBasics = module.NewBasicManager( authzmodule.AppModuleBasic{}, feegrantmodule.AppModuleBasic{}, vesting.AppModuleBasic{}, + nftmodule.AppModuleBasic{}, ibc.AppModuleBasic{}, ibcfee.AppModuleBasic{}, transfer.AppModuleBasic{}, @@ -140,6 +143,7 @@ func appModules( ibc.NewAppModule(app.IBCKeeper), sdkparams.NewAppModule(app.ParamsKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.CyberbankKeeper.Proxy, app.interfaceRegistry), + nftmodule.NewAppModule(appCodec, app.AppKeepers.NFTKeeper, app.AppKeepers.AccountKeeper, app.CyberbankKeeper.Proxy, app.interfaceRegistry), transfer.NewAppModule(app.TransferKeeper), ibcfee.NewAppModule(app.IBCFeeKeeper), crisis.NewAppModule(app.AppKeepers.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)), @@ -199,31 +203,33 @@ func orderBeginBlockers() []string { // upgrades should be run first upgradetypes.ModuleName, capabilitytypes.ModuleName, - stakingtypes.ModuleName, - liquiditytypes.ModuleName, + minttypes.ModuleName, distrtypes.ModuleName, slashingtypes.ModuleName, - minttypes.ModuleName, evidencetypes.ModuleName, - dmntypes.ModuleName, - consensusparamtypes.ModuleName, + stakingtypes.ModuleName, authtypes.ModuleName, - authz.ModuleName, banktypes.ModuleName, - bandwidthtypes.ModuleName, + govtypes.ModuleName, crisistypes.ModuleName, - cyberbanktypes.ModuleName, - feegrant.ModuleName, genutiltypes.ModuleName, - govtypes.ModuleName, + authz.ModuleName, + feegrant.ModuleName, + paramstypes.ModuleName, + vestingtypes.ModuleName, + nft.ModuleName, + consensusparamtypes.ModuleName, + // additional modules + liquiditytypes.ModuleName, + dmntypes.ModuleName, + bandwidthtypes.ModuleName, + cyberbanktypes.ModuleName, graphtypes.ModuleName, gridtypes.ModuleName, ibctransfertypes.ModuleName, ibcexported.ModuleName, - paramstypes.ModuleName, ranktypes.ModuleName, resourcestypes.ModuleName, - vestingtypes.ModuleName, ibcfeetypes.ModuleName, tokenfactorytypes.ModuleName, wasm.ModuleName, @@ -235,33 +241,35 @@ func orderEndBlockers() []string { crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, - liquiditytypes.ModuleName, - cyberbanktypes.ModuleName, - bandwidthtypes.ModuleName, - graphtypes.ModuleName, - ranktypes.ModuleName, - consensusparamtypes.ModuleName, + capabilitytypes.ModuleName, authtypes.ModuleName, - authz.ModuleName, banktypes.ModuleName, - capabilitytypes.ModuleName, distrtypes.ModuleName, - dmntypes.ModuleName, + slashingtypes.ModuleName, + minttypes.ModuleName, + genutiltypes.ModuleName, evidencetypes.ModuleName, + authz.ModuleName, feegrant.ModuleName, - genutiltypes.ModuleName, - gridtypes.ModuleName, - ibcexported.ModuleName, - ibctransfertypes.ModuleName, - minttypes.ModuleName, paramstypes.ModuleName, - resourcestypes.ModuleName, - slashingtypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, + nft.ModuleName, + consensusparamtypes.ModuleName, + // additional modules + ibctransfertypes.ModuleName, + ibcexported.ModuleName, ibcfeetypes.ModuleName, tokenfactorytypes.ModuleName, + graphtypes.ModuleName, + dmntypes.ModuleName, + gridtypes.ModuleName, + resourcestypes.ModuleName, + liquiditytypes.ModuleName, wasm.ModuleName, + cyberbanktypes.ModuleName, + bandwidthtypes.ModuleName, + ranktypes.ModuleName, } } @@ -283,6 +291,7 @@ func orderInitBlockers() []string { upgradetypes.ModuleName, vestingtypes.ModuleName, feegrant.ModuleName, + nft.ModuleName, consensusparamtypes.ModuleName, // additional modules ibctransfertypes.ModuleName, diff --git a/app/upgrades/v4/constants.go b/app/upgrades/v4/constants.go index ce892d4b..0bda4971 100644 --- a/app/upgrades/v4/constants.go +++ b/app/upgrades/v4/constants.go @@ -4,6 +4,7 @@ import ( store "github.com/cosmos/cosmos-sdk/store/types" consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types" crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types" + "github.com/cosmos/cosmos-sdk/x/nft" tokenfactorytypes "github.com/cybercongress/go-cyber/v4/x/tokenfactory/types" resourcestypes "github.com/cybercongress/go-cyber/v4/x/resources/types" @@ -22,6 +23,7 @@ var Upgrade = upgrades.Upgrade{ consensustypes.ModuleName, resourcestypes.ModuleName, tokenfactorytypes.ModuleName, + nft.ModuleName, }, }, }