bridge

package
v0.0.0-...-d4adcb1 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TxBatchAppendedEventName = "TxBatchAppended"
	// ISequencerInbox.sol functions
	AppendTxBatchFnName = "appendTxBatch"
	// IRollup.sol functions
	StakeFnName                           = "stake"
	AdvanceStakeFnName                    = "advanceStake"
	CreateAssertionFnName                 = "createAssertion"
	ConfirmFirstUnresolvedAssertionFnName = "confirmFirstUnresolvedAssertion"
	RejectFirstUnresolvedAssertionFnName  = "rejectFirstUnresolvedAssertion"

	// IRollup.sol errors (TODO: figure out a work-around to hardcoding)
	NoUnresolvedAssertionErr     = "Error: VM Exception while processing transaction: reverted with custom error 'NoUnresolvedAssertion()'"
	ConfirmationPeriodPendingErr = "Error: VM Exception while processing transaction: reverted with custom error 'ConfirmationPeriodPending()'"
	// L1Oracle.sol functions
	SetL1OracleValues = "setL1OracleValues"

	MethodNumBytes = 4
)

Variables

This section is empty.

Functions

func InboxEvent

func InboxEvent(name string) abi.Event

func UnpackAppendTxBatchInput

func UnpackAppendTxBatchInput(tx *types.Transaction) ([]any, error)

func UnpackBisectExecutionInput

func UnpackBisectExecutionInput(tx *types.Transaction) ([]any, error)

func UnpackCreateAssertionInput

func UnpackCreateAssertionInput(tx *types.Transaction) (common.Hash, *big.Int, error)

func UnpackL1OracleInput

func UnpackL1OracleInput(tx *types.Transaction) (uint64, uint64, uint64, common.Hash, common.Hash, error)

Types

type BridgeClient

type BridgeClient struct {
	*bindings.ISequencerInbox
	*bindings.IRollup
}

func NewBridgeClient

func NewBridgeClient(backend bind.ContractBackend, cfg ProtocolConfig) (*BridgeClient, error)

func (*BridgeClient) GetAssertion

func (c *BridgeClient) GetAssertion(ctx context.Context, assertionID *big.Int) (bindings.IRollupAssertion, error)

func (*BridgeClient) GetLastConfirmedAssertionID

func (c *BridgeClient) GetLastConfirmedAssertionID(ctx context.Context) (*big.Int, error)

func (*BridgeClient) GetRequiredStakeAmount

func (c *BridgeClient) GetRequiredStakeAmount(ctx context.Context) (*big.Int, error)

func (*BridgeClient) GetStaker

func (*BridgeClient) RequireFirstUnresolvedAssertionIsConfirmable

func (c *BridgeClient) RequireFirstUnresolvedAssertionIsConfirmable(ctx context.Context) error

type EthTxManager

type EthTxManager interface {
	Send(ctx context.Context, candidate txmgr.TxCandidate) (*types.Receipt, error)
}

type ProtocolConfig

type ProtocolConfig interface {
	GetSequencerInboxAddr() common.Address
	GetRollupAddr() common.Address
}

type TxManager

type TxManager struct {
	EthTxManager
	// contains filtered or unexported fields
}

Adds bridge contract method bindings to EthTxManager.

func NewTxManager

func NewTxManager(txMgr EthTxManager, cfg bridgeConfig) (*TxManager, error)

func (*TxManager) AdvanceStake

func (m *TxManager) AdvanceStake(ctx context.Context, assertionID *big.Int) (*types.Receipt, error)

func (*TxManager) AppendTxBatch

func (m *TxManager) AppendTxBatch(
	ctx context.Context,
	batch []byte,
) (*types.Receipt, error)

func (*TxManager) ConfirmFirstUnresolvedAssertion

func (m *TxManager) ConfirmFirstUnresolvedAssertion(ctx context.Context) (*types.Receipt, error)

func (*TxManager) CreateAssertion

func (m *TxManager) CreateAssertion(ctx context.Context, vmHash common.Hash, blockNum *big.Int) (*types.Receipt, error)

func (*TxManager) RejectFirstUnresolvedAssertion

func (m *TxManager) RejectFirstUnresolvedAssertion(ctx context.Context, stakerAddress common.Address) (*types.Receipt, error)

func (*TxManager) Stake

func (m *TxManager) Stake(ctx context.Context, stakeAmount *big.Int) (*types.Receipt, error)

Jump to

Keyboard shortcuts

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