Closed kimurayu45z closed 1 year ago
need to check
x/yieldaggregator/client/cli/tx_register_strategy.go
x/yieldaggregator/client/cli/tx_update_params.go
withdrawModuleCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(params.CommissionRate).RoundInt()
withdrawVaultCommissionFee := sdk.NewDecFromInt(withdrawAmount).Mul(vault.WithdrawCommissionRate).RoundInt()
withdrawAmountWithoutCommission := withdrawAmount.Sub(withdrawModuleCommissionFee).Sub(withdrawVaultCommissionFee)
if withdrawModuleCommissionFee.IsPositive() {
feeCollector, err := sdk.AccAddressFromBech32(params.FeeCollectorAddress)
if err != nil {
return err
}
err = k.bankKeeper.SendCoins(ctx, vaultModAddr, feeCollector, sdk.NewCoins(sdk.NewCoin(principal.Denom, withdrawModuleCommissionFee)))
if err != nil {
return err
}
}
if withdrawVaultCommissionFee.IsPositive() {
vaultOwner, err := sdk.AccAddressFromBech32(vault.Owner)
if err != nil {
return err
}
err = k.bankKeeper.SendCoins(ctx, vaultModAddr, vaultOwner, sdk.NewCoins(sdk.NewCoin(principal.Denom, withdrawVaultCommissionFee)))
if err != nil {
return err
}
}
cosmossdk.io/math
inyieldaggregator
MsgRegisterStrategy
with gov authorityMsgDeleteVault
by vault owner. Allowing only gov authorityFeeCollectorAddress
in ParamsParams.WithdrawCommissionRate
x/params
and prepareMsgUpdateParams
with gov authority