forked from cerc-io/laconicd
Add a new token and only allow fees in alnt (#68)
Part of https://www.notion.so/Multiple-tokens-support-and-disable-transfers-for-LSTAKE-1f2a6b22d47280269f87df3fe03e8d64 - Add base token with denoms `alps` and `lps` (`1 lps = 10^18 alps`) - Keep `alnt` as the staking token and for laconic module ops - Accept tx fees only in `alnt` Reviewed-on: cerc-io/laconicd#68 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
+3
-2
@@ -5,11 +5,12 @@ import (
|
||||
fmt "fmt"
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// DefaultMaxBondAmountTokens are the default parameter values.
|
||||
var DefaultMaxBondAmountTokens = sdkmath.NewInt(1000000000000) // 10^12 alnt
|
||||
var DefaultMaxBondAmountTokens = sdkmath.NewInt(1000000000000) // 10^12
|
||||
|
||||
func NewParams(maxBondAmount sdk.Coin) Params {
|
||||
return Params{MaxBondAmount: maxBondAmount}
|
||||
@@ -17,7 +18,7 @@ func NewParams(maxBondAmount sdk.Coin) Params {
|
||||
|
||||
// DefaultParams returns default module parameters
|
||||
func DefaultParams() Params {
|
||||
return NewParams(sdk.NewCoin(sdk.DefaultBondDenom, DefaultMaxBondAmountTokens))
|
||||
return NewParams(sdk.NewCoin(params.CoinUnit, DefaultMaxBondAmountTokens))
|
||||
}
|
||||
|
||||
// Validate checks that the parameters have valid values
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
||||
|
||||
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||
auctiontypes "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||
registrytypes "git.vdb.to/cerc-io/laconicd/x/registry"
|
||||
"git.vdb.to/cerc-io/laconicd/x/registry/helpers"
|
||||
@@ -295,7 +296,7 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo
|
||||
moduleParams.AuthorityAuctionCommitFee,
|
||||
moduleParams.AuthorityAuctionRevealFee,
|
||||
moduleParams.AuthorityAuctionMinimumBid,
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)),
|
||||
sdk.NewCoin(params.CoinUnit, math.NewInt(0)),
|
||||
0,
|
||||
ownerAddress,
|
||||
)
|
||||
|
||||
+12
-10
@@ -6,26 +6,28 @@ import (
|
||||
|
||||
sdkmath "cosmossdk.io/math"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"git.vdb.to/cerc-io/laconicd/app/params"
|
||||
)
|
||||
|
||||
// Default parameter values.
|
||||
var (
|
||||
// DefaultRecordRent is the default record rent for 1 time period (see expiry time).
|
||||
DefaultRecordRent = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultRecordRent = sdkmath.NewInt(1000000) // 10^6
|
||||
|
||||
// DefaultRecordExpiryTime is the default record expiry time (1 year).
|
||||
DefaultRecordExpiryTime = time.Hour * 24 * 365
|
||||
|
||||
DefaultAuthorityRent = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultAuthorityRent = sdkmath.NewInt(1000000) // 10^6
|
||||
DefaultAuthorityExpiryTime = time.Hour * 24 * 365
|
||||
DefaultAuthorityGracePeriod = time.Hour * 24 * 2
|
||||
|
||||
DefaultAuthorityAuctionEnabled = false
|
||||
DefaultCommitsDuration = time.Hour * 24
|
||||
DefaultRevealsDuration = time.Hour * 24
|
||||
DefaultCommitFee = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultRevealFee = sdkmath.NewInt(1000000) // 10^6 alnt
|
||||
DefaultMinimumBid = sdkmath.NewInt(5000000) // 5 * 10^6 alnt
|
||||
DefaultCommitFee = sdkmath.NewInt(1000000) // 10^6
|
||||
DefaultRevealFee = sdkmath.NewInt(1000000) // 10^6
|
||||
DefaultMinimumBid = sdkmath.NewInt(5000000) // 5 * 10^6
|
||||
)
|
||||
|
||||
// NewParams creates a new Params instance
|
||||
@@ -60,13 +62,13 @@ func NewParams(
|
||||
// DefaultParams returns a default set of parameters.
|
||||
func DefaultParams() Params {
|
||||
return NewParams(
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRecordRent), DefaultRecordExpiryTime,
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultAuthorityRent),
|
||||
sdk.NewCoin(params.CoinUnit, DefaultRecordRent), DefaultRecordExpiryTime,
|
||||
sdk.NewCoin(params.CoinUnit, DefaultAuthorityRent),
|
||||
DefaultAuthorityExpiryTime, DefaultAuthorityGracePeriod, DefaultAuthorityAuctionEnabled, DefaultCommitsDuration,
|
||||
DefaultRevealsDuration,
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee),
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee),
|
||||
sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid),
|
||||
sdk.NewCoin(params.CoinUnit, DefaultCommitFee),
|
||||
sdk.NewCoin(params.CoinUnit, DefaultRevealFee),
|
||||
sdk.NewCoin(params.CoinUnit, DefaultMinimumBid),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user