Documentation
¶
Index ¶
- Variables
- func CrossDomainMessageHash(abi *abi.ABI, sentMsg *bindings.CrossDomainMessengerSentMessage, ...) (common.Hash, error)
- func DecodeVersionedNonce(nonce *big.Int) (uint16, *big.Int)
- func UnpackLog(out interface{}, log *types.Log, name string, contractAbi *abi.ABI) error
- type CrossDomainMessengerRelayedMessageEvent
- type CrossDomainMessengerSentMessageEvent
- type L1Processor
- type L2Contracts
- type L2Processor
- type L2ToL1MessagePasserMessagePassed
- type OptimismPortalProvenWithdrawal
- type OptimismPortalTransactionDepositEvent
- type OptimismPortalWithdrawalFinalizedEvent
- type OptimismPortalWithdrawalProvenEvent
- type ProcessFn
- type ProcessedContractEventLogIndexKey
- type ProcessedContractEvents
- type StandardBridgeFinalizedEvent
- type StandardBridgeInitiatedEvent
Constants ¶
This section is empty.
Variables ¶
var ( // Standard ABI types copied from golang ABI tests Uint256Type, _ = abi.NewType("uint256", "", nil) BytesType, _ = abi.NewType("bytes", "", nil) AddressType, _ = abi.NewType("address", "", nil) LegacyCrossDomainMessengerRelayMessageMethod = abi.NewMethod( "relayMessage", "relayMessage", abi.Function, "external", false, true, abi.Arguments{ {Name: "sender", Type: AddressType}, {Name: "target", Type: AddressType}, {Name: "data", Type: BytesType}, {Name: "nonce", Type: Uint256Type}, }, abi.Arguments{}, ) )
Functions ¶
func CrossDomainMessageHash ¶ added in v1.1.4
func CrossDomainMessageHash(abi *abi.ABI, sentMsg *bindings.CrossDomainMessengerSentMessage, value *big.Int) (common.Hash, error)
Replica of `Hashing.sol#hashCrossDomainMessage` solidity implementation
func DecodeVersionedNonce ¶ added in v1.1.4
DecodeVersionNonce is an re-implementation of Encoding.sol#decodeVersionedNonce. If the nonce is greater than 32 bytes (solidity uint256), bytes [32:] are ignored
Types ¶
type CrossDomainMessengerRelayedMessageEvent ¶ added in v1.1.4
type CrossDomainMessengerRelayedMessageEvent struct {
*bindings.CrossDomainMessengerRelayedMessage
Event *database.ContractEvent
}
func CrossDomainMessengerRelayedMessageEvents ¶ added in v1.1.4
func CrossDomainMessengerRelayedMessageEvents(events *ProcessedContractEvents) ([]CrossDomainMessengerRelayedMessageEvent, error)
type CrossDomainMessengerSentMessageEvent ¶ added in v1.1.4
type CrossDomainMessengerSentMessageEvent struct {
*bindings.CrossDomainMessengerSentMessage
Value *big.Int
MessageHash common.Hash
Event *database.ContractEvent
}
func CrossDomainMessengerSentMessageEvents ¶ added in v1.1.4
func CrossDomainMessengerSentMessageEvents(events *ProcessedContractEvents) ([]CrossDomainMessengerSentMessageEvent, error)
type L1Processor ¶
type L1Processor struct {
// contains filtered or unexported fields
}
func NewL1Processor ¶
func NewL1Processor(logger log.Logger, ethClient node.EthClient, db *database.DB, l1Contracts config.L1Contracts) (*L1Processor, error)
func (L1Processor) LatestProcessedHeader ¶
func (*L1Processor) PauseForTest ¶
func (p *L1Processor) PauseForTest()
func (*L1Processor) ResumeForTest ¶
func (p *L1Processor) ResumeForTest()
type L2Contracts ¶
type L2Contracts struct {
L2CrossDomainMessenger common.Address
L2StandardBridge common.Address
L2ERC721Bridge common.Address
L2ToL1MessagePasser common.Address
}
func L2ContractPredeploys ¶
func L2ContractPredeploys() L2Contracts
func (L2Contracts) ToSlice ¶
func (c L2Contracts) ToSlice() []common.Address
type L2Processor ¶
type L2Processor struct {
// contains filtered or unexported fields
}
func NewL2Processor ¶
func NewL2Processor(logger log.Logger, ethClient node.EthClient, db *database.DB, l2Contracts L2Contracts) (*L2Processor, error)
func (L2Processor) LatestProcessedHeader ¶
func (*L2Processor) PauseForTest ¶
func (p *L2Processor) PauseForTest()
func (*L2Processor) ResumeForTest ¶
func (p *L2Processor) ResumeForTest()
type L2ToL1MessagePasserMessagePassed ¶ added in v1.1.4
type L2ToL1MessagePasserMessagePassed struct {
*bindings.L2ToL1MessagePasserMessagePassed
Event *database.ContractEvent
}
func L2ToL1MessagePasserMessagesPassed ¶ added in v1.1.4
func L2ToL1MessagePasserMessagesPassed(events *ProcessedContractEvents) ([]L2ToL1MessagePasserMessagePassed, error)
type OptimismPortalTransactionDepositEvent ¶ added in v1.1.4
type OptimismPortalTransactionDepositEvent struct {
*bindings.OptimismPortalTransactionDeposited
DepositTx *types.DepositTx
Event *database.ContractEvent
}
func OptimismPortalTransactionDepositEvents ¶ added in v1.1.4
func OptimismPortalTransactionDepositEvents(events *ProcessedContractEvents) ([]OptimismPortalTransactionDepositEvent, error)
type OptimismPortalWithdrawalFinalizedEvent ¶ added in v1.1.4
type OptimismPortalWithdrawalFinalizedEvent struct {
*bindings.OptimismPortalWithdrawalFinalized
Event *database.ContractEvent
}
func OptimismPortalWithdrawalFinalizedEvents ¶ added in v1.1.4
func OptimismPortalWithdrawalFinalizedEvents(events *ProcessedContractEvents) ([]OptimismPortalWithdrawalFinalizedEvent, error)
type OptimismPortalWithdrawalProvenEvent ¶
type OptimismPortalWithdrawalProvenEvent struct {
*bindings.OptimismPortalWithdrawalProven
Event *database.ContractEvent
}
func OptimismPortalWithdrawalProvenEvents ¶
func OptimismPortalWithdrawalProvenEvents(events *ProcessedContractEvents) ([]OptimismPortalWithdrawalProvenEvent, error)
type ProcessFn ¶
ProcessFn is the the entrypoint for processing a batch of headers. In the event of failure, database operations are rolled back
type ProcessedContractEventLogIndexKey ¶
type ProcessedContractEventLogIndexKey struct {
// contains filtered or unexported fields
}
type ProcessedContractEvents ¶
type ProcessedContractEvents struct {
// contains filtered or unexported fields
}
func NewProcessedContractEvents ¶
func NewProcessedContractEvents() *ProcessedContractEvents
func (*ProcessedContractEvents) AddLog ¶
func (p *ProcessedContractEvents) AddLog(log *types.Log, time uint64) *database.ContractEvent
type StandardBridgeFinalizedEvent ¶
type StandardBridgeFinalizedEvent struct {
// We hardcode to ERC20 since ETH can be pseudo-represented as an ERC20 utilizing
// the hardcoded ETH address
*bindings.StandardBridgeERC20BridgeFinalized
CrossDomainMessageHash common.Hash
Event *database.ContractEvent
}
func StandardBridgeFinalizedEvents ¶
func StandardBridgeFinalizedEvents(events *ProcessedContractEvents) ([]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 {
// We hardcode to ERC20 since ETH can be pseudo-represented as an ERC20 utilizing
// the hardcoded ETH address
*bindings.StandardBridgeERC20BridgeInitiated
CrossDomainMessageHash common.Hash
Event *database.ContractEvent
}
func StandardBridgeInitiatedEvents ¶
func StandardBridgeInitiatedEvents(events *ProcessedContractEvents) ([]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.