func ValidateInitialSupply(initialSupply uint64) error {
	if initialSupply > MaximumInitSupply {
		return sdkerrors.Wrapf(ErrInvalidInitSupply, "invalid token initial supply %d, only accepts value [0, %d]", initialSupply, MaximumInitSupply)
	}
	return nil
}
ValidateInitialSupply verifies whether the initial supply is legal
package types
import (
	fmt "fmt"
	"math"
	"regexp"
	"strings"
	sdk "github.com/cosmos/cosmos-sdk/types"
	sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
const (
	MaximumMaxSupply = math.MaxUint64
	MaximumInitSupply = uint64(100000000000)
	MaximumScale = uint32(9)
	MinimumSymbolLen = 3
	MaximumSymbolLen = 64
	MaximumNameLen = 32
	MinimumMinUnitLen = 3
	MaximumMinUnitLen = 64
)
const (
	ReservedPeg  = "peg"
	ReservedIBC  = "ibc"
	ReservedTIBC = "tibc"
	ReservedLpt  = "lpt"
	ReservedHTLT = "htlt"
)
var (
	keywords = strings.Join([]string{
		ReservedPeg, ReservedIBC, ReservedLpt, ReservedHTLT, ReservedTIBC,
	}, "|")
	regexpKeywordsFmt = fmt.Sprintf("^(%s).*", keywords)
	regexpKeyword     = regexp.MustCompile(regexpKeywordsFmt).MatchString
	regexpSymbolFmt = fmt.Sprintf("^[a-z][a-z0-9]{%d,%d}$", MinimumSymbolLen-1, MaximumSymbolLen-1)
	regexpSymbol    = regexp.MustCompile(regexpSymbolFmt).MatchString
	regexpMinUintFmt = fmt.Sprintf("^[a-z][a-z0-9]{%d,%d}$", MinimumMinUnitLen-1, MaximumMinUnitLen-1)
	regexpMinUint    = regexp.MustCompile(regexpMinUintFmt).MatchString
)
func ValidateToken(token Token) error {
	if len(token.Owner) > 0 {
		if _, err := sdk.AccAddressFromBech32(token.Owner); err != nil {
			return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid owner address (%s)", err)
		}
	}
	if err := ValidateName(token.Name); err != nil {
		return err
	}
	if err := ValidateSymbol(token.Symbol); err != nil {
		return err
	}
	if err := ValidateMinUnit(token.MinUnit); err != nil {
		return err
	}
	if err := ValidateInitialSupply(token.InitialSupply); err != nil {
		return err
	}
	if token.MaxSupply < token.InitialSupply {
		return sdkerrors.Wrapf(ErrInvalidMaxSupply, "invalid token max supply %d, only accepts value [%d, %d]", token.MaxSupply, token.InitialSupply, uint64(MaximumMaxSupply))
	}
	return ValidateScale(token.Scale)
}