types

package
v2.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Name          = "fxcore"
	AddressPrefix = "fx"

	DefaultDenom = "FX"
	DenomUnit    = 18
)
View Source
const (
	EmptyEvmAddress   = "0x0000000000000000000000000000000000000000"
	FIP20LogicAddress = "0x0000000000000000000000000000000000001001"
	WFXLogicAddress   = "0x0000000000000000000000000000000000001002"
)
View Source
const (
	// EthereumContractAddressLen is the length of contract address strings
	EthereumContractAddressLen = 42

	// EthereumAddressPrefix is the address prefix address
	EthereumAddressPrefix = "0x"
)
View Source
const (
	FIP20TransferToChainPrefix = "chain/"
	FIP20TransferToIBCPrefix   = "ibc/"
)
View Source
const (
	FIP20EventTransferCrossChain = "TransferCrossChain"
)
View Source
const (
	MainnetChainId = "fxcore"
)

mainnet

View Source
const (
	TestnetChainId = "dhobyghaut"
)

testnet

Variables

View Source
var (
	// BypassMinFeeMsgTypesKey defines the configuration key for the
	// BypassMinFeeMsgTypes value.
	// nolint: gosec
	BypassMinFeeMsgTypesKey = "bypass-min-fee.msg-types"

	BypassMinFeeMsgMaxGasUsageKey = "bypass-min-fee.msg-max-gas-usage"
)
View Source
var (
	EthereumAddressRegular = regexp.MustCompile("^0x[0-9a-fA-F]{40}$")
)

Functions

func Byte32ToString

func Byte32ToString(bytes [32]byte) string

func ChainId

func ChainId() string

func EIP155ChainID

func EIP155ChainID() *big.Int

func GetCrossChainMetadata

func GetCrossChainMetadata(name, symbol string, decimals uint32, denom string) banktypes.Metadata

func GetFXMetaData

func GetFXMetaData(denom string) banktypes.Metadata

func GetMetadata

func GetMetadata() []banktypes.Metadata

func IBCRouteBlock

func IBCRouteBlock() int64

func IsEmptyHash

func IsEmptyHash(hash string) bool

IsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash.

func IsZeroEthereumAddress

func IsZeroEthereumAddress(address string) bool

IsZeroEthereumAddress returns true if the address corresponds to an empty ethereum hex address.

func SafeInt64

func SafeInt64(value uint64) (int64, error)

SafeInt64 checks for overflows while casting a uint64 to int64 value.

func SetChainId

func SetChainId(id string)

func SetConfig added in v2.3.0

func SetConfig(isCosmosCoinType bool)

func StringToByte32

func StringToByte32(str string) [32]byte

func SupportDenomManyToOneMsgTypes added in v2.2.0

func SupportDenomManyToOneMsgTypes() []string

SupportDenomManyToOneMsgTypes return msg types use method return to prevent accidental modification

func UpgradeExponential1Block added in v2.3.1

func UpgradeExponential1Block() int64

func UpgradeExponential2Block added in v2.3.1

func UpgradeExponential2Block() int64

func UpgradeTrigonometric1Block added in v2.3.1

func UpgradeTrigonometric1Block() int64

func UpgradeTrigonometric2Block added in v2.3.1

func UpgradeTrigonometric2Block() int64

func ValidateEthereumAddress

func ValidateEthereumAddress(address string) error

ValidateEthereumAddress validates the ethereum address strings

Types

type Contract

type Contract struct {
	Address common.Address
	ABI     abi.ABI
	Bin     []byte
	Code    []byte
	Version string
}

func GetERC1967Proxy

func GetERC1967Proxy() Contract

func GetERC20

func GetERC20() Contract

func GetInitContracts

func GetInitContracts() []Contract

func GetWFX

func GetWFX() Contract

type Fip20TargetType

type Fip20TargetType int
const (
	FIP20TargetUnknown Fip20TargetType = iota
	FIP20TargetChain
	FIP20TargetIBC
)

func (Fip20TargetType) String

func (tt Fip20TargetType) String() string

type TargetIBC

type TargetIBC struct {
	Prefix        string
	SourcePort    string
	SourceChannel string
}

func ParseHexTargetIBC

func ParseHexTargetIBC(hexTargetIbc string) (TargetIBC, bool)

func ParseTargetIBC

func ParseTargetIBC(targetIbc string) (TargetIBC, bool)

type TransferCrossChainEvent

type TransferCrossChainEvent struct {
	From      common.Address
	Recipient string
	Amount    *big.Int
	Fee       *big.Int
	Target    [32]byte
}

func ParseTransferCrossChainEvent

func ParseTransferCrossChainEvent(fip20ABI abi.ABI, log *ethtypes.Log) (*TransferCrossChainEvent, bool, error)

func (*TransferCrossChainEvent) GetAmount

func (event *TransferCrossChainEvent) GetAmount(denom string) sdk.Coin

func (*TransferCrossChainEvent) GetFee

func (event *TransferCrossChainEvent) GetFee(denom string) sdk.Coin

func (*TransferCrossChainEvent) GetFrom

func (event *TransferCrossChainEvent) GetFrom() sdk.AccAddress

func (*TransferCrossChainEvent) GetTarget

func (event *TransferCrossChainEvent) GetTarget() (Fip20TargetType, string)

func (*TransferCrossChainEvent) TotalAmount

func (event *TransferCrossChainEvent) TotalAmount(denom string) sdk.Coins

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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