-
Notifications
You must be signed in to change notification settings - Fork 204
/
app.go
1328 lines (1206 loc) · 52.7 KB
/
app.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package app
import (
"fmt"
"io"
"os"
"path/filepath"
"github.com/CosmWasm/wasmd/x/wasm"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/Stride-Labs/ibc-rate-limiting/ratelimit"
ratelimitkeeper "github.com/Stride-Labs/ibc-rate-limiting/ratelimit/keeper"
ratelimittypes "github.com/Stride-Labs/ibc-rate-limiting/ratelimit/types"
dbm "github.com/cometbft/cometbft-db"
abci "github.com/cometbft/cometbft/abci/types"
tmjson "github.com/cometbft/cometbft/libs/json"
"github.com/cometbft/cometbft/libs/log"
tmos "github.com/cometbft/cometbft/libs/os"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/server/api"
"github.com/cosmos/cosmos-sdk/server/config"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
storetypes "github.com/cosmos/cosmos-sdk/store/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/x/auth"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
authsims "github.com/cosmos/cosmos-sdk/x/auth/simulation"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
vestingtypes "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/bank"
bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
"github.com/cosmos/cosmos-sdk/x/capability"
capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
consensus "github.com/cosmos/cosmos-sdk/x/consensus"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
"github.com/cosmos/cosmos-sdk/x/crisis"
crisiskeeper "github.com/cosmos/cosmos-sdk/x/crisis/keeper"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"
"github.com/cosmos/cosmos-sdk/x/evidence"
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
"github.com/cosmos/cosmos-sdk/x/feegrant"
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govtypesv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
"github.com/cosmos/cosmos-sdk/x/params"
distrclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal"
"github.com/cosmos/cosmos-sdk/x/slashing"
slashingkeeper "github.com/cosmos/cosmos-sdk/x/slashing/keeper"
slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
"github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward"
packetforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/keeper"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
ibchooks "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7"
ibchookskeeper "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/keeper"
ibchookstypes "github.com/cosmos/ibc-apps/modules/ibc-hooks/v7/types"
ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts"
icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller"
icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper"
icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types"
icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host"
icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper"
icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types"
icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types"
"github.com/cosmos/ibc-go/v7/modules/apps/transfer"
ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper"
ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibc "github.com/cosmos/ibc-go/v7/modules/core"
ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client"
ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client"
ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
ibchost "github.com/cosmos/ibc-go/v7/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tendermint "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibctesting "github.com/cosmos/ibc-go/v7/testing"
ibctestingtypes "github.com/cosmos/ibc-go/v7/testing/types"
ccvconsumer "github.com/cosmos/interchain-security/v4/x/ccv/consumer"
ccvconsumerkeeper "github.com/cosmos/interchain-security/v4/x/ccv/consumer/keeper"
ccvconsumertypes "github.com/cosmos/interchain-security/v4/x/ccv/consumer/types"
ccvdistr "github.com/cosmos/interchain-security/v4/x/ccv/democracy/distribution"
ccvgov "github.com/cosmos/interchain-security/v4/x/ccv/democracy/governance"
ccvstaking "github.com/cosmos/interchain-security/v4/x/ccv/democracy/staking"
evmosvesting "github.com/evmos/vesting/x/vesting"
evmosvestingclient "github.com/evmos/vesting/x/vesting/client"
evmosvestingkeeper "github.com/evmos/vesting/x/vesting/keeper"
evmosvestingtypes "github.com/evmos/vesting/x/vesting/types"
"github.com/spf13/cast"
"github.com/Stride-Labs/stride/v22/utils"
"github.com/Stride-Labs/stride/v22/x/autopilot"
autopilotkeeper "github.com/Stride-Labs/stride/v22/x/autopilot/keeper"
autopilottypes "github.com/Stride-Labs/stride/v22/x/autopilot/types"
"github.com/Stride-Labs/stride/v22/x/claim"
claimkeeper "github.com/Stride-Labs/stride/v22/x/claim/keeper"
claimtypes "github.com/Stride-Labs/stride/v22/x/claim/types"
claimvesting "github.com/Stride-Labs/stride/v22/x/claim/vesting"
claimvestingtypes "github.com/Stride-Labs/stride/v22/x/claim/vesting/types"
epochsmodule "github.com/Stride-Labs/stride/v22/x/epochs"
epochsmodulekeeper "github.com/Stride-Labs/stride/v22/x/epochs/keeper"
epochsmoduletypes "github.com/Stride-Labs/stride/v22/x/epochs/types"
icacallbacksmodule "github.com/Stride-Labs/stride/v22/x/icacallbacks"
icacallbacksmodulekeeper "github.com/Stride-Labs/stride/v22/x/icacallbacks/keeper"
icacallbacksmoduletypes "github.com/Stride-Labs/stride/v22/x/icacallbacks/types"
icaoracle "github.com/Stride-Labs/stride/v22/x/icaoracle"
icaoraclekeeper "github.com/Stride-Labs/stride/v22/x/icaoracle/keeper"
icaoracletypes "github.com/Stride-Labs/stride/v22/x/icaoracle/types"
"github.com/Stride-Labs/stride/v22/x/interchainquery"
interchainquerykeeper "github.com/Stride-Labs/stride/v22/x/interchainquery/keeper"
interchainquerytypes "github.com/Stride-Labs/stride/v22/x/interchainquery/types"
"github.com/Stride-Labs/stride/v22/x/mint"
mintkeeper "github.com/Stride-Labs/stride/v22/x/mint/keeper"
minttypes "github.com/Stride-Labs/stride/v22/x/mint/types"
recordsmodule "github.com/Stride-Labs/stride/v22/x/records"
recordsmodulekeeper "github.com/Stride-Labs/stride/v22/x/records/keeper"
recordsmoduletypes "github.com/Stride-Labs/stride/v22/x/records/types"
stakedym "github.com/Stride-Labs/stride/v22/x/stakedym"
stakedymkeeper "github.com/Stride-Labs/stride/v22/x/stakedym/keeper"
stakedymtypes "github.com/Stride-Labs/stride/v22/x/stakedym/types"
stakeibcmodule "github.com/Stride-Labs/stride/v22/x/stakeibc"
stakeibcclient "github.com/Stride-Labs/stride/v22/x/stakeibc/client"
stakeibcmodulekeeper "github.com/Stride-Labs/stride/v22/x/stakeibc/keeper"
stakeibcmoduletypes "github.com/Stride-Labs/stride/v22/x/stakeibc/types"
staketia "github.com/Stride-Labs/stride/v22/x/staketia"
staketiakeeper "github.com/Stride-Labs/stride/v22/x/staketia/keeper"
staketiatypes "github.com/Stride-Labs/stride/v22/x/staketia/types"
)
const (
AccountAddressPrefix = "stride"
Name = "stride"
)
func getGovProposalHandlers() []govclient.ProposalHandler {
var govProposalHandlers []govclient.ProposalHandler
govProposalHandlers = append(govProposalHandlers,
paramsclient.ProposalHandler,
distrclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
ibcclientclient.UpdateClientProposalHandler,
ibcclientclient.UpgradeProposalHandler,
stakeibcclient.AddValidatorsProposalHandler,
stakeibcclient.ToggleLSMProposalHandler,
evmosvestingclient.RegisterClawbackProposalHandler,
)
return govProposalHandlers
}
var (
// DefaultNodeHome default home directories for the application daemon
DefaultNodeHome string
// ModuleBasics defines the module BasicManager is in charge of setting up basic,
// non-dependant module elements, such as codec registration
// and genesis verification.
ModuleBasics = module.NewBasicManager(
auth.AppModuleBasic{},
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
bank.AppModuleBasic{},
capability.AppModuleBasic{},
ccvstaking.AppModuleBasic{},
mint.AppModuleBasic{},
ccvdistr.AppModuleBasic{},
gov.NewAppModuleBasic(getGovProposalHandlers()),
params.AppModuleBasic{},
crisis.AppModuleBasic{},
slashing.AppModuleBasic{},
feegrantmodule.AppModuleBasic{},
ibc.AppModuleBasic{},
upgrade.AppModuleBasic{},
evidence.AppModuleBasic{},
transfer.AppModuleBasic{},
consensus.AppModuleBasic{},
vesting.AppModuleBasic{},
claimvesting.AppModuleBasic{},
stakeibcmodule.AppModuleBasic{},
epochsmodule.AppModuleBasic{},
interchainquery.AppModuleBasic{},
ica.AppModuleBasic{},
recordsmodule.AppModuleBasic{},
ratelimit.AppModuleBasic{},
icacallbacksmodule.AppModuleBasic{},
claim.AppModuleBasic{},
ccvconsumer.AppModuleBasic{},
autopilot.AppModuleBasic{},
icaoracle.AppModuleBasic{},
tendermint.AppModuleBasic{},
packetforward.AppModuleBasic{},
evmosvesting.AppModuleBasic{},
staketia.AppModuleBasic{},
stakedym.AppModuleBasic{},
wasm.AppModuleBasic{},
ibchooks.AppModuleBasic{},
)
// module account permissions
maccPerms = map[string][]string{
authtypes.FeeCollectorName: nil,
distrtypes.ModuleName: nil,
// mint module needs burn access to remove excess validator tokens (it overallocates, then burns)
ccvconsumertypes.ConsumerRedistributeName: nil,
ccvconsumertypes.ConsumerToSendToProviderName: nil,
minttypes.ModuleName: {authtypes.Minter, authtypes.Burner},
stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking},
stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking},
govtypes.ModuleName: {authtypes.Burner},
ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner},
stakeibcmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
claimtypes.ModuleName: nil,
interchainquerytypes.ModuleName: nil,
icatypes.ModuleName: nil,
stakeibcmoduletypes.RewardCollectorName: nil,
staketiatypes.ModuleName: {authtypes.Minter, authtypes.Burner},
staketiatypes.FeeAddress: nil,
stakedymtypes.ModuleName: {authtypes.Minter, authtypes.Burner},
stakedymtypes.FeeAddress: nil,
wasmtypes.ModuleName: {authtypes.Burner},
}
)
var (
_ servertypes.Application = (*StrideApp)(nil)
_ ibctesting.TestingApp = (*StrideApp)(nil)
)
func init() {
userHomeDir, err := os.UserHomeDir()
if err != nil {
panic(err)
}
DefaultNodeHome = filepath.Join(userHomeDir, "."+Name)
}
// StrideApp extends an ABCI application, but with most of its parameters exported.
// They are exported for convenience in creating helper functions, as object
// capabilities aren't needed for testing.
type StrideApp struct {
*baseapp.BaseApp
cdc *codec.LegacyAmino
appCodec codec.Codec
interfaceRegistry types.InterfaceRegistry
invCheckPeriod uint
// keys to access the substores
keys map[string]*storetypes.KVStoreKey
tkeys map[string]*storetypes.TransientStoreKey
memKeys map[string]*storetypes.MemoryStoreKey
// keepers
VestingKeeper evmosvestingkeeper.Keeper
AccountKeeper authkeeper.AccountKeeper
BankKeeper bankkeeper.Keeper
CapabilityKeeper *capabilitykeeper.Keeper
StakingKeeper stakingkeeper.Keeper
SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
DistrKeeper distrkeeper.Keeper
GovKeeper govkeeper.Keeper
ConsensusParamsKeeper consensusparamkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
ParamsKeeper paramskeeper.Keeper
IBCKeeper *ibckeeper.Keeper // IBC Keeper must be a pointer in the app, so we can SetRouter on it correctly
EvidenceKeeper evidencekeeper.Keeper
TransferKeeper ibctransferkeeper.Keeper
FeeGrantKeeper feegrantkeeper.Keeper
ICAControllerKeeper icacontrollerkeeper.Keeper
ICAHostKeeper icahostkeeper.Keeper
ConsumerKeeper ccvconsumerkeeper.Keeper
AutopilotKeeper autopilotkeeper.Keeper
PacketForwardKeeper *packetforwardkeeper.Keeper
WasmKeeper wasmkeeper.Keeper
ContractKeeper *wasmkeeper.PermissionedKeeper
IBCHooksKeeper ibchookskeeper.Keeper
// Middleware for IBCHooks
Ics20WasmHooks *ibchooks.WasmHooks
HooksICS4Wrapper ibchooks.ICS4Middleware
// make scoped keepers public for test purposes
ScopedIBCKeeper capabilitykeeper.ScopedKeeper
ScopedTransferKeeper capabilitykeeper.ScopedKeeper
ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedCCVConsumerKeeper capabilitykeeper.ScopedKeeper
ScopedWasmKeeper capabilitykeeper.ScopedKeeper
StakeibcKeeper stakeibcmodulekeeper.Keeper
EpochsKeeper epochsmodulekeeper.Keeper
InterchainqueryKeeper interchainquerykeeper.Keeper
ScopedRecordsKeeper capabilitykeeper.ScopedKeeper
RecordsKeeper recordsmodulekeeper.Keeper
IcacallbacksKeeper icacallbacksmodulekeeper.Keeper
ScopedratelimitKeeper capabilitykeeper.ScopedKeeper
RatelimitKeeper ratelimitkeeper.Keeper
ClaimKeeper claimkeeper.Keeper
ICAOracleKeeper icaoraclekeeper.Keeper
StaketiaKeeper staketiakeeper.Keeper
StakedymKeeper stakedymkeeper.Keeper
mm *module.Manager
sm *module.SimulationManager
configurator module.Configurator
}
// RUN GOSEC
// New returns a reference to an initialized blockchain app
func NewStrideApp(
logger log.Logger,
db dbm.DB,
traceStore io.Writer,
loadLatest bool,
skipUpgradeHeights map[int64]bool,
homePath string,
invCheckPeriod uint,
encodingConfig EncodingConfig,
appOpts servertypes.AppOptions,
wasmOpts []wasmkeeper.Option,
baseAppOptions ...func(*baseapp.BaseApp),
) *StrideApp {
appCodec := encodingConfig.Marshaler
cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry
bApp := baseapp.NewBaseApp(Name, logger, db, encodingConfig.TxConfig.TxDecoder(), baseAppOptions...)
bApp.SetCommitMultiStoreTracer(traceStore)
bApp.SetVersion(version.Version)
bApp.SetInterfaceRegistry(interfaceRegistry)
keys := sdk.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey,
minttypes.StoreKey, distrtypes.StoreKey, slashingtypes.StoreKey,
govtypes.StoreKey, paramstypes.StoreKey, ibchost.StoreKey, upgradetypes.StoreKey, feegrant.StoreKey,
evidencetypes.StoreKey, ibctransfertypes.StoreKey, capabilitytypes.StoreKey, // monitoringptypes.StoreKey,
stakeibcmoduletypes.StoreKey,
autopilottypes.StoreKey,
epochsmoduletypes.StoreKey,
interchainquerytypes.StoreKey,
icacontrollertypes.StoreKey, icahosttypes.StoreKey,
recordsmoduletypes.StoreKey,
ratelimittypes.StoreKey,
icacallbacksmoduletypes.StoreKey,
claimtypes.StoreKey,
icaoracletypes.StoreKey,
ccvconsumertypes.StoreKey,
crisistypes.StoreKey,
consensusparamtypes.StoreKey,
packetforwardtypes.StoreKey,
evmosvestingtypes.StoreKey,
staketiatypes.StoreKey,
stakedymtypes.StoreKey,
wasmtypes.StoreKey,
ibchookstypes.StoreKey,
)
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
app := &StrideApp{
BaseApp: bApp,
cdc: cdc,
appCodec: appCodec,
interfaceRegistry: interfaceRegistry,
invCheckPeriod: invCheckPeriod,
keys: keys,
tkeys: tkeys,
memKeys: memKeys,
}
// TODO: Remove ParamsKeeper after v10 upgrade
app.ParamsKeeper = initParamsKeeper(appCodec, cdc, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey])
// set the BaseApp's parameter store
app.ConsensusParamsKeeper = consensusparamkeeper.NewKeeper(
appCodec,
keys[consensusparamtypes.StoreKey],
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
bApp.SetParamStore(&app.ConsensusParamsKeeper)
// add capability keeper and ScopeToModule for ibc module
app.CapabilityKeeper = capabilitykeeper.NewKeeper(appCodec, keys[capabilitytypes.StoreKey], memKeys[capabilitytypes.MemStoreKey])
// grant capabilities for the ibc and ibc-transfer modules
scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(ibchost.ModuleName)
scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName)
scopedICAControllerKeeper := app.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName)
scopedICAHostKeeper := app.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName)
scopedCCVConsumerKeeper := app.CapabilityKeeper.ScopeToModule(ccvconsumertypes.ModuleName)
// add keepers
app.AccountKeeper = authkeeper.NewAccountKeeper(
appCodec, keys[authtypes.StoreKey], authtypes.ProtoBaseAccount, maccPerms, AccountAddressPrefix, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.BankKeeper = bankkeeper.NewBaseKeeper(
appCodec, keys[banktypes.StoreKey], app.AccountKeeper, app.BlacklistedModuleAccountAddrs(), authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.StakingKeeper = *stakingkeeper.NewKeeper(
appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
epochsKeeper := epochsmodulekeeper.NewKeeper(appCodec, keys[epochsmoduletypes.StoreKey])
app.MintKeeper = mintkeeper.NewKeeper(
appCodec, keys[minttypes.StoreKey], app.GetSubspace(minttypes.ModuleName), app.AccountKeeper, app.BankKeeper, app.DistrKeeper, app.EpochsKeeper, authtypes.FeeCollectorName,
)
app.DistrKeeper = distrkeeper.NewKeeper(
appCodec, keys[distrtypes.StoreKey], app.AccountKeeper, app.BankKeeper,
app.StakingKeeper, ccvconsumertypes.ConsumerRedistributeName, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.SlashingKeeper = slashingkeeper.NewKeeper(
appCodec, encodingConfig.Amino, keys[slashingtypes.StoreKey], &app.ConsumerKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.CrisisKeeper = crisiskeeper.NewKeeper(appCodec, keys[crisistypes.StoreKey],
invCheckPeriod, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
app.ClaimKeeper = *claimkeeper.NewKeeper(
appCodec,
keys[claimtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper, app.StakingKeeper, app.DistrKeeper, epochsKeeper)
app.FeeGrantKeeper = feegrantkeeper.NewKeeper(appCodec, keys[feegrant.StoreKey], app.AccountKeeper)
app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetypes.StoreKey], appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())
// register the staking hooks
// NOTE: stakingKeeper above is passed by reference, so that it will contain these hooks
app.StakingKeeper.SetHooks(
stakingtypes.NewMultiStakingHooks(app.DistrKeeper.Hooks(), app.ClaimKeeper.Hooks()),
)
// Add ICS Consumer Keeper
app.ConsumerKeeper = ccvconsumerkeeper.NewNonZeroKeeper(
appCodec,
keys[ccvconsumertypes.StoreKey],
app.GetSubspace(ccvconsumertypes.ModuleName),
)
// Create IBC Keeper
app.IBCKeeper = ibckeeper.NewKeeper(
appCodec,
keys[ibchost.StoreKey],
app.GetSubspace(ibchost.ModuleName),
&app.ConsumerKeeper,
app.UpgradeKeeper,
scopedIBCKeeper,
)
// Create IBC Hooks Keeper (must be defined after the wasmKeeper is created)
app.IBCHooksKeeper = ibchookskeeper.NewKeeper(
keys[ibchookstypes.StoreKey],
)
wasmHooks := ibchooks.NewWasmHooks(&app.IBCHooksKeeper, nil, AccountAddressPrefix) // the contract keeper is set later
app.Ics20WasmHooks = &wasmHooks
app.Ics20WasmHooks.ContractKeeper = &app.WasmKeeper // wasm keeper initialized below
// Create Ratelimit Keeper
scopedratelimitKeeper := app.CapabilityKeeper.ScopeToModule(ratelimittypes.ModuleName)
app.ScopedratelimitKeeper = scopedratelimitKeeper
app.RatelimitKeeper = *ratelimitkeeper.NewKeeper(
appCodec,
keys[ratelimittypes.StoreKey],
app.GetSubspace(ratelimittypes.ModuleName),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.BankKeeper,
app.IBCKeeper.ChannelKeeper,
app.IBCKeeper.ChannelKeeper, // ICS4Wrapper
)
ratelimitModule := ratelimit.NewAppModule(appCodec, app.RatelimitKeeper)
// Create the ICS4 wrapper which routes up the stack from ibchooks -> ratelimit
// (see full stack definition below)
app.HooksICS4Wrapper = ibchooks.NewICS4Middleware(
app.RatelimitKeeper, // ICS4Wrapper
app.Ics20WasmHooks,
)
// Initialize the packet forward middleware Keeper
// It's important to note that the PFM Keeper must be initialized before the Transfer Keeper
app.PacketForwardKeeper = packetforwardkeeper.NewKeeper(
appCodec,
keys[packetforwardtypes.StoreKey],
nil, // will be zero-value here, reference is set later on with SetTransferKeeper.
app.IBCKeeper.ChannelKeeper,
app.DistrKeeper,
app.BankKeeper,
app.HooksICS4Wrapper, // ICS4Wrapper
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
// Create Transfer Keepers
app.TransferKeeper = ibctransferkeeper.NewKeeper(
appCodec, keys[ibctransfertypes.StoreKey],
app.GetSubspace(ibctransfertypes.ModuleName),
app.PacketForwardKeeper, // ICS4Wrapper
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
app.BankKeeper,
scopedTransferKeeper,
)
// Set the TransferKeeper reference in the PacketForwardKeeper
app.PacketForwardKeeper.SetTransferKeeper(app.TransferKeeper)
// Add wasm keeper (must be after IBCKeeper and TransferKeeper)
wasmCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,cosmwasm_1_3,cosmwasm_1_4"
wasmDir := filepath.Join(homePath, "wasm")
wasmConfig, err := wasm.ReadWasmConfig(appOpts)
if err != nil {
panic(fmt.Sprintf("error while reading wasm config: %s", err))
}
scopedWasmKeeper := app.CapabilityKeeper.ScopeToModule(wasmtypes.ModuleName)
app.WasmKeeper = wasmkeeper.NewKeeper(
appCodec,
keys[wasmtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.StakingKeeper,
distrkeeper.NewQuerier(app.DistrKeeper),
app.IBCKeeper.ChannelKeeper, // ICS4Wrapper
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
scopedWasmKeeper,
app.TransferKeeper,
app.MsgServiceRouter(),
app.GRPCQueryRouter(),
wasmDir,
wasmConfig,
wasmCapabilities,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
wasmOpts...,
)
app.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(app.WasmKeeper)
// Create evidence Keeper for to register the IBC light client misbehaviour evidence route
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, keys[evidencetypes.StoreKey], &app.ConsumerKeeper, app.SlashingKeeper,
)
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper
// Create CCV consumer and modules
app.ConsumerKeeper = ccvconsumerkeeper.NewKeeper(
appCodec,
keys[ccvconsumertypes.StoreKey],
app.GetSubspace(ccvconsumertypes.ModuleName),
scopedCCVConsumerKeeper,
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.IBCKeeper.ConnectionKeeper,
app.IBCKeeper.ClientKeeper,
app.SlashingKeeper,
app.BankKeeper,
app.AccountKeeper,
&app.TransferKeeper,
app.IBCKeeper,
authtypes.FeeCollectorName,
)
app.ConsumerKeeper.SetStandaloneStakingKeeper(app.StakingKeeper)
// register slashing module StakingHooks to the consumer keeper
app.ConsumerKeeper = *app.ConsumerKeeper.SetHooks(app.SlashingKeeper.Hooks())
consumerModule := ccvconsumer.NewAppModule(app.ConsumerKeeper, app.GetSubspace(ccvconsumertypes.ModuleName))
// Note: must be above app.StakeibcKeeper and app.ICAOracleKeeper
app.ICAControllerKeeper = icacontrollerkeeper.NewKeeper(
appCodec, keys[icacontrollertypes.StoreKey], app.GetSubspace(icacontrollertypes.SubModuleName),
app.IBCKeeper.ChannelKeeper, // may be replaced with middleware such as ics29 fee
app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper,
scopedICAControllerKeeper, app.MsgServiceRouter(),
)
app.IcacallbacksKeeper = *icacallbacksmodulekeeper.NewKeeper(
appCodec,
keys[icacallbacksmoduletypes.StoreKey],
keys[icacallbacksmoduletypes.MemStoreKey],
app.GetSubspace(icacallbacksmoduletypes.ModuleName),
*app.IBCKeeper,
)
app.InterchainqueryKeeper = interchainquerykeeper.NewKeeper(appCodec, keys[interchainquerytypes.StoreKey], app.IBCKeeper)
interchainQueryModule := interchainquery.NewAppModule(appCodec, app.InterchainqueryKeeper)
app.RecordsKeeper = *recordsmodulekeeper.NewKeeper(
appCodec,
keys[recordsmoduletypes.StoreKey],
keys[recordsmoduletypes.MemStoreKey],
app.GetSubspace(recordsmoduletypes.ModuleName),
app.AccountKeeper,
app.TransferKeeper,
*app.IBCKeeper,
app.IcacallbacksKeeper,
)
recordsModule := recordsmodule.NewAppModule(appCodec, app.RecordsKeeper, app.AccountKeeper, app.BankKeeper)
// Note: Must be above stakeibc keeper
app.ICAOracleKeeper = *icaoraclekeeper.NewKeeper(
appCodec,
keys[icaoracletypes.StoreKey],
app.GetSubspace(icaoracletypes.ModuleName),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.IBCKeeper.ChannelKeeper, // ICS4Wrapper - Note: this technically should be ICAController but it doesn't implement ICS4
app.IBCKeeper.ClientKeeper,
app.IBCKeeper.ConnectionKeeper,
app.IBCKeeper.ChannelKeeper,
app.ICAControllerKeeper,
app.IcacallbacksKeeper,
)
icaoracleModule := icaoracle.NewAppModule(appCodec, app.ICAOracleKeeper)
stakeibcKeeper := stakeibcmodulekeeper.NewKeeper(
appCodec,
keys[stakeibcmoduletypes.StoreKey],
keys[stakeibcmoduletypes.MemStoreKey],
app.GetSubspace(stakeibcmoduletypes.ModuleName),
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.AccountKeeper,
app.BankKeeper,
app.ICAControllerKeeper,
*app.IBCKeeper,
app.InterchainqueryKeeper,
app.RecordsKeeper,
app.StakingKeeper,
app.IcacallbacksKeeper,
app.RatelimitKeeper,
app.ICAOracleKeeper,
app.ConsumerKeeper,
)
app.StakeibcKeeper = *stakeibcKeeper.SetHooks(
stakeibcmoduletypes.NewMultiStakeIBCHooks(app.ClaimKeeper.Hooks()),
)
stakeibcModule := stakeibcmodule.NewAppModule(appCodec, app.StakeibcKeeper, app.AccountKeeper, app.BankKeeper)
app.AutopilotKeeper = *autopilotkeeper.NewKeeper(
appCodec,
keys[autopilottypes.StoreKey],
app.GetSubspace(autopilottypes.ModuleName),
app.BankKeeper,
app.StakeibcKeeper,
app.ClaimKeeper,
app.TransferKeeper,
)
autopilotModule := autopilot.NewAppModule(appCodec, app.AutopilotKeeper)
// Staketia Keeper must be initialized after TransferKeeper
app.StaketiaKeeper = *staketiakeeper.NewKeeper(
appCodec,
keys[staketiatypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.ICAOracleKeeper,
app.RatelimitKeeper,
app.TransferKeeper,
)
stakeTiaModule := staketia.NewAppModule(appCodec, app.StaketiaKeeper)
// Stakedym Keeper must be initialized after TransferKeeper
app.StakedymKeeper = *stakedymkeeper.NewKeeper(
appCodec,
keys[stakedymtypes.StoreKey],
app.AccountKeeper,
app.BankKeeper,
app.ICAOracleKeeper,
app.RatelimitKeeper,
app.TransferKeeper,
)
stakeDymModule := stakedym.NewAppModule(appCodec, app.StakedymKeeper)
app.VestingKeeper = evmosvestingkeeper.NewKeeper(
keys[evmosvestingtypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName), appCodec,
app.AccountKeeper, app.BankKeeper, app.DistrKeeper, app.StakingKeeper,
)
// Register Gov (must be registered after stakeibc)
govRouter := govtypesv1beta1.NewRouter()
govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(upgradetypes.RouterKey, upgrade.NewSoftwareUpgradeProposalHandler(app.UpgradeKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
AddRoute(stakeibcmoduletypes.RouterKey, stakeibcmodule.NewStakeibcProposalHandler(app.StakeibcKeeper)).
AddRoute(evmosvestingtypes.RouterKey, evmosvesting.NewVestingProposalHandler(&app.VestingKeeper))
govKeeper := govkeeper.NewKeeper(
appCodec, keys[govtypes.StoreKey], app.AccountKeeper, app.BankKeeper,
app.StakingKeeper, app.MsgServiceRouter(), govtypes.DefaultConfig(), authtypes.NewModuleAddress(govtypes.ModuleName).String(),
)
govKeeper.SetLegacyRouter(govRouter)
app.GovKeeper = *govKeeper
// Register ICQ callbacks
err = app.InterchainqueryKeeper.SetCallbackHandler(stakeibcmoduletypes.ModuleName, app.StakeibcKeeper.ICQCallbackHandler())
if err != nil {
return nil
}
app.EpochsKeeper = *epochsKeeper.SetHooks(
epochsmoduletypes.NewMultiEpochHooks(
app.StakeibcKeeper.Hooks(),
app.MintKeeper.Hooks(),
app.ClaimKeeper.Hooks(),
app.StaketiaKeeper.Hooks(),
app.StakedymKeeper.Hooks(),
),
)
epochsModule := epochsmodule.NewAppModule(appCodec, app.EpochsKeeper)
icacallbacksModule := icacallbacksmodule.NewAppModule(appCodec, app.IcacallbacksKeeper, app.AccountKeeper, app.BankKeeper)
icacallbacksIBCModule := icacallbacksmodule.NewIBCModule(app.IcacallbacksKeeper)
// Register IBC calllbacks
if err := app.IcacallbacksKeeper.SetICACallbacks(
app.StakeibcKeeper.Callbacks(),
app.RecordsKeeper.Callbacks(),
app.ICAOracleKeeper.Callbacks(),
); err != nil {
return nil
}
// create IBC middleware stacks by combining middleware with base application
app.ICAHostKeeper = icahostkeeper.NewKeeper(
appCodec,
keys[icahosttypes.StoreKey],
app.GetSubspace(icahosttypes.SubModuleName),
app.IBCKeeper.ChannelKeeper, // ICS4Wrapper
app.IBCKeeper.ChannelKeeper,
&app.IBCKeeper.PortKeeper,
app.AccountKeeper,
scopedICAHostKeeper,
app.MsgServiceRouter(),
)
icaModule := ica.NewAppModule(&app.ICAControllerKeeper, &app.ICAHostKeeper)
// Create the middleware stacks
// Stack one (ICAHost Stack) contains:
// - IBC
// - ICAHost
// - base app
icaHostIBCModule := icahost.NewIBCModule(app.ICAHostKeeper)
// Stack two (ICACallbacks Stack) contains
// - IBC
// - ICAController
// - ICAOracle
// - stakeibc
// - ICACallbacks
// - base app
var icacallbacksStack porttypes.IBCModule = icacallbacksIBCModule
icacallbacksStack = stakeibcmodule.NewIBCMiddleware(icacallbacksStack, app.StakeibcKeeper)
icacallbacksStack = icaoracle.NewIBCMiddleware(icacallbacksStack, app.ICAOracleKeeper)
icacallbacksStack = icacontroller.NewIBCMiddleware(icacallbacksStack, app.ICAControllerKeeper)
// SendPacket originates from the base app and work up the stack to core IBC
// RecvPacket originates from core IBC and goes down the stack
// Stack three contains
// - core ibc
// - autopilot
// - records
// - staketia
// - stakedym
// - ratelimit
// - ibchooks
// - pfm
// - transfer
// - base app
// Note: Traffic up the stack does not pass through records or autopilot,
// as defined via the ICS4Wrappers of each keeper
var transferStack porttypes.IBCModule = transfer.NewIBCModule(app.TransferKeeper)
transferStack = packetforward.NewIBCMiddleware(
transferStack,
app.PacketForwardKeeper,
0, // retries on timeout
packetforwardkeeper.DefaultForwardTransferPacketTimeoutTimestamp, // forward timeout
packetforwardkeeper.DefaultRefundTransferPacketTimeoutTimestamp, // refund timeout
)
transferStack = ibchooks.NewIBCMiddleware(transferStack, &app.HooksICS4Wrapper)
transferStack = ratelimit.NewIBCMiddleware(app.RatelimitKeeper, transferStack)
transferStack = staketia.NewIBCMiddleware(app.StaketiaKeeper, transferStack)
transferStack = stakedym.NewIBCMiddleware(app.StakedymKeeper, transferStack)
transferStack = recordsmodule.NewIBCModule(app.RecordsKeeper, transferStack)
transferStack = autopilot.NewIBCModule(app.AutopilotKeeper, transferStack)
// Create static IBC router, add transfer route, then set and seal it
ibcRouter := porttypes.NewRouter()
ibcRouter.
// ICAHost Stack
AddRoute(icahosttypes.SubModuleName, icaHostIBCModule).
// ICACallbacks Stack
AddRoute(icacontrollertypes.SubModuleName, icacallbacksStack).
// Transfer stack
AddRoute(ibctransfertypes.ModuleName, transferStack).
// Consumer stack
AddRoute(ccvconsumertypes.ModuleName, consumerModule)
app.IBCKeeper.SetRouter(ibcRouter)
/**** Module Options ****/
// NOTE: we may consider parsing `appOpts` inside module constructors. For the moment
// we prefer to be more strict in what arguments the modules expect.
skipGenesisInvariants := cast.ToBool(appOpts.Get(crisis.FlagSkipGenesisInvariants))
// NOTE: Any module instantiated in the module manager that is later modified
// must be passed by reference here.
app.mm = module.NewManager(
genutil.NewAppModule(
app.AccountKeeper, app.StakingKeeper, app.BaseApp.DeliverTx,
encodingConfig.TxConfig,
),
evmosvesting.NewAppModule(app.VestingKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper),
auth.NewAppModule(appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts, app.GetSubspace(authtypes.ModuleName)),
vesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
claimvesting.NewAppModule(app.AccountKeeper, app.BankKeeper),
bank.NewAppModule(appCodec, app.BankKeeper, app.AccountKeeper, app.GetSubspace(banktypes.ModuleName)),
capability.NewAppModule(appCodec, *app.CapabilityKeeper, false),
feegrantmodule.NewAppModule(appCodec, app.AccountKeeper, app.BankKeeper, app.FeeGrantKeeper, app.interfaceRegistry),
crisis.NewAppModule(app.CrisisKeeper, skipGenesisInvariants, app.GetSubspace(crisistypes.ModuleName)),
ccvgov.NewAppModule(appCodec, app.GovKeeper, app.AccountKeeper, app.BankKeeper, IsProposalWhitelisted, app.GetSubspace(govtypes.ModuleName), IsModuleWhiteList),
mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, app.BankKeeper),
slashing.NewAppModule(appCodec, app.SlashingKeeper, app.AccountKeeper, app.BankKeeper, app.ConsumerKeeper, app.GetSubspace(slashingtypes.ModuleName)),
ccvdistr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper, authtypes.FeeCollectorName, app.GetSubspace(distrtypes.ModuleName)),
ccvstaking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName)),
upgrade.NewAppModule(app.UpgradeKeeper),
evidence.NewAppModule(app.EvidenceKeeper),
consensus.NewAppModule(appCodec, app.ConsensusParamsKeeper),
ibc.NewAppModule(app.IBCKeeper),
params.NewAppModule(app.ParamsKeeper),
claim.NewAppModule(appCodec, app.ClaimKeeper),
// technically, app.GetSubspace(packetforwardtypes.ModuleName) will never be run https://github.com/cosmos/ibc-apps/issues/146#issuecomment-1839242144
packetforward.NewAppModule(app.PacketForwardKeeper, app.GetSubspace(packetforwardtypes.ModuleName)),
wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.BaseApp.MsgServiceRouter(), app.GetSubspace(wasmtypes.ModuleName)),
ibchooks.NewAppModule(app.AccountKeeper),
transfer.NewAppModule(app.TransferKeeper),
// monitoringModule,
stakeibcModule,
epochsModule,
interchainQueryModule,
icaModule,
recordsModule,
ratelimitModule,
icacallbacksModule,
consumerModule,
autopilotModule,
icaoracleModule,
stakeTiaModule,
stakeDymModule,
)
// During begin block slashing happens after distr.BeginBlocker so that
// there is nothing left over in the validator fee pool, so as to keep the
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.mm.SetOrderBeginBlockers(
upgradetypes.ModuleName,
capabilitytypes.ModuleName,
minttypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
evidencetypes.ModuleName,
stakingtypes.ModuleName,
vestingtypes.ModuleName,
claimvestingtypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
govtypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
evmosvestingtypes.ModuleName,
icatypes.ModuleName,
stakeibcmoduletypes.ModuleName,
epochsmoduletypes.ModuleName,
interchainquerytypes.ModuleName,
recordsmoduletypes.ModuleName,
ratelimittypes.ModuleName,
icacallbacksmoduletypes.ModuleName,
claimtypes.ModuleName,
ccvconsumertypes.ModuleName,
autopilottypes.ModuleName,
icaoracletypes.ModuleName,
consensusparamtypes.ModuleName,
packetforwardtypes.ModuleName,
staketiatypes.ModuleName,
stakedymtypes.ModuleName,
wasmtypes.ModuleName,
ibchookstypes.ModuleName,
)
app.mm.SetOrderEndBlockers(
crisistypes.ModuleName,
genutiltypes.ModuleName,
govtypes.ModuleName,
stakingtypes.ModuleName,
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
slashingtypes.ModuleName,
vestingtypes.ModuleName,
claimvestingtypes.ModuleName,
minttypes.ModuleName,
evidencetypes.ModuleName,
feegrant.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
ibchost.ModuleName,
ibctransfertypes.ModuleName,
evmosvestingtypes.ModuleName,
icatypes.ModuleName,
stakeibcmoduletypes.ModuleName,
epochsmoduletypes.ModuleName,
interchainquerytypes.ModuleName,
recordsmoduletypes.ModuleName,
ratelimittypes.ModuleName,
icacallbacksmoduletypes.ModuleName,
claimtypes.ModuleName,
ccvconsumertypes.ModuleName,
autopilottypes.ModuleName,
icaoracletypes.ModuleName,
consensusparamtypes.ModuleName,
packetforwardtypes.ModuleName,
staketiatypes.ModuleName,
stakedymtypes.ModuleName,
wasmtypes.ModuleName,
ibchookstypes.ModuleName,
)
// NOTE: The genutils module must occur after staking so that pools are
// properly initialized with tokens from genesis accounts.
// NOTE: Capability module must occur first so that it can initialize any capabilities
// so that other modules that want to create or claim capabilities afterwards in InitChain
// can do so safely.
app.mm.SetOrderInitGenesis(
capabilitytypes.ModuleName,
authtypes.ModuleName,
banktypes.ModuleName,
distrtypes.ModuleName,
stakingtypes.ModuleName,
vestingtypes.ModuleName,
claimvestingtypes.ModuleName,
slashingtypes.ModuleName,
govtypes.ModuleName,
minttypes.ModuleName,
crisistypes.ModuleName,
genutiltypes.ModuleName,
ibchost.ModuleName,
evidencetypes.ModuleName,
paramstypes.ModuleName,
upgradetypes.ModuleName,
ibctransfertypes.ModuleName,
feegrant.ModuleName,
evmosvestingtypes.ModuleName,
icatypes.ModuleName,
stakeibcmoduletypes.ModuleName,