logic

package
v0.0.0-...-8b5660e Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeFunc = "func"
	TypeTri  = "tri"
)

Variables

View Source
var (
	L2WatchCounterCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "reddio",
			Subsystem: "logic_l2_watch",
			Name:      "counter",
			Help:      "Total Counter for l2 watcher",
		},
		[]string{TypeFunc, TypeTri},
	)
)

Functions

This section is empty.

Types

type ETHLocked

type ETHLocked struct {
	ParentSender   common.Address
	ChildRecipient common.Address
	Amount         *big.Int
}

type HistoryLogic

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

HistoryLogic services.

func NewHistoryLogic

func NewHistoryLogic(db *gorm.DB) *HistoryLogic

NewHistoryLogic returns bridge history services.

func (*HistoryLogic) GetL2UnclaimedWithdrawalsByAddress

func (h *HistoryLogic) GetL2UnclaimedWithdrawalsByAddress(ctx context.Context, address string, page, pageSize uint64) ([]*types.TxHistoryInfo, uint64, error)

GetL2UnclaimedWithdrawalsByAddress gets all unclaimed withdrawal txs under given address.

func (*HistoryLogic) GetTxsByAddress

func (h *HistoryLogic) GetTxsByAddress(ctx context.Context, address string, page, pageSize uint64) ([]*types.TxHistoryInfo, uint64, error)

GetL2UnclaimedWithdrawalsByAddress gets all unclaimed withdrawal txs under given address.

type L1EventParser

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

L1EventParser the l1 event parser

func NewL1EventParser

func NewL1EventParser(cfg *evm.GethConfig) *L1EventParser

NewL1EventParser creates l1 event parser

func (*L1EventParser) ParseDepositEventToRawBridgeEvents

func (e *L1EventParser) ParseDepositEventToRawBridgeEvents(ctx context.Context, msg *contract.ParentBridgeCoreFacetQueueTransaction) ([]*orm.RawBridgeEvent, error)

func (*L1EventParser) ParseL1CrossChainPayloadToRefundMsg

func (e *L1EventParser) ParseL1CrossChainPayloadToRefundMsg(ctx context.Context, msg *orm.CrossMessage, receipt *types.Receipt) ([]*orm.CrossMessage, error)

func (*L1EventParser) ParseL1EventToRawBridgeEvents

func (e *L1EventParser) ParseL1EventToRawBridgeEvents(ctx context.Context, logs []types.Log) ([]*orm.RawBridgeEvent, []*orm.RawBridgeEvent, error)

****************************

  • [RawBridgeEvent] * ****************************

func (*L1EventParser) ParseL1RawBridgeEventToCrossChainMessage

func (e *L1EventParser) ParseL1RawBridgeEventToCrossChainMessage(ctx context.Context, msg *orm.RawBridgeEvent, tx *types.Transaction) ([]*orm.CrossMessage, error)

ParseL1CrossChainEventLogs parse l1 cross chain event logs

func (*L1EventParser) ParseL1RelayMessagePayload

func (e *L1EventParser) ParseL1RelayMessagePayload(ctx context.Context, msg *orm.RawBridgeEvent) (*orm.CrossMessage, error)

****************************

  • [CrossMessages] * ****************************

ParseL1CrossChainEventLogs parse l1 cross chain event logs

func (*L1EventParser) ParseL1RelayedMessageToRawBridgeEvents

func (e *L1EventParser) ParseL1RelayedMessageToRawBridgeEvents(ctx context.Context, msg *contract.UpwardMessageDispatcherFacetRelayedMessage) ([]*orm.RawBridgeEvent, error)

func (*L1EventParser) ParseL1SingleRawBridgeEventToCrossChainMessage

func (e *L1EventParser) ParseL1SingleRawBridgeEventToCrossChainMessage(ctx context.Context, bridgeEvent *orm.RawBridgeEvent, tx *types.Transaction) ([]*orm.CrossMessage, error)

ParseL1SingleCrossChainEventLogs parses L1 watched single cross chain events.

type L2ERC20TokenBurnt

type L2ERC20TokenBurnt struct {
	TokenAddress    common.Address // address
	ChildSender     common.Address // address
	ParentRecipient common.Address // address
	Amount          *big.Int       // uint256
}

L2ERC20TokenBurnt represent the structure of the event logs ParentERC20TokenBurnt from ChildTokenMessageTransmitterFacet.sol

type L2ETHBurnt

type L2ETHBurnt struct {
	ChildSender     common.Address // address
	ParentRecipient common.Address // address
	Amount          *big.Int       // uint256
}

L2ETHBurnt represent the structure of the event logs ParentEthBurnt from ChildTokenMessageTransmitterFacet.sol

type L2Erc1155BatchTokenBurnt

type L2Erc1155BatchTokenBurnt struct {
	TokenAddress    common.Address // address
	ChildSender     common.Address // address
	ParentRecipient common.Address // address
	TokenIDs        []*big.Int     // uint256[]
	Amounts         []*big.Int     // uint256[]
}

