deployer

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChainID = big.NewInt(1337)

ChainID is the chain id used for simulated backends

View Source
var TestAddress = crypto.PubkeyToAddress(TestKey.PublicKey)
View Source
var TestKey, _ = crypto.HexToECDSA("b71c71a67e1177ad4e901695e1b4b9ee17ae16c6668d313eac2f96dbcda3f291")

TestKey is the same test key that geth uses

Functions

func DeployWithDeterministicDeployer added in v1.4.0

func DeployWithDeterministicDeployer(backend *backends.SimulatedBackend, contractName string) ([]byte, error)

DeployWithDeterministicDeployer deploys a smart contract on a simulated Ethereum blockchain using a deterministic deployment proxy (Arachnid's).

Parameters: - backend: A pointer to backends.SimulatedBackend, representing the simulated Ethereum blockchain. Expected to have Arachnid's proxy deployer predeploys at 0x4e59b44847b379578588920cA78FbF26c0B4956C, NewL2BackendWithChainIDAndPredeploys handles this for you. - contractName: A string representing the name of the contract to be deployed.

Returns: - []byte: The deployed bytecode of the contract. - error: An error object indicating any issues encountered during the deployment process.

The function logs a fatal error and exits if there are any issues with transaction mining, if the deployment fails, or if the deployed bytecode is not found at the computed address.

func NewBackendWithGenesisTimestamp

func NewBackendWithGenesisTimestamp(chainID *big.Int, ts uint64, shanghai bool, predeploys map[string]*common.Address) (*backends.SimulatedBackend, error)

func NewL1Backend added in v1.2.0

func NewL1Backend() (*backends.SimulatedBackend, error)

NewL1Backend returns a SimulatedBackend suitable for L1. It has the latest L1 hardforks enabled.

func NewL2Backend added in v1.2.0

func NewL2Backend() (*backends.SimulatedBackend, error)

NewL2Backend returns a SimulatedBackend suitable for L2. It has the latest L2 hardforks enabled.

func NewL2BackendWithChainIDAndPredeploys added in v1.4.0

func NewL2BackendWithChainIDAndPredeploys(chainID *big.Int, predeploys map[string]*common.Address) (*backends.SimulatedBackend, error)

NewL2BackendWithChainIDAndPredeploys returns a SimulatedBackend suitable for L2. It has the latest L2 hardforks enabled, and allows for the configuration of the network's chain ID and predeploys.

Types

type Constructor

type Constructor struct {
	Name string
	Args []interface{}
}

type Deployment

type Deployment struct {
	Name     string
	Bytecode hexutil.Bytes
	Address  common.Address
}

func Deploy

func Deploy(backend *backends.SimulatedBackend, constructors []Constructor, cb Deployer) ([]Deployment, error)

type SuperchainPredeploy added in v1.3.0

type SuperchainPredeploy struct {
	Name     string
	CodeHash common.Hash
}

Jump to

Keyboard shortcuts

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