events

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainClient

type ChainClient interface {
	FetchEventLogs(ctx context.Context, contractAddress common.Address, event string, startBlock *big.Int, endBlock *big.Int) ([]ethTypes.Log, error)
}

type Deposit

type Deposit struct {
	// ID of chain deposit will be bridged to
	DestinationDomainID uint8
	// ResourceID used to find address of handler to be used for deposit
	ResourceID types.ResourceID
	// Nonce of deposit
	DepositNonce uint64
	// Address of sender (msg.sender: user)
	SenderAddress common.Address
	// Additional data to be passed to specified handler
	Data []byte
	// ERC20Handler: responds with empty data
	// ERC721Handler: responds with deposited token metadata acquired by calling a tokenURI method in the token contract
	// GenericHandler: responds with the raw bytes returned from the call to the target contract
	HandlerResponse []byte
}

Deposit struct holds event data with all necessary parameters and a handler response https://github.com/devanshubhadouria/chainbridge-solidity/blob/develop/contracts/Bridge.sol#L47

type EventSig

type EventSig string
const (
	DepositSig          EventSig = "Deposit(uint8,bytes32,uint64,address,bytes,bytes)"
	ThresholdChangedSig EventSig = "RelayerThresholdChanged(uint256)"
	ProposalEventSig    EventSig = "ProposalEvent(uint8,uint64,uint8,bytes32)"
	ProposalVoteSig     EventSig = "ProposalVote(uint8,uint64,uint8,bytes32)"
	RegisterTokenSig    EventSig = "RegisterToken(uint8,uint8,uint64,bytes32,address,address,address,address,address,address)"
)

func (EventSig) GetTopic

func (es EventSig) GetTopic() common.Hash

type Listener

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

func NewListener

func NewListener(client ChainClient) *Listener

func (*Listener) FetchDeposits

func (l *Listener) FetchDeposits(ctx context.Context, contractAddress common.Address, startBlock *big.Int, endBlock *big.Int) ([]*Deposit, error)

func (*Listener) FetchRegisterEvents

func (l *Listener) FetchRegisterEvents(ctx context.Context, contractAddress common.Address, startBlock *big.Int, endBlock *big.Int) ([]*RegisterToken, error)

func (*Listener) UnpackDeposit

func (l *Listener) UnpackDeposit(abi abi.ABI, data []byte) (*Deposit, error)

func (*Listener) UnpackRegisterToken

func (l *Listener) UnpackRegisterToken(abi abi.ABI, data []byte) (*RegisterToken, error)

type RegisterToken

type RegisterToken struct {
	Source uint8

	Destination uint8

	DepositNonce uint64

	ResourceId types.ResourceID

	Sourcehandler      common.Address
	Desthandler        common.Address
	DestBridgeAddress  common.Address
	SourceBrigeAddress common.Address
	SourceTokenAddress common.Address
	DestTokenAddress   common.Address
}

Jump to

Keyboard shortcuts

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