Documentation
¶
Index ¶
- Constants
- Variables
- func BlockGasLimit(ctx sdk.Context) uint64
- func Byte32ToString(bytes [32]byte) string
- func ChangeNetworkForTest(newNetwork string)
- func CrossChainSupportBscBlock() int64
- func CrossChainSupportPolygonAndTronBlock() int64
- func EIP155ChainID() *big.Int
- func EvmV0ClearKVStores() []string
- func EvmV0SupportBlock() int64
- func EvmV1SupportBlock() int64
- func GetFxBankMetaData(denom string) banktypes.Metadata
- func GetMetadata() []banktypes.Metadata
- func GravityPruneValsetAndAttestationBlock() int64
- func GravityValsetSlashBlock() int64
- func IsEmptyHash(hash string) bool
- func IsRequestBatchBaseFee(height int64) bool
- func IsZeroAddress(address string) bool
- func Network() string
- func NetworkDevnet() string
- func NetworkMainnet() string
- func NetworkTestnet() string
- func NewInfiniteGasMeterWithLimit(limit sdk.Gas) sdk.GasMeter
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func RequestBatchBaseFeeBlock() int64
- func SafeInt64(value uint64) (int64, error)
- func StringToByte32(str string) [32]byte
- func ValidateAddress(address string) error
- func ValidateAddressIgnoreChecksum(address string) error
- func ValidateNonZeroAddress(address string) error
- type Contract
- type ErrorGasOverflow
- type ErrorNegativeGasConsumed
- type EthAccount
- func (*EthAccount) Descriptor() ([]byte, []int)
- func (m *EthAccount) Marshal() (dAtA []byte, err error)
- func (m *EthAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EthAccount) ProtoMessage()
- func (m *EthAccount) Reset()
- func (m *EthAccount) Size() (n int)
- func (m *EthAccount) Unmarshal(dAtA []byte) error
- func (m *EthAccount) XXX_DiscardUnknown()
- func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EthAccount) XXX_Merge(src proto.Message)
- func (m *EthAccount) XXX_Size() int
- func (m *EthAccount) XXX_Unmarshal(b []byte) error
- type ExtensionOptionsWeb3Tx
- func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
- func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
- func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionOptionsWeb3Tx) ProtoMessage()
- func (m *ExtensionOptionsWeb3Tx) Reset()
- func (m *ExtensionOptionsWeb3Tx) Size() (n int)
- func (m *ExtensionOptionsWeb3Tx) String() string
- func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
- func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
- func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
- func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
- func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
- type ExtensionOptionsWeb3TxI
- type Fip20TargetType
- type HDPathIterator
- type TargetIBC
- type TransferCrossChainEvent
- func (event *TransferCrossChainEvent) GetAmount(denom string) sdk.Coin
- func (event *TransferCrossChainEvent) GetFee(denom string) sdk.Coin
- func (event *TransferCrossChainEvent) GetFrom() sdk.AccAddress
- func (event *TransferCrossChainEvent) GetTarget() (Fip20TargetType, string)
- func (event *TransferCrossChainEvent) TotalAmount(denom string) sdk.Coins
Constants ¶
const ( Name = "fxcore" AddressPrefix = "fx" DefaultDenom = "FX" // BaseDenomUnit defines the base denomination unit for Photons. // 1 FX = 1x10^{BaseDenomUnit} fx BaseDenomUnit = 18 // DefaultGasPrice is default gas price for evm transactions 500Gwei DefaultGasPrice = 500000000000 )
const ( EmptyEvmAddress = "0x0000000000000000000000000000000000000000" FIP20LogicAddress = "0x0000000000000000000000000000000000001001" WFXLogicAddress = "0x0000000000000000000000000000000000001002" )
const ( FIP20TransferToChainPrefix = "chain/" FIP20TransferToIBCPrefix = "ibc/" )
const ExternalContractAddressLen = 42
ExternalContractAddressLen is the length of contract address strings
const (
FIP20EventTransferCrossChain = "TransferCrossChain"
)
const (
// ProtocolVersion is the latest supported version of the eth protocol.
ProtocolVersion = eth65
)
Constants to match up protocol versions and messages
Variables ¶
var ( ErrInvalidLengthAccount = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAccount = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAccount = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthWeb3 = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWeb3 = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupWeb3 = fmt.Errorf("proto: unexpected end of group") )
var ( // BIP44HDPath is the default BIP44 HD path used on Ethereum. BIP44HDPath = ethaccounts.DefaultBaseDerivationPath.String() )
var ChainID = "fxcore"
var (
ExternalAddressRegular = regexp.MustCompile("^0x[0-9a-fA-F]{40}$")
)
Functions ¶
func BlockGasLimit ¶
BlockGasLimit returns the max gas (limit) defined in the block gas meter. If the meter is not set, it returns the max gas from the application consensus params. NOTE: see https://github.com/cosmos/cosmos-sdk/issues/9514 for full reference
func Byte32ToString ¶
func ChangeNetworkForTest ¶
func ChangeNetworkForTest(newNetwork string)
ChangeNetworkForTest change network for test
func CrossChainSupportBscBlock ¶
func CrossChainSupportBscBlock() int64
func CrossChainSupportPolygonAndTronBlock ¶
func CrossChainSupportPolygonAndTronBlock() int64
func EIP155ChainID ¶
func EvmV0ClearKVStores ¶
func EvmV0ClearKVStores() []string
func EvmV0SupportBlock ¶
func EvmV0SupportBlock() int64
func EvmV1SupportBlock ¶
func EvmV1SupportBlock() int64
func GetFxBankMetaData ¶
func GetMetadata ¶
func GravityPruneValsetAndAttestationBlock ¶
func GravityPruneValsetAndAttestationBlock() int64
func GravityValsetSlashBlock ¶
func GravityValsetSlashBlock() int64
func IsEmptyHash ¶
IsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash.
func IsRequestBatchBaseFee ¶
func IsZeroAddress ¶
IsZeroAddress returns true if the address corresponds to an empty ethereum hex address.
func NetworkDevnet ¶
func NetworkDevnet() string
func NetworkMainnet ¶
func NetworkMainnet() string
func NetworkTestnet ¶
func NetworkTestnet() string
func NewInfiniteGasMeterWithLimit ¶
NewInfiniteGasMeterWithLimit returns a reference to a new infiniteGasMeter.
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
func RequestBatchBaseFeeBlock ¶
func RequestBatchBaseFeeBlock() int64
func StringToByte32 ¶
func ValidateAddress ¶
ValidateAddress validates the ethereum address strings
func ValidateNonZeroAddress ¶
ValidateNonZeroAddress returns an error if the provided string is not a hex formatted string address or is equal to zero
Types ¶
type Contract ¶
func GetERC1967Proxy ¶
func GetInitContracts ¶
func GetInitContracts() []Contract
func GetUpgradeContracts ¶
type ErrorGasOverflow ¶
type ErrorGasOverflow struct {
Descriptor string
}
ErrorGasOverflow defines an error thrown when an action results gas consumption unsigned integer overflow.
type ErrorNegativeGasConsumed ¶
type ErrorNegativeGasConsumed struct {
Descriptor string
}
ErrorNegativeGasConsumed defines an error thrown when the amount of gas refunded results in a negative gas consumed amount. Copied from cosmos-sdk
type EthAccount ¶
type EthAccount struct {
*types.BaseAccount `` /* 136-byte string literal not displayed */
CodeHash string `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty" yaml:"code_hash"`
}
EthAccount implements the authtypes.AccountI interface and embeds an authtypes.BaseAccount type. It is compatible with the auth AccountKeeper.
func (*EthAccount) Descriptor ¶
func (*EthAccount) Descriptor() ([]byte, []int)
func (*EthAccount) Marshal ¶
func (m *EthAccount) Marshal() (dAtA []byte, err error)
func (*EthAccount) MarshalToSizedBuffer ¶
func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EthAccount) ProtoMessage ¶
func (*EthAccount) ProtoMessage()
func (*EthAccount) Reset ¶
func (m *EthAccount) Reset()
func (*EthAccount) Size ¶
func (m *EthAccount) Size() (n int)
func (*EthAccount) Unmarshal ¶
func (m *EthAccount) Unmarshal(dAtA []byte) error
func (*EthAccount) XXX_DiscardUnknown ¶
func (m *EthAccount) XXX_DiscardUnknown()
func (*EthAccount) XXX_Marshal ¶
func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EthAccount) XXX_Merge ¶
func (m *EthAccount) XXX_Merge(src proto.Message)
func (*EthAccount) XXX_Size ¶
func (m *EthAccount) XXX_Size() int
func (*EthAccount) XXX_Unmarshal ¶
func (m *EthAccount) XXX_Unmarshal(b []byte) error
type ExtensionOptionsWeb3Tx ¶
type ExtensionOptionsWeb3Tx struct {
// typed data chain id used only in EIP712 Domain and should match
// Ethereum network ID in a Web3 provider (e.g. Metamask).
TypedDataChainID uint64 `protobuf:"varint,1,opt,name=typed_data_chain_id,json=typedDataChainId,proto3" json:"typedDataChainID,omitempty"`
// fee payer is an account address for the fee payer. It will be validated
// during EIP712 signature checking.
FeePayer string `protobuf:"bytes,2,opt,name=fee_payer,json=feePayer,proto3" json:"feePayer,omitempty"`
// fee payer sig is a signature data from the fee paying account,
// allows to perform fee delegation when using EIP712 Domain.
FeePayerSig []byte `protobuf:"bytes,3,opt,name=fee_payer_sig,json=feePayerSig,proto3" json:"feePayerSig,omitempty"`
}
func (*ExtensionOptionsWeb3Tx) Descriptor ¶
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
func (*ExtensionOptionsWeb3Tx) Marshal ¶
func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
func (*ExtensionOptionsWeb3Tx) MarshalTo ¶
func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) MarshalToSizedBuffer ¶
func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) ProtoMessage ¶
func (*ExtensionOptionsWeb3Tx) ProtoMessage()
func (*ExtensionOptionsWeb3Tx) Reset ¶
func (m *ExtensionOptionsWeb3Tx) Reset()
func (*ExtensionOptionsWeb3Tx) Size ¶
func (m *ExtensionOptionsWeb3Tx) Size() (n int)
func (*ExtensionOptionsWeb3Tx) String ¶
func (m *ExtensionOptionsWeb3Tx) String() string
func (*ExtensionOptionsWeb3Tx) Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
func (*ExtensionOptionsWeb3Tx) XXX_DiscardUnknown ¶
func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
func (*ExtensionOptionsWeb3Tx) XXX_Marshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionOptionsWeb3Tx) XXX_Merge ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
func (*ExtensionOptionsWeb3Tx) XXX_Size ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
func (*ExtensionOptionsWeb3Tx) XXX_Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
type ExtensionOptionsWeb3TxI ¶
type ExtensionOptionsWeb3TxI interface{}
type Fip20TargetType ¶
type Fip20TargetType int
const ( FIP20TargetUnknown Fip20TargetType = iota FIP20TargetChain FIP20TargetIBC )
func (Fip20TargetType) String ¶
func (tt Fip20TargetType) String() string
type HDPathIterator ¶
type HDPathIterator func() ethaccounts.DerivationPath
func NewHDPathIterator ¶
func NewHDPathIterator(basePath string, ledgerIter bool) (HDPathIterator, error)
NewHDPathIterator receives a base path as a string and a boolean for the desired iterator type and returns a function that iterates over the base HD path, returning the string.
type TransferCrossChainEvent ¶
type TransferCrossChainEvent struct {
From common.Address
Recipient string
Amount *big.Int
Fee *big.Int
Target [32]byte
}
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