events

package
v0.0.0-...-e2eb64c Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

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

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
	Chain33Receiver []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 BurnEventOnChain33

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

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

func UnpackChain33LogBurn

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

type Chain33EvmEvent

type Chain33EvmEvent int
const (
	UnsupportedEvent Chain33EvmEvent = iota
	//在chain33的evm合约中产生了lock事件
	Chain33EventLogLock
	//在chain33的evm合约中产生了burn事件
	Chain33EventLogBurn
)

func (Chain33EvmEvent) String

func (d Chain33EvmEvent) String() string

String : returns the event type as a string

type Chain33Msg

type Chain33Msg struct {
	ClaimType            ClaimType
	Chain33Sender        chain33EvmCommon.Address
	EthereumReceiver     common.Address
	TokenContractAddress chain33EvmCommon.Address
	Symbol               string
	Amount               *big.Int
	TxHash               []byte
	Nonce                int64
}

Chain33Msg : contains data from MsgBurn and MsgLock events

func ParseBurnLock4chain33

func ParseBurnLock4chain33(evmEventType Chain33EvmEvent, data []byte, bridgeBankAbi abi.ABI, chain33TxHash []byte) (*Chain33Msg, error)

ParseBurnLock4chain33 ParseBurnLockTxReceipt : parses data from a Burn/Lock event witnessed on chain33 into a Chain33Msg struct

type ClaimType

type ClaimType int32

func (ClaimType) String

func (d ClaimType) String() string

type Event

type Event int
const (
	// Unsupported : unsupported Chain33 or Ethereum event
	Unsupported Event = iota
	// LogLockFromETH : Ethereum event 'LogLock'
	LogLockFromETH
	// LogBurnFromETH : Ethereum event 'LogChain33TokenBurn'
	LogBurnFromETH
)

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 LockEventOnChain33

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

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

func UnpackChain33LogLock

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

type LogNewBridgeToken

type LogNewBridgeToken struct {
	Token  common.Address
	Symbol string
}

LogNewBridgeToken ...

type NewProphecyClaimEvent

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

NewProphecyClaimEvent : struct which represents a LogNewProphecyClaim event

Jump to

Keyboard shortcuts

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