shared

package
v1.16.13 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 32 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrFor

func AddrFor(t *testing.T, dk *devkeys.MnemonicDevKeys, key devkeys.Key) common.Address

AddrFor generates an address for a given role

func DefaultPrivkey

func DefaultPrivkey(t *testing.T) (string, *ecdsa.PrivateKey, *devkeys.MnemonicDevKeys)

DefaultPrivkey returns the default private key for testing

func DeployDummyCaller

func DeployDummyCaller(t *testing.T, rpcClient *rpc.Client, afactsFS foundry.StatDirFs, prank, opcmAddr common.Address)

DeployDummyCaller deploys DummyCaller at the prank address with the given OPCM address.

func NewChainIntent

func NewChainIntent(t *testing.T, dk *devkeys.MnemonicDevKeys, l1ChainID *big.Int, l2ChainID *uint256.Int, gasLimit uint64) *state.ChainIntent

func NewIntent

func NewIntent(
	t *testing.T,
	l1ChainID *big.Int,
	dk *devkeys.MnemonicDevKeys,
	l2ChainID *uint256.Int,
	l1Loc *artifacts.Locator,
	l2Loc *artifacts.Locator,
	gasLimit uint64,
) (*state.Intent, *state.State)

func RunPastUpgrades

func RunPastUpgrades(t *testing.T, host *script.Host, chainID uint64, prank common.Address, systemConfigProxy common.Address)

RunPastUpgrades executes all past OPCM upgrades in-memory only (no broadcast). It fetches OPCM addresses from the superchain-registry, queries their actual versions on-chain, and applies upgrades in version order, skipping any that have already been applied.

func RunPastUpgradesWithRPC

func RunPastUpgradesWithRPC(t *testing.T, l1RPCUrl string, afactsFS foundry.StatDirFs, lgr log.Logger, chainID uint64, prank common.Address, systemConfigProxy common.Address)

RunPastUpgradesWithRPC runs past upgrades and broadcasts them using Anvil impersonation. It fetches OPCM data from the superchain-registry and applies upgrades in version order, skipping any upgrades that have already been applied based on SystemConfig.lastUsedOPCMVersion().

Types

type ContractCaller

type ContractCaller interface {
	Call(to common.Address, data []byte) ([]byte, error)
}

ContractCaller abstracts contract calls for both script.Host and ethclient.Client

type HostCaller

type HostCaller struct {
	Host *script.Host
}

HostCaller adapts script.Host to ContractCaller

func (*HostCaller) Call

func (h *HostCaller) Call(to common.Address, data []byte) ([]byte, error)

type ImpersonationBroadcaster

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

ImpersonationBroadcaster broadcasts transactions using Anvil impersonation.

func NewImpersonationBroadcaster

func NewImpersonationBroadcaster(lgr log.Logger, client *ethclient.Client, rpcClient *rpc.Client, from common.Address, chainID *big.Int) *ImpersonationBroadcaster

func (*ImpersonationBroadcaster) Broadcast

func (*ImpersonationBroadcaster) Hook

func (b *ImpersonationBroadcaster) Hook(bcast script.Broadcast)

type RPCCaller

type RPCCaller struct {
	Ctx    context.Context
	Client *ethclient.Client
}

RPCCaller adapts ethclient.Client to ContractCaller

func (*RPCCaller) Call

func (r *RPCCaller) Call(to common.Address, data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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