Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Launchpad module #400

Closed
wants to merge 34 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
301ef1c
scaffold launchpad module
jelysn Mar 8, 2024
115a6b2
Define protobuf messages for launchpad module
jelysn Mar 13, 2024
78f37d3
update launchpad proto with more txs/queries
jelysn Mar 19, 2024
057545a
register interfaces for msg_server and query
jelysn Mar 19, 2024
7e8ec69
add msg types
jelysn Mar 19, 2024
e03b24e
add order manager keeper functions
jelysn Mar 19, 2024
420eff3
Connect asset profile, oracle, commitment keepers to launchpad Keeper…
jelysn Mar 19, 2024
2e9e68f
Implement missing send coins feature on BuyElys and implement ReturnElys
jelysn Mar 19, 2024
6935b54
Implement UpdateParams msg, WithdrawRaised msg
jelysn Mar 19, 2024
3e35525
Implement launchpad missing token send logic on msg handling and impl…
jelysn Mar 20, 2024
714d204
Implement launchpad vesting feature
jelysn Mar 20, 2024
2a8064e
add wasmbinding for msgs and queries
jelysn Mar 20, 2024
dcebb83
resolve unit test
jelysn Mar 20, 2024
c283210
add todo on BuyElys
jelysn Mar 20, 2024
97a3a5a
implement cli commands for launchpad module
jelysn Mar 21, 2024
6b3e9e7
Implement init/export genesis for launchpad module
jelysn Mar 21, 2024
8942a73
define genesis and default params for launchpad
jelysn Mar 21, 2024
895fd0b
Compose config.yml for launchpad genesis on localnet
jelysn Mar 21, 2024
ef45053
Add launchpad module balances query & Prepare example cli commands fo…
jelysn Mar 21, 2024
68f1823
Fix token amount calculation in purchase order
jelysn Mar 21, 2024
d894c2c
Merge branch 'main' of github.com:elys-network/elys into launchpad_mo…
jelysn Mar 21, 2024
f213ca3
update docs
jelysn Mar 21, 2024
1c953c7
add launchpad unit test TODO, implement orders basic functions
jelysn Mar 26, 2024
b62a6e8
Add unit test for Bonus query and fix params query test
jelysn Mar 27, 2024
0bb58b4
Add unit test for QueryOrders and QueryModuleBalances
jelysn Mar 27, 2024
59da5af
add unit test for BuyElysEst
jelysn Mar 27, 2024
376b436
Add unit test for MsgServerBuyElys
jelysn Mar 27, 2024
494fb11
add unit test for ReturnElysEst
jelysn Mar 27, 2024
0a5612c
add unit test for MsgServerReturnElys
jelysn Mar 27, 2024
206f5ed
add unit test for IsEnabledToken
jelysn Mar 27, 2024
3f5548e
Add unit test for MsgServerDepositElysToken and MsgServerWithdrawRaised
jelysn Mar 27, 2024
273ec04
Add unit test for BeginBlocker, SetEpochInfo and SetElysVestingInfo
jelysn Mar 27, 2024
e48a2a4
Merge branch 'main' into launchpad_module
cosmic-vagabond Apr 26, 2024
096bf0d
Merge branch 'main' into launchpad_module
Wgil May 6, 2024
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
24 changes: 24 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ import (
estakingmodule "github.com/elys-network/elys/x/estaking"
estakingmodulekeeper "github.com/elys-network/elys/x/estaking/keeper"
estakingmoduletypes "github.com/elys-network/elys/x/estaking/types"
launchpadmodule "github.com/elys-network/elys/x/launchpad"
launchpadmodulekeeper "github.com/elys-network/elys/x/launchpad/keeper"
launchpadmoduletypes "github.com/elys-network/elys/x/launchpad/types"
masterchefmodule "github.com/elys-network/elys/x/masterchef"
masterchefmodulekeeper "github.com/elys-network/elys/x/masterchef/keeper"
masterchefmoduletypes "github.com/elys-network/elys/x/masterchef/types"
Expand Down Expand Up @@ -294,6 +297,7 @@ var (
clockmodule.AppModuleBasic{},
stablestake.AppModuleBasic{},
leveragelpmodule.AppModuleBasic{},
launchpadmodule.AppModuleBasic{},
masterchefmodule.AppModuleBasic{},
estakingmodule.AppModuleBasic{},
// this line is used by starport scaffolding # stargate/app/moduleBasic
Expand All @@ -316,6 +320,7 @@ var (
ammmoduletypes.ModuleName: {authtypes.Minter, authtypes.Burner, authtypes.Staking},
wasmmoduletypes.ModuleName: {authtypes.Burner},
stablestaketypes.ModuleName: {authtypes.Minter, authtypes.Burner},
launchpadmoduletypes.ModuleName: {},
masterchefmoduletypes.ModuleName: {},
// this line is used by starport scaffolding # stargate/app/maccPerms
}
Expand Down Expand Up @@ -403,6 +408,7 @@ type ElysApp struct {

LeveragelpKeeper leveragelpmodulekeeper.Keeper

LaunchpadKeeper launchpadmodulekeeper.Keeper
MasterchefKeeper masterchefmodulekeeper.Keeper

EstakingKeeper estakingmodulekeeper.Keeper
Expand Down Expand Up @@ -487,6 +493,7 @@ func NewElysApp(
clockmoduletypes.StoreKey,
stablestaketypes.StoreKey,
leveragelpmoduletypes.StoreKey,
launchpadmoduletypes.StoreKey,
masterchefmoduletypes.StoreKey,
estakingmoduletypes.StoreKey,
// this line is used by starport scaffolding # stargate/app/storeKey
Expand Down Expand Up @@ -1022,6 +1029,19 @@ func NewElysApp(
)
leveragelpModule := leveragelpmodule.NewAppModule(appCodec, app.LeveragelpKeeper, app.AccountKeeper, app.BankKeeper)

app.LaunchpadKeeper = *launchpadmodulekeeper.NewKeeper(
appCodec,
keys[launchpadmoduletypes.StoreKey],
keys[launchpadmoduletypes.MemStoreKey],
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.BankKeeper,
app.OracleKeeper,
&app.EpochsKeeper,
&app.CommitmentKeeper,
app.AssetprofileKeeper,
)
launchpadModule := launchpadmodule.NewAppModule(appCodec, app.LaunchpadKeeper, app.AccountKeeper, app.BankKeeper)

// this line is used by starport scaffolding # stargate/app/keeperDefinition

/**** IBC Routing ****/
Expand Down Expand Up @@ -1144,6 +1164,7 @@ func NewElysApp(
clockModule,
stablestakeModule,
leveragelpModule,
launchpadModule,
masterchefModule,
estakingModule,
// this line is used by starport scaffolding # stargate/app/appModule
Expand Down Expand Up @@ -1193,6 +1214,7 @@ func NewElysApp(
transferhooktypes.ModuleName,
clockmoduletypes.ModuleName,
leveragelpmoduletypes.ModuleName,
launchpadmoduletypes.ModuleName,
masterchefmoduletypes.ModuleName,
estakingmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/beginBlockers
Expand Down Expand Up @@ -1237,6 +1259,7 @@ func NewElysApp(
accountedpoolmoduletypes.ModuleName,
transferhooktypes.ModuleName,
leveragelpmoduletypes.ModuleName,
launchpadmoduletypes.ModuleName,
masterchefmoduletypes.ModuleName,
estakingmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/endBlockers
Expand Down Expand Up @@ -1285,6 +1308,7 @@ func NewElysApp(
transferhooktypes.ModuleName,
clockmoduletypes.ModuleName,
leveragelpmoduletypes.ModuleName,
launchpadmoduletypes.ModuleName,
masterchefmoduletypes.ModuleName,
estakingmoduletypes.ModuleName,
// this line is used by starport scaffolding # stargate/app/initGenesis
Expand Down
36 changes: 36 additions & 0 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,42 @@ genesis:
- amount: "10000"
denom: uedenb
vesting_tokens: []
launchpad:
params:
initial_price: "0.75"
total_reserve: "4500000000000"
sold_amount: "0"
withdraw_address: "elys12tzylat4udvjj56uuhu3vj2n4vgp7cf9fwna9w"
# withdrawn_amount: ""
launchpad_starttime: 1710984623
launchpad_duration: 8640000
return_duration: 15552000
max_return_percent: 50
spending_tokens:
- uusdc
- uatom
- wei
bonus_info:
raise_percents:
- 20
- 30
- 40
- 50
- 60
- 70
- 80
- 100
bonus_percents:
- 100
- 90
- 80
- 70
- 60
- 50
- 40
- 30
lock_duration: 15552000
vesting_duration: 31536000
tokenomics:
airdropList:
- intent: AtomStakers
Expand Down
Loading
Loading