contracts

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddLeavesCall = errors.New("tx is not a valid addLeaves call")
)

Functions

This section is empty.

Types

type DisputeGameFactoryContract

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

func NewDisputeGameFactoryContract

func NewDisputeGameFactoryContract(addr common.Address, caller *batching.MultiCaller) (*DisputeGameFactoryContract, error)

func (*DisputeGameFactoryContract) GetAllGames added in v1.5.0

func (f *DisputeGameFactoryContract) GetAllGames(ctx context.Context, blockHash common.Hash) ([]types.GameMetadata, error)

func (*DisputeGameFactoryContract) GetGame

func (f *DisputeGameFactoryContract) GetGame(ctx context.Context, idx uint64, blockHash common.Hash) (types.GameMetadata, error)

func (*DisputeGameFactoryContract) GetGameCount

func (f *DisputeGameFactoryContract) GetGameCount(ctx context.Context, blockHash common.Hash) (uint64, error)

func (*DisputeGameFactoryContract) GetGameImpl added in v1.5.0

func (f *DisputeGameFactoryContract) GetGameImpl(ctx context.Context, gameType uint32) (common.Address, error)

type FaultDisputeGameContract

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

func NewFaultDisputeGameContract

func NewFaultDisputeGameContract(addr common.Address, caller *batching.MultiCaller) (*FaultDisputeGameContract, error)

func (*FaultDisputeGameContract) AttackTx

func (f *FaultDisputeGameContract) AttackTx(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) CallResolve

func (*FaultDisputeGameContract) CallResolveClaim

func (f *FaultDisputeGameContract) CallResolveClaim(ctx context.Context, claimIdx uint64) error

func (*FaultDisputeGameContract) ClaimCredit added in v1.5.0

func (f *FaultDisputeGameContract) ClaimCredit(recipient common.Address) (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) DefendTx

func (f *FaultDisputeGameContract) DefendTx(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) GetAbsolutePrestateHash

func (f *FaultDisputeGameContract) GetAbsolutePrestateHash(ctx context.Context) (common.Hash, error)

func (*FaultDisputeGameContract) GetAllClaims

func (f *FaultDisputeGameContract) GetAllClaims(ctx context.Context) ([]types.Claim, error)

func (*FaultDisputeGameContract) GetBlockRange added in v1.4.3

func (c *FaultDisputeGameContract) GetBlockRange(ctx context.Context) (prestateBlock uint64, poststateBlock uint64, retErr error)

GetBlockRange returns the block numbers of the absolute pre-state block (typically genesis or the bedrock activation block) and the post-state block (that the proposed output root is for).

func (*FaultDisputeGameContract) GetClaim

func (f *FaultDisputeGameContract) GetClaim(ctx context.Context, idx uint64) (types.Claim, error)

func (*FaultDisputeGameContract) GetClaimCount

func (f *FaultDisputeGameContract) GetClaimCount(ctx context.Context) (uint64, error)

func (*FaultDisputeGameContract) GetCredit added in v1.5.0

func (c *FaultDisputeGameContract) GetCredit(ctx context.Context, receipient common.Address) (*big.Int, error)

func (*FaultDisputeGameContract) GetGameDuration

func (f *FaultDisputeGameContract) GetGameDuration(ctx context.Context) (uint64, error)

func (*FaultDisputeGameContract) GetGenesisOutputRoot added in v1.4.3

func (c *FaultDisputeGameContract) GetGenesisOutputRoot(ctx context.Context) (common.Hash, error)

func (*FaultDisputeGameContract) GetL1Head

func (*FaultDisputeGameContract) GetMaxGameDepth

func (f *FaultDisputeGameContract) GetMaxGameDepth(ctx context.Context) (types.Depth, error)

func (*FaultDisputeGameContract) GetOracle added in v1.5.0

func (*FaultDisputeGameContract) GetRequiredBond added in v1.4.3

func (c *FaultDisputeGameContract) GetRequiredBond(ctx context.Context, position types.Position) (*big.Int, error)

func (*FaultDisputeGameContract) GetSplitDepth added in v1.4.3

func (c *FaultDisputeGameContract) GetSplitDepth(ctx context.Context) (types.Depth, error)

func (*FaultDisputeGameContract) GetStatus

func (*FaultDisputeGameContract) ResolveClaimTx

func (f *FaultDisputeGameContract) ResolveClaimTx(claimIdx uint64) (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) ResolveTx

func (f *FaultDisputeGameContract) ResolveTx() (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) StepTx

func (f *FaultDisputeGameContract) StepTx(claimIdx uint64, isAttack bool, stateData []byte, proof []byte) (txmgr.TxCandidate, error)

func (*FaultDisputeGameContract) UpdateOracleTx

func (f *FaultDisputeGameContract) UpdateOracleTx(ctx context.Context, claimIdx uint64, data *types.PreimageOracleData) (txmgr.TxCandidate, error)

type PreimageOracleContract

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

PreimageOracleContract is a binding that works with contracts implementing the IPreimageOracle interface

func NewPreimageOracleContract

func NewPreimageOracleContract(addr common.Address, caller *batching.MultiCaller) (*PreimageOracleContract, error)

func (*PreimageOracleContract) AddGlobalDataTx

func (*PreimageOracleContract) AddLeaves added in v1.5.0

func (c *PreimageOracleContract) AddLeaves(uuid *big.Int, startingBlockIndex *big.Int, input []byte, commitments []common.Hash, finalize bool) (txmgr.TxCandidate, error)

func (*PreimageOracleContract) Addr added in v1.5.0

func (*PreimageOracleContract) CallSqueeze added in v1.5.0

func (c *PreimageOracleContract) CallSqueeze(
	ctx context.Context,
	claimant common.Address,
	uuid *big.Int,
	stateMatrix *matrix.StateMatrix,
	preState keccakTypes.Leaf,
	preStateProof merkle.Proof,
	postState keccakTypes.Leaf,
	postStateProof merkle.Proof,
) error

func (*PreimageOracleContract) ChallengePeriod added in v1.5.0

func (c *PreimageOracleContract) ChallengePeriod(ctx context.Context) (uint64, error)

ChallengePeriod returns the challenge period for large preimages.

func (*PreimageOracleContract) ChallengeTx added in v1.5.0

func (*PreimageOracleContract) DecodeInputData added in v1.5.0

func (c *PreimageOracleContract) DecodeInputData(data []byte) (*big.Int, keccakTypes.InputData, error)

DecodeInputData returns the UUID and keccakTypes.InputData being added to the preimage via a addLeavesLPP call. An ErrInvalidAddLeavesCall error is returned if the call is not a valid call to addLeavesLPP. Otherwise, the uuid and input data is returned. The raw data supplied is returned so long as it can be parsed. Specifically the length of the input data is not validated to ensure it is consistent with the number of commitments.

func (*PreimageOracleContract) GetActivePreimages added in v1.5.0

func (c *PreimageOracleContract) GetActivePreimages(ctx context.Context, blockHash common.Hash) ([]keccakTypes.LargePreimageMetaData, error)

func (*PreimageOracleContract) GetInputDataBlocks added in v1.5.0

func (c *PreimageOracleContract) GetInputDataBlocks(ctx context.Context, block batching.Block, ident keccakTypes.LargePreimageIdent) ([]uint64, error)

func (*PreimageOracleContract) GetProposalMetadata added in v1.5.0

func (*PreimageOracleContract) GlobalDataExists added in v1.5.0

func (c *PreimageOracleContract) GlobalDataExists(ctx context.Context, data *types.PreimageOracleData) (bool, error)

func (*PreimageOracleContract) InitLargePreimage added in v1.5.0

func (c *PreimageOracleContract) InitLargePreimage(uuid *big.Int, partOffset uint32, claimedSize uint32) (txmgr.TxCandidate, error)

func (*PreimageOracleContract) MinLargePreimageSize added in v1.5.0

func (c *PreimageOracleContract) MinLargePreimageSize(ctx context.Context) (uint64, error)

MinLargePreimageSize returns the minimum size of a large preimage.

func (*PreimageOracleContract) Squeeze added in v1.5.0

func (c *PreimageOracleContract) Squeeze(
	claimant common.Address,
	uuid *big.Int,
	stateMatrix *matrix.StateMatrix,
	preState keccakTypes.Leaf,
	preStateProof merkle.Proof,
	postState keccakTypes.Leaf,
	postStateProof merkle.Proof,
) (txmgr.TxCandidate, error)

type Proposal

type Proposal struct {
	L2BlockNumber *big.Int
	OutputRoot    common.Hash
}

type VMContract

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

VMContract is a binding that works with contracts implementing the IBigStepper interface

func NewVMContract

func NewVMContract(addr common.Address, caller *batching.MultiCaller) (*VMContract, error)

func (*VMContract) Oracle

Jump to

Keyboard shortcuts

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