types

package
v3.1.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 21 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 (
	// 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
const (
	LegacyERC20Target = "module/evm"
	ERC20Target       = "erc20"
	GravityTarget     = "gravity"
	EthTarget         = "eth"

	LegacyChainPrefix = "chain/"
	IBCPrefix         = "ibc/"
)
View Source
const (
	MainnetChainId = "fxcore"
)

mainnet

View Source
const (
	TestnetChainId = "dhobyghaut"
)

testnet

Variables

This section is empty.

Functions

func Byte32ToString

func Byte32ToString(bytes [32]byte) string

func ChainId

func ChainId() string

func ChainIdWithEIP155

func ChainIdWithEIP155() string

func EIP155ChainID

func EIP155ChainID() *big.Int

func GetCrossChainMetadata

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

func GetDefaultNodeHome

func GetDefaultNodeHome() string

func GetFXMetaData

func GetFXMetaData(denom string) banktypes.Metadata

func GetIbcDenomTrace

func GetIbcDenomTrace(denom string, channelIBC string) (ibctransfertypes.DenomTrace, error)

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 MustABIJson

func MustABIJson(str string) abi.ABI

func MustDecodeHex

func MustDecodeHex(str string) []byte

func MustStrToByte32

func MustStrToByte32(str string) [32]byte

func SetChainId

func SetChainId(id string)

func SetConfig

func SetConfig(isCosmosCoinType bool)

func StrToByte32

func StrToByte32(s string) ([32]byte, error)

func ValidateEthereumAddress

func ValidateEthereumAddress(address string) error

ValidateEthereumAddress validates the ethereum address strings

func ValidateMetadata

func ValidateMetadata(md banktypes.Metadata) error

Types

type Contract

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

func GetERC1967Proxy

func GetERC1967Proxy() Contract

func GetERC20

func GetERC20() Contract

func GetWFX

func GetWFX() Contract

func (Contract) CodeHash

func (c Contract) CodeHash() common.Hash

type FxTarget

type FxTarget struct {
	Prefix        string
	SourcePort    string
	SourceChannel string
	// contains filtered or unexported fields
}

func ParseFxTarget

func ParseFxTarget(targetStr string) FxTarget

func (FxTarget) GetTarget

func (i FxTarget) GetTarget() string

func (FxTarget) IBCValidate

func (i FxTarget) IBCValidate() bool

func (FxTarget) IsIBC

func (i FxTarget) IsIBC() bool

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

func (*Router) AddRoute

func (rtr *Router) AddRoute(module string, hook TransactionHook) *Router

func (*Router) GetRoute

func (rtr *Router) GetRoute(module string) (TransactionHook, bool)

func (*Router) Seal

func (rtr *Router) Seal()

Seal prevents the Router from any subsequent route handlers to be registered. Seal will panic if called more than once.

func (*Router) Sealed

func (rtr *Router) Sealed() bool

type TransactionHook

type TransactionHook interface {
	TransferAfter(ctx sdk.Context, sender, receive string, coins, fee sdk.Coin) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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