Skip to content

Commit

Permalink
add claim module
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantani committed Nov 5, 2024
1 parent a3ebce2 commit 6eac2ed
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 38 deletions.
9 changes: 7 additions & 2 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ import (
ibcfeekeeper "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/keeper"
ibctransferkeeper "github.com/cosmos/ibc-go/v8/modules/apps/transfer/keeper"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
claimkeeper "github.com/ignite/modules/x/claim/keeper"
_ "github.com/ignite/modules/x/claim/module" // import for side-effects
fundraisingmodulekeeper "github.com/ignite/modules/x/fundraising/keeper"
_ "github.com/ignite/modules/x/fundraising/module" // import for side-effects
mintkeeper "github.com/ignite/modules/x/mint/keeper"
Expand Down Expand Up @@ -112,7 +114,6 @@ type App struct {
ConsensusParamsKeeper consensuskeeper.Keeper

SlashingKeeper slashingkeeper.Keeper
MintKeeper mintkeeper.Keeper
GovKeeper *govkeeper.Keeper
CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper
Expand All @@ -139,7 +140,10 @@ type App struct {
ScopedICAHostKeeper capabilitykeeper.ScopedKeeper
ScopedKeepers map[string]capabilitykeeper.ScopedKeeper

FundraisingKeeper fundraisingmodulekeeper.Keeper
MintKeeper mintkeeper.Keeper
ClaimKeeper claimkeeper.Keeper
FundraisingKeeper fundraisingmodulekeeper.Keeper

ProfileKeeper profilemodulekeeper.Keeper
ProjectKeeper projectmodulekeeper.Keeper
RewardKeeper rewardmodulekeeper.Keeper
Expand Down Expand Up @@ -250,6 +254,7 @@ func New(
&app.NFTKeeper,
&app.GroupKeeper,
&app.CircuitBreakerKeeper,
&app.ClaimKeeper,
&app.FundraisingKeeper,
&app.ProfileKeeper,
&app.LaunchKeeper,
Expand Down
23 changes: 17 additions & 6 deletions app/app_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ import (
ibcfeetypes "github.com/cosmos/ibc-go/v8/modules/apps/29-fee/types"
ibctransfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
claimmodulev1 "github.com/ignite/modules/api/modules/claim/module/v1"
fundraisingmodulev1 "github.com/ignite/modules/api/modules/fundraising/module/v1"
mintmodulev1 "github.com/ignite/modules/api/modules/mint/module/v1"
_ "github.com/ignite/modules/x/claim/module"
claimtypes "github.com/ignite/modules/x/claim/types"
fundraisingmoduletypes "github.com/ignite/modules/x/fundraising/types"
_ "github.com/ignite/modules/x/fundraising/module"
fundraisingtypes "github.com/ignite/modules/x/fundraising/types"
_ "github.com/ignite/modules/x/mint/module"
minttypes "github.com/ignite/modules/x/mint/types"
"google.golang.org/protobuf/types/known/durationpb"

Expand Down Expand Up @@ -114,7 +118,8 @@ var (
consensustypes.ModuleName,
circuittypes.ModuleName,
// chain modules
fundraisingmoduletypes.ModuleName,
claimtypes.ModuleName,
fundraisingtypes.ModuleName,
profilemoduletypes.ModuleName,
launchmoduletypes.ModuleName,
rewardmoduletypes.ModuleName,
Expand Down Expand Up @@ -146,7 +151,8 @@ var (
icatypes.ModuleName,
ibcfeetypes.ModuleName,
// chain modules
fundraisingmoduletypes.ModuleName,
claimtypes.ModuleName,
fundraisingtypes.ModuleName,
profilemoduletypes.ModuleName,
launchmoduletypes.ModuleName,
rewardmoduletypes.ModuleName,
Expand All @@ -173,7 +179,8 @@ var (
icatypes.ModuleName,
ibcfeetypes.ModuleName,
// chain modules
fundraisingmoduletypes.ModuleName,
claimtypes.ModuleName,
fundraisingtypes.ModuleName,
profilemoduletypes.ModuleName,
launchmoduletypes.ModuleName,
rewardmoduletypes.ModuleName,
Expand Down Expand Up @@ -203,7 +210,7 @@ var (
{Account: icatypes.ModuleName},
{Account: projectmoduletypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
{Account: rewardmoduletypes.ModuleName},
{Account: fundraisingmoduletypes.ModuleName},
{Account: fundraisingtypes.ModuleName},
{Account: monitoringcmoduletypes.ModuleName},
{Account: monitoringpmoduletypes.ModuleName},
{Account: claimtypes.ModuleName, Permissions: []string{authtypes.Minter, authtypes.Burner}},
Expand Down Expand Up @@ -343,7 +350,11 @@ var (
Config: appconfig.WrapAny(&circuitmodulev1.Module{}),
},
{
Name: fundraisingmoduletypes.ModuleName,
Name: claimtypes.ModuleName,
Config: appconfig.WrapAny(&claimmodulev1.Module{}),
},
{
Name: fundraisingtypes.ModuleName,
Config: appconfig.WrapAny(&fundraisingmodulev1.Module{}),
},
{
Expand Down
110 changes: 93 additions & 17 deletions localnet/spn/genesis_template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
"app_state": {
"auth": {
"accounts": [
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "0",
"address": "spn15rz2rwnlgr7nf6eauz52usezffwrxc0m7fezqe",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "0",
Expand Down Expand Up @@ -52,6 +45,13 @@
"address": "spn1twckcceyw43da9j247pfs3yhqsv25j38grh68q",
"pub_key": null,
"sequence": "0"
},
{
"@type": "/cosmos.auth.v1beta1.BaseAccount",
"account_number": "0",
"address": "spn15rz2rwnlgr7nf6eauz52usezffwrxc0m7fezqe",
"pub_key": null,
"sequence": "0"
}
],
"params": {
Expand Down Expand Up @@ -91,10 +91,6 @@
{
"amount": "200000000",
"denom": "uspn"
},
{
"amount": "200000000",
"denom": "v/0/orbit"
}
]
},
Expand Down Expand Up @@ -135,7 +131,35 @@
]
}
],
"denom_metadata": [],
"denom_metadata": [
{
"base": "uspn",
"denom_units": [
{
"aliases": [
"microspn"
],
"denom": "uspn",
"exponent": "0"
},
{
"aliases": [
"millispn"
],
"denom": "mspn",
"exponent": "3"
},
{
"denom": "spn",
"exponent": "6"
}
],
"description": "The native staking token of Starport Network",
"display": "spn",
"name": "Starport Network",
"symbol": "SPN"
}
],
"params": {
"default_send_enabled": true,
"send_enabled": []
Expand All @@ -154,12 +178,51 @@
"claim": {
"airdrop_supply": {
"supply": {
"amount": "0",
"denom": "uspn"
"amount": "1000",
"denom": "drop"
}
},
"claim_record_list": [],
"mission_list": [],
"claim_record_list": [
{
"address": "spn1aqn8ynvr3jmq67879qulzrwhchq5dtrvtx0nhe",
"claimable": "500"
},
{
"address": "spn1ezptsm3npn54qx9vvpah4nymre59ykr9exx2ul",
"claimable": "400"
},
{
"address": "spn1pkdk6m2nh77nlaep84cylmkhjder3arey7rll5",
"claimable": "100"
}
],
"initial_claim": {
"enabled": true,
"mission_id": "0"
},
"mission_count": "4",
"mission_list": [
{
"description": "initial claim",
"mission_id": "0",
"weight": "0.25"
},
{
"description": "sending request",
"mission_id": "3",
"weight": "0.25"
},
{
"description": "staking",
"mission_id": "1",
"weight": "0.25"
},
{
"description": "voting",
"mission_id": "2",
"weight": "0.25"
}
],
"params": {}
},
"crisis": {
Expand Down Expand Up @@ -368,7 +431,20 @@
"funded_addresses": "0.400000000000000000",
"staking": "0.500000000000000000"
},
"funded_addresses": [],
"funded_addresses": [
{
"address": "spn1ezptsm3npn54qx9vvpah4nymre59ykr9exx2ul",
"weight": "0.400000000000000000"
},
{
"address": "spn1aqn8ynvr3jmq67879qulzrwhchq5dtrvtx0nhe",
"weight": "0.300000000000000000"
},
{
"address": "spn1pkdk6m2nh77nlaep84cylmkhjder3arey7rll5",
"weight": "0.300000000000000000"
}
],
"goal_bonded": "0.670000000000000000",
"inflation_max": "0.200000000000000000",
"inflation_min": "0.070000000000000000",
Expand Down
Loading

0 comments on commit 6eac2ed

Please sign in to comment.