From 3ae873e31b332004df1e373e616f617835b75c0c Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:33:06 +0900 Subject: [PATCH 1/5] fix: default param --- x/yieldaggregator/types/params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/yieldaggregator/types/params.go b/x/yieldaggregator/types/params.go index 928dbfe33..9bcbd231f 100644 --- a/x/yieldaggregator/types/params.go +++ b/x/yieldaggregator/types/params.go @@ -37,7 +37,7 @@ func NewParams( // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(sdk.ZeroDec(), sdk.NewInt64Coin("stake", 1000), sdk.NewInt64Coin("stake", 1000)) + return NewParams(sdk.MustNewDecFromStr("0.001"), sdk.NewInt64Coin("uguu", 10000000), sdk.NewInt64Coin("uguu", 1000000)) } // ParamSetPairs get the params.ParamSet From 22f993264aacfc9a0aa1d0926f6a057dca0327c0 Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:33:15 +0900 Subject: [PATCH 2/5] fix: readme --- README.md | 4 ++-- docs/README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b94bdbedd..83acc62d6 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,9 @@ Install Go. Use the 19.x series version. ```bash $ wget https://go.dev/dl/go1.19.2.linux-amd64.tar.gz -$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz +$ sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.19.2.linux-amd64.tar.gz $ vim ~/.bashrc -export PATH=$PATH:/usr/local/go/bin +export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin $ source ~/.bashrc $ go version go version go1.19.2 linux/amd64 diff --git a/docs/README.md b/docs/README.md index 8e4ccde56..114042b4f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -6,7 +6,7 @@ This is an example for Ubuntu. ```shell apt update -apt install build-essential +apt install build-essential unzip cd ~ wget https://dl.google.com/go/go1.14.linux-amd64.tar.gz tar -C /usr/local -xzf go1.14.linux-amd64.tar.gz From 8be7e2ddd29ec8baa0cbe2b8764a800a68c23d95 Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:41:48 +0900 Subject: [PATCH 3/5] Revert "fix: default param" This reverts commit 3ae873e31b332004df1e373e616f617835b75c0c. --- x/yieldaggregator/types/params.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/yieldaggregator/types/params.go b/x/yieldaggregator/types/params.go index 9bcbd231f..928dbfe33 100644 --- a/x/yieldaggregator/types/params.go +++ b/x/yieldaggregator/types/params.go @@ -37,7 +37,7 @@ func NewParams( // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams(sdk.MustNewDecFromStr("0.001"), sdk.NewInt64Coin("uguu", 10000000), sdk.NewInt64Coin("uguu", 1000000)) + return NewParams(sdk.ZeroDec(), sdk.NewInt64Coin("stake", 1000), sdk.NewInt64Coin("stake", 1000)) } // ParamSetPairs get the params.ParamSet From c4186c4e2df80683c3ccb1a1c47310e688b14c83 Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:59:10 +0900 Subject: [PATCH 4/5] feat: add iya keeper --- app/app.go | 1 + app/keepers/keepers.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/app/app.go b/app/app.go index 196347395..79902b39b 100644 --- a/app/app.go +++ b/app/app.go @@ -1479,4 +1479,5 @@ func (app *App) setupAppkeeper() { app.AppKeepers.ConsensusParamsKeeper = &app.ConsensusParamsKeeper app.AppKeepers.ParamsKeeper = &app.ParamsKeeper app.AppKeepers.WasmKeeper = &app.WasmKeeper + app.AppKeepers.YieldaggregatorKeeper = &app.YieldaggregatorKeeper } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 5447c864c..b89b99f10 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -12,6 +12,8 @@ import ( paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + + yieldaggregatorKeeper "github.com/UnUniFi/chain/x/yieldaggregator/keeper" ) type AppKeepers struct { @@ -38,4 +40,7 @@ type AppKeepers struct { DistrKeeper *distrkeeper.Keeper WasmKeeper *wasmkeeper.Keeper + + // ununifi original keepers + YieldaggregatorKeeper *yieldaggregatorKeeper.Keeper } From f5fea679cc81a080f2f1f87cf03d9093f5a2c71d Mon Sep 17 00:00:00 2001 From: Senna46 <29295263+Senna46@users.noreply.github.com> Date: Mon, 12 Jun 2023 17:59:18 +0900 Subject: [PATCH 5/5] feat: change param --- app/upgrades/v3/upgrades.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/upgrades/v3/upgrades.go b/app/upgrades/v3/upgrades.go index e0c2218af..a101b4f14 100644 --- a/app/upgrades/v3/upgrades.go +++ b/app/upgrades/v3/upgrades.go @@ -18,6 +18,12 @@ func CreateUpgradeHandler(mm *module.Manager, return func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { ctx.Logger().Info(fmt.Sprintf("update start:%s", UpgradeName)) + iyaParam := keepers.YieldaggregatorKeeper.GetParams(ctx) + iyaParam.CommissionRate = sdk.NewDecWithPrec(1, 3) + iyaParam.VaultCreationFee = sdk.NewCoin("uguu", sdk.NewInt(10000000)) + iyaParam.VaultCreationDeposit = sdk.NewCoin("uguu", sdk.NewInt(1000000)) + + keepers.YieldaggregatorKeeper.SetParams(ctx, iyaParam) return mm.RunMigrations(ctx, configurator, vm) } }