types

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AttoTele defines the default coin denomination used in Teleport in:
	//
	// - Staking parameters: denomination used as stake in the dPoS chain
	// - Mint parameters: denomination minted due to fee distribution rewards
	// - Governance parameters: denomination used for spam prevention in proposal deposits
	// - Crisis parameters: constant fee denomination used for spam prevention to check broken invariant
	// - EVM parameters: denomination used for running EVM state transitions in Teleport.
	AttoTele = "atele"

	// DisplayDenom defines the denomination displayed to users in client applications.
	DisplayDenom = "tele"
	// BaseDenom defines to the default denomination used in Teleport (staking, EVN, governance, etc)
	BaseDenom = AttoTele

	// BaseDenomUnit defines the base denomination unit for Teles.
	// 1 tele = 1x10^{BaseDenomUnit} atele
	BaseDenomUnit = 18

	// DefaultGasPrice is default gas price for evm transactions
	DefaultGasPrice = 20
)

Variables

View Source
var PowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(BaseDenomUnit-2), nil))

PowerReduction defines the default power reduction value for staking (BaseDenomUnit - 2) indicates that staking tokens:power = 1:100, which means we consider 0.01 BaseDenom as 1 power

Functions

func GetAddressFromBech32

func GetAddressFromBech32(address string) (sdk.AccAddress, error)

GetAddressFromBech32 returns the sdk.Account address of given address, while also changing bech32 human readable prefix (HRP) to the value set on the global sdk.Config (eg: `teleport`). The function fails if the provided bech32 address is invalid.

func IsSupportedKey

func IsSupportedKey(pubkey cryptotypes.PubKey) bool

IsSupportedKey returns true if the pubkey type is supported by the chain (i.e eth_secp256k1, amino multisig, ed25519). NOTE: Nested multisigs are not supported.

func NewTeleCoin

func NewTeleCoin(amount sdk.Int) sdk.Coin

NewTeleCoin is a utility function that returns an "atele" coin with the given sdk.Int amount. The function will panic if the provided amount is negative.

func NewTeleCoinInt64

func NewTeleCoinInt64(amount int64) sdk.Coin

NewTeleCoinInt64 is a utility function that returns an "atele" coin with the given int64 amount. The function will panic if the provided amount is negative.

func NewTeleDecCoin

func NewTeleDecCoin(amount sdk.Int) sdk.DecCoin

NewTeleDecCoin is a utility function that returns an "atele" decimal coin with the given sdk.Int amount. The function will panic if the provided amount is negative.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL