contracts

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidAddLeavesCall = errors.New("tx is not a valid addLeaves call")
	ErrInvalidPreimageKey   = errors.New("invalid preimage key")
	ErrUnsupportedKeyType   = errors.New("unsupported preimage key type")
)
View Source
var ErrSimulationFailed = errors.New("tx simulation failed")

Functions

This section is empty.

Types

type DelayedWETHContract added in v1.7.3

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

func NewDelayedWETHContract added in v1.7.3

func NewDelayedWETHContract(metrics metrics.ContractMetricer, addr common.Address, caller *batching.MultiCaller) *DelayedWETHContract

func (*DelayedWETHContract) GetWithdrawals added in v1.7.3

func (d *DelayedWETHContract) GetWithdrawals(ctx context.Context, block rpcblock.Block, gameAddr common.Address, recipients ...common.Address) ([]*WithdrawalRequest, error)

GetWithdrawals returns all withdrawals made from the contract since the given block.

type DisputeGameFactoryContract

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

func (*DisputeGameFactoryContract) CreateTx added in v1.5.1

func (f *DisputeGameFactoryContract) CreateTx(ctx context.Context, traceType uint32, outputRoot common.Hash, l2BlockNum uint64) (txmgr.TxCandidate, 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) GetGameFromParameters added in v1.5.1

func (f *DisputeGameFactoryContract) GetGameFromParameters(ctx context.Context, traceType uint32, outputRoot common.Hash, l2BlockNum uint64) (common.Address, error)

func (*DisputeGameFactoryContract) GetGameImpl added in v1.5.0

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

func (*DisputeGameFactoryContract) GetGamesAtOrAfter added in v1.5.1

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

type FaultDisputeGameContract

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

func NewFaultDisputeGameContract

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

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) ClaimCreditTx added in v1.7.3

func (f *FaultDisputeGameContract) ClaimCreditTx(ctx context.Context, 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, block rpcblock.Block) ([]types.Claim, error)

func (*FaultDisputeGameContract) GetBalance added in v1.7.2

GetBalance returns the total amount of ETH controlled by this contract. Note that the ETH is actually held by the DelayedWETH contract which may be shared by multiple games. Returns the balance and the address of the contract that actually holds the balance.

func (*FaultDisputeGameContract) GetBlockRange added in v1.4.3

func (f *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 (*FaultDisputeGameContract) GetCredits added in v1.6.1

func (f *FaultDisputeGameContract) GetCredits(ctx context.Context, block rpcblock.Block, recipients ...common.Address) ([]*big.Int, error)

func (*FaultDisputeGameContract) GetGameMetadata added in v1.5.1

GetGameMetadata returns the game's L1 head, L2 block number, root claim, status, and max clock duration.

func (*FaultDisputeGameContract) GetL1Head

func (*FaultDisputeGameContract) GetMaxClockDuration added in v1.7.4

func (f *FaultDisputeGameContract) GetMaxClockDuration(ctx context.Context) (time.Duration, error)

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 (f *FaultDisputeGameContract) GetRequiredBond(ctx context.Context, position types.Position) (*big.Int, error)

func (*FaultDisputeGameContract) GetRequiredBonds added in v1.7.3

func (f *FaultDisputeGameContract) GetRequiredBonds(ctx context.Context, block rpcblock.Block, positions ...*big.Int) ([]*big.Int, error)

func (*FaultDisputeGameContract) GetSplitDepth added in v1.4.3

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

func (*FaultDisputeGameContract) GetStartingRootHash added in v1.7.2

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

func (*FaultDisputeGameContract) GetStatus

func (*FaultDisputeGameContract) GetWithdrawals added in v1.7.3

func (f *FaultDisputeGameContract) GetWithdrawals(ctx context.Context, block rpcblock.Block, gameAddr common.Address, recipients ...common.Address) ([]*WithdrawalRequest, error)

func (*FaultDisputeGameContract) IsResolved added in v1.7.4

func (f *FaultDisputeGameContract) IsResolved(ctx context.Context, block rpcblock.Block, claims ...types.Claim) ([]bool, error)

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

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,
	prestateMatrix keccakTypes.StateSnapshot,
	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 rpcblock.Block, ident keccakTypes.LargePreimageIdent) ([]uint64, error)

func (*PreimageOracleContract) GetMinBondLPP added in v1.7.0

func (c *PreimageOracleContract) GetMinBondLPP(ctx context.Context) (*big.Int, error)

func (*PreimageOracleContract) GetProposalMetadata added in v1.5.0

func (*PreimageOracleContract) GetProposalTreeRoot added in v1.5.1

func (c *PreimageOracleContract) GetProposalTreeRoot(ctx context.Context, block rpcblock.Block, ident keccakTypes.LargePreimageIdent) (common.Hash, error)

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,
	prestateMatrix keccakTypes.StateSnapshot,
	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

func (*VMContract) Oracle

type WithdrawalRequest added in v1.7.3

type WithdrawalRequest struct {
	Amount    *big.Int
	Timestamp *big.Int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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