L2Erc1155BatchTokenBurnt represent the structure of the event logs ParentERC1155TokenBurnt from ChildTokenMessageTransmitterFacet.sol

type L2Erc721TokenBurnt

type L2Erc721TokenBurnt struct {
	TokenAddress    common.Address // address
	ChildSender     common.Address // address
	ParentRecipient common.Address // address
	TokenID         *big.Int       // uint256
}

L2Erc721TokenBurnt represent the structure of the event logs ParentERC721TokenBurnt from ChildTokenMessageTransmitterFacet.sol

type L2EventParser

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

L2EventParser the l1 event parser

func NewL2EventParser

func NewL2EventParser(cfg *evm.GethConfig) *L2EventParser

NewL2EventParser creates l1 event parser

func (*L2EventParser) ParseL2EventLogs

func (e *L2EventParser) ParseL2EventLogs(ctx context.Context, logs []types.Log) ([]*orm.RawBridgeEvent, []*orm.RawBridgeEvent, error)

ParseL2EventLogs parses L2 watchedevents

func (*L2EventParser) ParseL2EventToRawBridgeEvents

func (e *L2EventParser) ParseL2EventToRawBridgeEvents(ctx context.Context, logs []types.Log) ([]*orm.RawBridgeEvent, []*orm.RawBridgeEvent, error)

func (*L2EventParser) ParseL2RawBridgeEventToCrossChainMessage

func (e *L2EventParser) ParseL2RawBridgeEventToCrossChainMessage(ctx context.Context, msg *orm.RawBridgeEvent) ([]*orm.CrossMessage, error)

func (*L2EventParser) ParseL2RelayMessagePayload

func (e *L2EventParser) ParseL2RelayMessagePayload(ctx context.Context, msg *orm.RawBridgeEvent) (*orm.CrossMessage, error)

ParseL2RelayMessagePayload parses a single L2 relay message payload

func (*L2EventParser) ParseL2SingleRawBridgeEventToCrossChainMessage

func (e *L2EventParser) ParseL2SingleRawBridgeEventToCrossChainMessage(ctx context.Context, bridgeEvent *orm.RawBridgeEvent) ([]*orm.CrossMessage, error)

ParseL2SingleCrossChainEventLogs parses L2 watched single cross chain events.

type L2REDBurnt

type L2REDBurnt struct {
	TokenAddress    common.Address // address
	ChildSender     common.Address // address
	ParentRecipient common.Address // address
	Amount          *big.Int       // uint256
}

L2REDBurnt represent the structure of the event logs ParentREDTokenBurnt from ChildTokenMessageTransmitterFacet.sol

type L2WatcherLogic

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

func NewL2WatcherLogic

func NewL2WatcherLogic(cfg *evm.GethConfig, solidity *evm.Solidity) (*L2WatcherLogic, error)

func (*L2WatcherLogic) FilterLogs

func (f *L2WatcherLogic) FilterLogs(ctx context.Context, block *yutypes.Block, criteria ethereum.FilterQuery) ([]types.Log, error)

func (*L2WatcherLogic) GetBlockWithRetry

func (f *L2WatcherLogic) GetBlockWithRetry(height yucommon.BlockNum, retries int, delay time.Duration) (*yutypes.Block, error)

func (*L2WatcherLogic) GetEthReceiptWithRetry

func (f *L2WatcherLogic) GetEthReceiptWithRetry(txHash common.Hash, retries int, delay time.Duration) (*types.Receipt, error)

func (*L2WatcherLogic) L2FetcherBridgeEventsFromLogs

func (f *L2WatcherLogic) L2FetcherBridgeEventsFromLogs(ctx context.Context, block *yutypes.Block, l2BlockCollectionDepth *big.Int) ([]*orm.RawBridgeEvent, []*orm.RawBridgeEvent, map[uint64]uint64, error)

L2FetcherUpwardMessageFromLogs collects upward messages from the logs of the current block and the previous l2BlockCollectionDepth blocks.

type ParentERC1155TokenLocked

type ParentERC1155TokenLocked struct {
	TokenAddress   common.Address
	ParentSender   common.Address
	ChildRecipient common.Address
	TokenIds       []*big.Int
	Amounts        []*big.Int
}

type ParentERC20TokenLocked

type ParentERC20TokenLocked struct {
	TokenAddress   common.Address
	TokenName      string
	TokenSymbol    string
	Decimals       *big.Int
	ParentSender   common.Address
	ChildRecipient common.Address
	Amount         *big.Int
}

type ParentERC721TokenLocked

type ParentERC721TokenLocked struct {
	TokenAddress   common.Address
	TokenName      string
	TokenSymbol    string
	ParentSender   common.Address
	ChildRecipient common.Address
	TokenId        *big.Int
}

type ParentREDTokenLocked

type ParentREDTokenLocked struct {
	TokenAddress   common.Address
	ParentSender   common.Address
	ChildRecipient common.Address
	Amount         *big.Int
}

Jump to

Keyboard shortcuts

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