contracts

package
v0.0.0-...-1a342eb Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CrossDomainMessengerLegacyRelayMessageEncoding = abi.NewMethod(
		"relayMessage",
		"relayMessage",
		abi.Function,
		"external",
		false,
		true,
		abi.Arguments{
			{Name: "target", Type: addressType},
			{Name: "sender", Type: addressType},
			{Name: "data", Type: bytesType},
			{Name: "nonce", Type: uint256Type},
		},
		abi.Arguments{},
	)
)

Functions

func CrossDomainMessageCalldata

func CrossDomainMessageCalldata(abi *abi.ABI, sentMsg *bindings.CrossDomainMessengerSentMessage, mntValue *big.Int, ethValue *big.Int) ([]byte, error)

func CrossDomainMessageCalldataV0

func CrossDomainMessageCalldataV0(sentMsg *bindings.CrossDomainMessengerSentMessage) ([]byte, error)

func DecodeVersionedNonce

func DecodeVersionedNonce(nonce *big.Int) (uint16, *big.Int)

DecodeVersionNonce is an re-implementation of Encoding.sol#decodeVersionedNonce. If the nonce is greater than 32 bytes (solidity uint256), bytes [32:] are ignored

func L2OutputProposedEvent

func L2OutputProposedEvent(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]worker.StateRoot, error)

func LegacySCCBatchAppendedEvent

func LegacySCCBatchAppendedEvent(chainId string, contractAddress common.Address, db *database.DB, fromHeight, toHeight *big.Int) ([]worker.StateRoot, error)

func UnpackLog

func UnpackLog(out interface{}, log *types.Log, name string, contractAbi *abi.ABI) error

Types

type CrossDomainMessengerRelayedMessageEvent

type CrossDomainMessengerRelayedMessageEvent struct {
	Event       *event.ContractEvent
	MessageHash common.Hash
}

func CrossDomainMessengerRelayedMessageEvents

func CrossDomainMessengerRelayedMessageEvents(chainId string, contractAddress common.Address, db *database.DB, fromHeight, toHeight *big.Int) ([]CrossDomainMessengerRelayedMessageEvent, error)

type CrossDomainMessengerSentMessageEvent

type CrossDomainMessengerSentMessageEvent struct {
	Event                *event.ContractEvent
	Version              uint16
	MessageCalldata      []byte
	MessageHash          common.Hash
	Nonce                *big.Int
	SentMessageEventGUID uuid.UUID
	GasLimit             *big.Int
	FromAddress          common.Address
	ToAddress            common.Address
	ETHAmount            *big.Int
	ERC20Amount          *big.Int
	Data                 utils.Bytes
	HashVersion          uint64
	Timestamp            uint64
}

func CrossDomainMessengerSentMessageEvents

func CrossDomainMessengerSentMessageEvents(contractAddress common.Address, chainId string,
	db *database.DB, fromHeight, toHeight *big.Int) ([]CrossDomainMessengerSentMessageEvent, error)

type L2ToL1MessagePasserMessagePassed

type L2ToL1MessagePasserMessagePassed struct {
	Event          *event.ContractEvent
	WithdrawalHash common.Hash
	GasLimit       *big.Int
	Nonce          *big.Int
	FromAddress    common.Address
	ToAddress      common.Address
	ETHAmount      *big.Int
	ERC20Amount    *big.Int
	Data           utils.Bytes
	Timestamp      uint64
}

func L2ToL1MessagePasserMessagePassedEvents

func L2ToL1MessagePasserMessagePassedEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]L2ToL1MessagePasserMessagePassed, error)

type LegacyBridgeEvent

type LegacyBridgeEvent struct {
	Event                  *event.ContractEvent
	CrossDomainMessageHash *common.Hash
	FromAddress            common.Address
	ToAddress              common.Address
	ETHAmount              *big.Int
	ERC20Amount            *big.Int
	Data                   utils.Bytes
	LocalTokenAddress      common.Address
	RemoteTokenAddress     common.Address
	Timestamp              uint64
}

func L1StandardBridgeLegacyDepositInitiatedEvents

func L1StandardBridgeLegacyDepositInitiatedEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]LegacyBridgeEvent, error)

func L2StandardBridgeLegacyWithdrawalInitiatedEvents

