diff --git a/app/upgrades/v4/constants.go b/app/upgrades/v4/constants.go index b3190272..2138054d 100755 --- a/app/upgrades/v4/constants.go +++ b/app/upgrades/v4/constants.go @@ -41,8 +41,7 @@ const ( // IsSmartAccountActive is used for the smart account circuit breaker, smartaccounts are activated for v4 IsSmartAccountActive = true // CircuitBreakerController is a DAODAO address, used only to deactivate the smart account module - // https://daodao.zone/dao/osmo1wn58hxkv0869ua7qmz3gvek3sz773l89a778fjqvenl6anwuhgnq6ks7kl/home - CircuitBreakerController = "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5" + CircuitBreakerController = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn" ) var ( @@ -50,28 +49,25 @@ var ( // ------------------------------------------------- // total weights must be 10000 WhitelistedValidators = []liquidstaketypes.WhitelistedValidator{ + // Launchpad Validator to start with { - ValidatorAddress: "ixovaloper1n8yrmeatsk74dw0zs95ess9sgzptd6thzncf20", - TargetWeight: math.NewIntFromUint64(5000), - }, - { - ValidatorAddress: "ixovaloper1n8yrmeatsk74dw0zs95ess9sgzptd6thzncf20", - TargetWeight: math.NewIntFromUint64(5000), + ValidatorAddress: "ixovaloper1kr8v9qt46ysltgmzcrtgyw5ckke83up673u2lu", + TargetWeight: math.NewIntFromUint64(10000), }, } // LSMUnstakeFeeRate is the Unstake Fee Rate. (note the fee amount stays as staked amount in proxy account, it is not // instaked and transferred to the FeeAccountAddress) - LSMUnstakeFeeRate = math.LegacyNewDecWithPrec(3333, 4) // "0.333300000000000000" + LSMUnstakeFeeRate = math.LegacyZeroDec() // LSMAutocompoundFeeRate is the fee rate for auto redelegating the stake rewards. - LSMAutocompoundFeeRate = math.LegacyNewDecWithPrec(3333, 4) // "0.333300000000000000" + LSMAutocompoundFeeRate = math.LegacyZeroDec() // LSMWhitelistAdminAddress is the address of the whitelist admin, who is allowed to add/remove whitelisted validators, // pause/unpause the liquid stake module, and set the weighted rewards receivers. - LSMWhitelistAdminAddress = "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5" + LSMWhitelistAdminAddress = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn" // LSMWeightedRewardsReceivers is the list of weighted rewards receivers who will recieve the staking rewards based // on their weights. LSMWeightedRewardsReceivers = []liquidstaketypes.WeightedAddress{} // LSMFeeAccountAddress is the address of the fee account, which will receive the autocompound fees. - LSMFeeAccountAddress = "ixo1kqmtxkggcqa9u34lnr6shy0euvclgatw4f9zz5" + LSMFeeAccountAddress = "ixo15rwc9v3jfvypve8zemdr7y68dydsrh9m2urvjn" // STAKING PARAMS // ------------------------------------------------- diff --git a/x/epochs/types/genesis.go b/x/epochs/types/genesis.go index 74d32b9c..157d11d7 100644 --- a/x/epochs/types/genesis.go +++ b/x/epochs/types/genesis.go @@ -15,8 +15,8 @@ func NewGenesisState(epochs []EpochInfo) *GenesisState { // DefaultGenesis returns the default Capability genesis state. func DefaultGenesis() *GenesisState { epochs := []EpochInfo{ - // TODO: comment out 2min, used for testing - NewGenesisEpochInfo("2min", time.Minute*2), // alphabetical order + // TODO: comment out 2min, used for local testing + // NewGenesisEpochInfo("2min", time.Minute*2), // alphabetical order NewGenesisEpochInfo("day", time.Hour*24), NewGenesisEpochInfo("hour", time.Hour), NewGenesisEpochInfo("week", time.Hour*24*7), diff --git a/x/liquidstake/keeper/liquidstake.go b/x/liquidstake/keeper/liquidstake.go index 25ff5be8..21f4a62c 100644 --- a/x/liquidstake/keeper/liquidstake.go +++ b/x/liquidstake/keeper/liquidstake.go @@ -57,6 +57,11 @@ func (k Keeper) LiquidStake( ) (stkIXOMintAmount math.Int, err error) { params := k.GetParams(ctx) + // only allow the whitelistedAdminAddress to do liquid staking, this might be removed later + if params.WhitelistAdminAddress != liquidStaker.String() { + return math.ZeroInt(), types.ErrRestrictedToWhitelistedAdminAddress + } + if params.ModulePaused { return math.ZeroInt(), types.ErrModulePaused } diff --git a/x/liquidstake/keeper/msg_server.go b/x/liquidstake/keeper/msg_server.go index a48e3f46..32194c23 100644 --- a/x/liquidstake/keeper/msg_server.go +++ b/x/liquidstake/keeper/msg_server.go @@ -25,7 +25,6 @@ func NewMsgServerImpl(keeper Keeper) types.MsgServer { return &msgServer{Keeper: keeper} } -// TODO: only zero dao should be able to liquid stake // -------------------------- // LIQUID STAKE // -------------------------- diff --git a/x/liquidstake/module.go b/x/liquidstake/module.go index 31adf1c0..502a2d28 100644 --- a/x/liquidstake/module.go +++ b/x/liquidstake/module.go @@ -137,7 +137,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // BeginBlock executes all ABCI BeginBlock logic respective to the capability module. -func (am AppModule) BeginBlock(context sdk.Context) error { +func (am AppModule) BeginBlock(context context.Context) error { ctx := sdk.UnwrapSDKContext(context) BeginBlock(ctx, am.keeper) return nil diff --git a/x/liquidstake/types/errors.go b/x/liquidstake/types/errors.go index aa928bea..c020f640 100644 --- a/x/liquidstake/types/errors.go +++ b/x/liquidstake/types/errors.go @@ -24,4 +24,5 @@ var ( ErrUnstakeFailed = errors.Register(ModuleName, 18, "Unstaking failed") ErrRedelegateFailed = errors.Register(ModuleName, 19, "Redelegate failed") ErrRatioMoreThanOne = errors.Register(ModuleName, 20, "ratio should be less than or equal to 1") + ErrRestrictedToWhitelistedAdminAddress = errors.Register(ModuleName, 21, "this action is restricted to only the whitelisted admin address") ) diff --git a/x/liquidstake/types/keys.go b/x/liquidstake/types/keys.go index 13d1c3a5..dd36d296 100644 --- a/x/liquidstake/types/keys.go +++ b/x/liquidstake/types/keys.go @@ -16,11 +16,11 @@ const ( StoreKey = ModuleName // Epoch identifiers - // TODO: comment out 2min it is for local testing - AutocompoundEpoch = "2min" - RebalanceEpoch = "2min" - // AutocompoundEpoch = "hour" - // RebalanceEpoch = "day" + // TODO: comment out 2min, used for local testing + // AutocompoundEpoch = "2min" + // RebalanceEpoch = "2min" + AutocompoundEpoch = "hour" + RebalanceEpoch = "day" ) var ( diff --git a/x/mint/types/params.go b/x/mint/types/params.go index 85de58c6..78f15bea 100644 --- a/x/mint/types/params.go +++ b/x/mint/types/params.go @@ -44,12 +44,12 @@ func DefaultParams() Params { return Params{ MintDenom: ixo.IxoNativeToken, GenesisEpochProvisions: ixomath.NewDec(43_500_000_000), // 43_500 IXO - // TODO: comment out 2min and uncomment day, 2min is for local testing - EpochIdentifier: "2min", // 2 min - ReductionPeriodInEpochs: 1000000, // 14 min - // EpochIdentifier: "day", // 1 day - // ReductionPeriodInEpochs: 365, // 1 years - ReductionFactor: ixomath.NewDecWithPrec(666666666666666666, 18), // 0.666666666666666666 + // TODO: comment out 2min, used for local testing + // EpochIdentifier: "2min", // 2 min + // ReductionPeriodInEpochs: 1000000, // 14 min + EpochIdentifier: "day", // 1 day + ReductionPeriodInEpochs: 365, // 1 years + ReductionFactor: ixomath.NewDecWithPrec(666666666666666666, 18), // 0.666666666666666666 DistributionProportions: DistributionProportions{ Staking: ixomath.NewDecWithPrec(1, 0), // 1.0 ImpactRewards: ixomath.NewDecWithPrec(0, 1), // 0.0