Documentation ¶
Index ¶
- Variables
- type DelayedWETHContract
- type DisputeGameFactoryContract
- func (f *DisputeGameFactoryContract) CreateTx(ctx context.Context, traceType uint32, outputRoot common.Hash, ...) (txmgr.TxCandidate, error)
- func (f *DisputeGameFactoryContract) GetAllGames(ctx context.Context, blockHash common.Hash) ([]types.GameMetadata, error)
- func (f *DisputeGameFactoryContract) GetGame(ctx context.Context, idx uint64, blockHash common.Hash) (types.GameMetadata, error)
- func (f *DisputeGameFactoryContract) GetGameCount(ctx context.Context, blockHash common.Hash) (uint64, error)
- func (f *DisputeGameFactoryContract) GetGameFromParameters(ctx context.Context, traceType uint32, outputRoot common.Hash, ...) (common.Address, error)
- func (f *DisputeGameFactoryContract) GetGameImpl(ctx context.Context, gameType uint32) (common.Address, error)
- func (f *DisputeGameFactoryContract) GetGamesAtOrAfter(ctx context.Context, blockHash common.Hash, earliestTimestamp uint64) ([]types.GameMetadata, error)
- type FaultDisputeGameContract
- func (f *FaultDisputeGameContract) AttackTx(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) CallResolve(ctx context.Context) (gameTypes.GameStatus, error)
- func (f *FaultDisputeGameContract) CallResolveClaim(ctx context.Context, claimIdx uint64) error
- func (f *FaultDisputeGameContract) ClaimCreditTx(ctx context.Context, recipient common.Address) (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) DefendTx(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) GetAbsolutePrestateHash(ctx context.Context) (common.Hash, error)
- func (f *FaultDisputeGameContract) GetAllClaims(ctx context.Context, block rpcblock.Block) ([]types.Claim, error)
- func (f *FaultDisputeGameContract) GetBalance(ctx context.Context, block rpcblock.Block) (*big.Int, common.Address, error)
- func (f *FaultDisputeGameContract) GetBlockRange(ctx context.Context) (prestateBlock uint64, poststateBlock uint64, retErr error)
- func (f *FaultDisputeGameContract) GetClaim(ctx context.Context, idx uint64) (types.Claim, error)
- func (f *FaultDisputeGameContract) GetClaimCount(ctx context.Context) (uint64, error)
- func (f *FaultDisputeGameContract) GetCredit(ctx context.Context, recipient common.Address) (*big.Int, gameTypes.GameStatus, error)
- func (f *FaultDisputeGameContract) GetCredits(ctx context.Context, block rpcblock.Block, recipients ...common.Address) ([]*big.Int, error)
- func (f *FaultDisputeGameContract) GetGameMetadata(ctx context.Context, block rpcblock.Block) (common.Hash, uint64, common.Hash, gameTypes.GameStatus, uint64, error)
- func (f *FaultDisputeGameContract) GetL1Head(ctx context.Context) (common.Hash, error)
- func (f *FaultDisputeGameContract) GetMaxClockDuration(ctx context.Context) (time.Duration, error)
- func (f *FaultDisputeGameContract) GetMaxGameDepth(ctx context.Context) (types.Depth, error)
- func (f *FaultDisputeGameContract) GetOracle(ctx context.Context) (*PreimageOracleContract, error)
- func (f *FaultDisputeGameContract) GetRequiredBond(ctx context.Context, position types.Position) (*big.Int, error)
- func (f *FaultDisputeGameContract) GetRequiredBonds(ctx context.Context, block rpcblock.Block, positions ...*big.Int) ([]*big.Int, error)
- func (f *FaultDisputeGameContract) GetSplitDepth(ctx context.Context) (types.Depth, error)
- func (f *FaultDisputeGameContract) GetStartingRootHash(ctx context.Context) (common.Hash, error)
- func (f *FaultDisputeGameContract) GetStatus(ctx context.Context) (gameTypes.GameStatus, error)
- func (f *FaultDisputeGameContract) GetWithdrawals(ctx context.Context, block rpcblock.Block, gameAddr common.Address, ...) ([]*WithdrawalRequest, error)
- func (f *FaultDisputeGameContract) IsResolved(ctx context.Context, block rpcblock.Block, claims ...types.Claim) ([]bool, error)
- func (f *FaultDisputeGameContract) ResolveClaimTx(claimIdx uint64) (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) ResolveTx() (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) StepTx(claimIdx uint64, isAttack bool, stateData []byte, proof []byte) (txmgr.TxCandidate, error)
- func (f *FaultDisputeGameContract) UpdateOracleTx(ctx context.Context, claimIdx uint64, data *types.PreimageOracleData) (txmgr.TxCandidate, error)
- type PreimageOracleContract
- func (c *PreimageOracleContract) AddGlobalDataTx(data *types.PreimageOracleData) (txmgr.TxCandidate, error)
- func (c *PreimageOracleContract) AddLeaves(uuid *big.Int, startingBlockIndex *big.Int, input []byte, ...) (txmgr.TxCandidate, error)
- func (c *PreimageOracleContract) Addr() common.Address
- func (c *PreimageOracleContract) CallSqueeze(ctx context.Context, claimant common.Address, uuid *big.Int, ...) error
- func (c *PreimageOracleContract) ChallengePeriod(ctx context.Context) (uint64, error)
- func (c *PreimageOracleContract) ChallengeTx(ident keccakTypes.LargePreimageIdent, challenge keccakTypes.Challenge) (txmgr.TxCandidate, error)
- func (c *PreimageOracleContract) DecodeInputData(data []byte) (*big.Int, keccakTypes.InputData, error)
- func (c *PreimageOracleContract) GetActivePreimages(ctx context.Context, blockHash common.Hash) ([]keccakTypes.LargePreimageMetaData, error)
- func (c *PreimageOracleContract) GetInputDataBlocks(ctx context.Context, block rpcblock.Block, ...) ([]uint64, error)
- func (c *PreimageOracleContract) GetMinBondLPP(ctx context.Context) (*big.Int, error)
- func (c *PreimageOracleContract) GetProposalMetadata(ctx context.Context, block rpcblock.Block, ...) ([]keccakTypes.LargePreimageMetaData, error)
- func (c *PreimageOracleContract) GetProposalTreeRoot(ctx context.Context, block rpcblock.Block, ...) (common.Hash, error)
- func (c *PreimageOracleContract) GlobalDataExists(ctx context.Context, data *types.PreimageOracleData) (bool, error)
- func (c *PreimageOracleContract) InitLargePreimage(uuid *big.Int, partOffset uint32, claimedSize uint32) (txmgr.TxCandidate, error)
- func (c *PreimageOracleContract) MinLargePreimageSize(ctx context.Context) (uint64, error)
- func (c *PreimageOracleContract) Squeeze(claimant common.Address, uuid *big.Int, ...) (txmgr.TxCandidate, error)
- type Proposal
- type VMContract
- type WithdrawalRequest
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidAddLeavesCall = errors.New("tx is not a valid addLeaves call") ErrInvalidPreimageKey = errors.New("invalid preimage key") ErrUnsupportedKeyType = errors.New("unsupported preimage key type") )
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 NewDisputeGameFactoryContract ¶
func NewDisputeGameFactoryContract(m metrics.ContractMetricer, addr common.Address, caller *batching.MultiCaller) *DisputeGameFactoryContract
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 (*DisputeGameFactoryContract) GetGameFromParameters ¶ added in v1.5.1
func (*DisputeGameFactoryContract) GetGameImpl ¶ added in v1.5.0
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 (f *FaultDisputeGameContract) CallResolve(ctx context.Context) (gameTypes.GameStatus, error)
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 (*FaultDisputeGameContract) GetAllClaims ¶
func (*FaultDisputeGameContract) GetBalance ¶ added in v1.7.2
func (f *FaultDisputeGameContract) GetBalance(ctx context.Context, block rpcblock.Block) (*big.Int, common.Address, error)
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) GetClaimCount ¶
func (f *FaultDisputeGameContract) GetClaimCount(ctx context.Context) (uint64, error)
func (*FaultDisputeGameContract) GetCredit ¶ added in v1.5.0
func (f *FaultDisputeGameContract) GetCredit(ctx context.Context, recipient common.Address) (*big.Int, gameTypes.GameStatus, error)
func (*FaultDisputeGameContract) GetCredits ¶ added in v1.6.1
func (*FaultDisputeGameContract) GetGameMetadata ¶ added in v1.5.1
func (f *FaultDisputeGameContract) GetGameMetadata(ctx context.Context, block rpcblock.Block) (common.Hash, uint64, common.Hash, gameTypes.GameStatus, uint64, error)
GetGameMetadata returns the game's L1 head, L2 block number, root claim, status, and max clock duration.
func (*FaultDisputeGameContract) GetMaxClockDuration ¶ added in v1.7.4
func (*FaultDisputeGameContract) GetMaxGameDepth ¶
func (*FaultDisputeGameContract) GetOracle ¶ added in v1.5.0
func (f *FaultDisputeGameContract) GetOracle(ctx context.Context) (*PreimageOracleContract, error)
func (*FaultDisputeGameContract) GetRequiredBond ¶ added in v1.4.3
func (*FaultDisputeGameContract) GetRequiredBonds ¶ added in v1.7.3
func (*FaultDisputeGameContract) GetSplitDepth ¶ added in v1.4.3
func (*FaultDisputeGameContract) GetStartingRootHash ¶ added in v1.7.2
func (*FaultDisputeGameContract) GetStatus ¶
func (f *FaultDisputeGameContract) GetStatus(ctx context.Context) (gameTypes.GameStatus, error)
func (*FaultDisputeGameContract) GetWithdrawals ¶ added in v1.7.3
func (*FaultDisputeGameContract) IsResolved ¶ added in v1.7.4
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 (c *PreimageOracleContract) AddGlobalDataTx(data *types.PreimageOracleData) (txmgr.TxCandidate, error)
func (*PreimageOracleContract) Addr ¶ added in v1.5.0
func (c *PreimageOracleContract) Addr() common.Address
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 (c *PreimageOracleContract) ChallengeTx(ident keccakTypes.LargePreimageIdent, challenge keccakTypes.Challenge) (txmgr.TxCandidate, error)
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 (*PreimageOracleContract) GetProposalMetadata ¶ added in v1.5.0
func (c *PreimageOracleContract) GetProposalMetadata(ctx context.Context, block rpcblock.Block, idents ...keccakTypes.LargePreimageIdent) ([]keccakTypes.LargePreimageMetaData, error)
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 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 ¶
func (c *VMContract) Oracle(ctx context.Context) (*PreimageOracleContract, error)