func L2StandardBridgeLegacyWithdrawalInitiatedEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]LegacyBridgeEvent, error)

type LegacyCTCDepositEvent

type LegacyCTCDepositEvent struct {
	Event       *event.ContractEvent
	FromAddress common.Address
	ToAddress   common.Address
	ETHAmount   *big.Int
	ERC20Amount *big.Int
	Data        utils.Bytes
	Timestamp   uint64
	TxHash      common.Hash
	GasLimit    *big.Int
}

func LegacyCTCDepositEvents

func LegacyCTCDepositEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]LegacyCTCDepositEvent, error)

type OptimismPortalProvenWithdrawal

type OptimismPortalProvenWithdrawal struct {
	OutputRoot    [32]byte
	Timestamp     *big.Int
	L2OutputIndex *big.Int
}

type OptimismPortalTransactionDepositEvent

type OptimismPortalTransactionDepositEvent struct {
	Event       *event.ContractEvent
	DepositTx   *common2.DepositTx
	FromAddress common.Address
	ToAddress   common.Address
	ETHAmount   *big.Int
	ERC20Amount *big.Int
	Data        utils.Bytes
	Timestamp   uint64
	GasLimit    *big.Int
}

func OptimismPortalTransactionDepositEvents

func OptimismPortalTransactionDepositEvents(contractAddress common.Address, chainId string, db *database.DB, fromHeight, toHeight *big.Int) ([]OptimismPortalTransactionDepositEvent, error)

type OptimismPortalWithdrawalFinalizedEvent

type OptimismPortalWithdrawalFinalizedEvent struct {
	*bindings.OptimismPortalWithdrawalFinalized
	Event *event.ContractEvent
}

func OptimismPortalWithdrawalFinalizedEvents

func OptimismPortalWithdrawalFinalizedEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]OptimismPortalWithdrawalFinalizedEvent, error)

type OptimismPortalWithdrawalProvenEvent

type OptimismPortalWithdrawalProvenEvent struct {
	*bindings.OptimismPortalWithdrawalProven
	Event *event.ContractEvent
}

func OptimismPortalWithdrawalProvenEvents

func OptimismPortalWithdrawalProvenEvents(contractAddress common.Address, db *database.DB,
	fromHeight, toHeight *big.Int, l1ChainId, l2ChainId string) ([]OptimismPortalWithdrawalProvenEvent, error)

type StandardBridgeFinalizedEvent

type StandardBridgeFinalizedEvent struct {
	Event                  *event.ContractEvent
	CrossDomainMessageHash *common.Hash
	FromAddress            common.Address
	ToAddress              common.Address
	ETHAmount              *big.Int
	ERC20Amount            *big.Int
	Data                   utils.Bytes
	LocalTokenAddress      common.Address
	RemoteTokenAddress     common.Address
	Timestamp              uint64
}

func StandardBridgeFinalizedEvents

func StandardBridgeFinalizedEvents(chainSelector string, contractAddress common.Address, db *database.DB, fromHeight, toHeight *big.Int) ([]StandardBridgeFinalizedEvent, error)

StandardBridgeFinalizedEvents extracts all finalization bridge events from the contracts that follow the StandardBridge ABI. The correlated CrossDomainMessenger nonce is also parsed by looking at the parameters of the corresponding relayMessage transaction data.

type StandardBridgeInitiatedEvent

type StandardBridgeInitiatedEvent struct {
	Event                  *event.ContractEvent
	CrossDomainMessageHash *common.Hash
	FromAddress            common.Address
	ToAddress              common.Address
	ETHAmount              *big.Int
	ERC20Amount            *big.Int
	Data                   utils.Bytes
	LocalTokenAddress      common.Address
	RemoteTokenAddress     common.Address
	Timestamp              uint64
}

func StandardBridgeInitiatedEvents

func StandardBridgeInitiatedEvents(chainId string, contractAddress common.Address, db *database.DB, fromHeight, toHeight *big.Int) ([]StandardBridgeInitiatedEvent, error)

StandardBridgeInitiatedEvents extracts all initiated bridge events from the contracts that follow the StandardBridge ABI. The correlated CrossDomainMessenger nonce is also parsed from the associated messenger events.

Jump to

Keyboard shortcuts

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