events

package
v0.0.0-...-b770cea Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClaimTypeUnknown  = ClaimType(0)
	ClaimTypeBurn     = ClaimType(1)
	ClaimTypeLock     = ClaimType(2)
	ClaimTypeWithdraw = ClaimType(3)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BurnEvent

type BurnEvent struct {
	Token         common.Address
	Symbol        string
	Amount        *big.Int
	OwnerFrom     common.Address
	ChainReceiver []byte
	Nonce         *big.Int
}

BurnEvent : struct which represents a BurnEvent event

func UnpackLogBurn

func UnpackLogBurn(contractAbi abi.ABI, eventName string, eventData []byte) (burnEvent *BurnEvent, err error)

UnpackLogBurn ...

type BurnEventOnChain

type BurnEventOnChain struct {
	Token            chainEvmCommon.Hash160Address
	Symbol           string
	Amount           *big.Int
	OwnerFrom        chainEvmCommon.Hash160Address
	EthereumReceiver []byte
	Nonce            *big.Int
}

发生在chainevm上的burn事件,当eth/erc20资产需要提币回到以太坊链上时,会发生该种事件

func UnpackChainLogBurn

func UnpackChainLogBurn(contractAbi abi.ABI, eventName string, eventData []byte) (burnEvent *BurnEventOnChain, err error)

type ChainEvmEvent

type ChainEvmEvent int
const (
	UnsupportedEvent ChainEvmEvent = iota
	//在chain的evm合约中产生了lock事件
	ChainEventLogLock
	//在chain的evm合约中产生了burn事件
	ChainEventLogBurn
	//在chain的evm合约中产生了withdraw事件
	ChainEventLogWithdraw
)

func (ChainEvmEvent) String

func (d ChainEvmEvent) String() string

String : returns the event type as a string

type ChainMsg

type ChainMsg struct {
	ClaimType            ClaimType
	ChainSender          chainEvmCommon.Address
	EthereumReceiver     common.Address
	TokenContractAddress chainEvmCommon.Address
	Symbol               string
	Amount               *big.Int
	TxHash               []byte
	Nonce                int64
	ForwardTimes         int32
	ForwardIndex         int64
}

ChainMsg : contains data from MsgBurn and MsgLock events

func ParseBurnLock4chain

func ParseBurnLock4chain(evmEventType ChainEvmEvent, data []byte, bridgeBankAbi abi.ABI, chainTxHash []byte) (*ChainMsg, error)

ParseBurnLock4chain ParseBurnLockTxReceipt : parses data from a Burn/Lock/Withdraw event witnessed on chain into a ChainMsg struct

type ClaimType

type ClaimType int32

func (ClaimType) String

func (d ClaimType) String() string

type Event

type Event int
const (
	// Unsupported : unsupported Chain or Ethereum event
	Unsupported Event = iota
	// LogLockFromETH : Ethereum event 'LogLock'
	LogLockFromETH
	// LogBurnFromETH : Ethereum event 'LogChainTokenBurn'
	LogBurnFromETH
	// LogProphecyProcessed : Ethereum event LogProphecyProcessed
	LogProphecyProcessed
)

func (Event) String

func (d Event) String() string

此处的名字命令不能随意改动,需要与合约event中的命名完全一致

type LockEvent

type LockEvent struct {
	From   common.Address
	To     []byte
	Token  common.Address
	Symbol string
	Value  *big.Int
	Nonce  *big.Int
}

LockEvent : struct which represents a LogLock event

func UnpackLogLock

func UnpackLogLock(contractAbi abi.ABI, eventName string, eventData []byte) (lockEvent *LockEvent, err error)

UnpackLogLock : Handles new LogLock events

type LockEventOnChain

type LockEventOnChain struct {
	From   chainEvmCommon.Hash160Address
	To     []byte
	Token  chainEvmCommon.Hash160Address
	Symbol string
	Value  *big.Int
	Nonce  *big.Int
}

发生在chainevm上的lock事件,当bty跨链转移到eth时会发生该种事件

func UnpackChainLogLock

func UnpackChainLogLock(contractAbi abi.ABI, eventName string, eventData []byte) (lockEvent *LockEventOnChain, err error)

type LogNewBridgeToken

type LogNewBridgeToken struct {
	Token  common.Address
	Symbol string
}

LogNewBridgeToken ...

type NewProphecyClaimEvent

type NewProphecyClaimEvent struct {
	ProphecyID       *big.Int
	ClaimType        uint8
	ChainSender      []byte
	EthereumReceiver common.Address
	ValidatorAddress common.Address
	TokenAddress     common.Address
	Symbol           string
	Amount           *big.Int
}

NewProphecyClaimEvent : struct which represents a LogNewProphecyClaim event

type NewProphecyProcessed

type NewProphecyProcessed struct {
	ClaimID             [32]byte
	WeightedSignedPower *big.Int
	WeightedTotalPower  *big.Int
	Submitter           common.Address
}

NewProphecyProcessed struct which represents a LogProphecyProcessed

func UnpackLogProphecyProcessed

func UnpackLogProphecyProcessed(contractAbi abi.ABI, eventName string, eventData []byte) (ProphecyProcessedEvent *NewProphecyProcessed, err error)

type WithdrawEventOnChain

type WithdrawEventOnChain struct {
	BridgeToken      chainEvmCommon.Hash160Address
	Symbol           string
	Amount           *big.Int
	OwnerFrom        chainEvmCommon.Hash160Address
	EthereumReceiver []byte
	ProxyReceiver    chainEvmCommon.Hash160Address
	Nonce            *big.Int
}

发生在chain evm上的withdraw事件,当用户发起通过代理人提币交易时,则弹射出该事件信息

func UnpackLogWithdraw

func UnpackLogWithdraw(contractAbi abi.ABI, eventName string, eventData []byte) (withdrawEvent *WithdrawEventOnChain, err error)

Jump to

Keyboard shortcuts

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