deployer

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EOA_UNIVERSAL_DEPLOYER_ADDRESS = common.HexToAddress("0x9c5a87452d4FAC0cbd53BDCA580b20A45526B3AB")
	UNIVERSAL_DEPLOYER_ADDRESS     = common.HexToAddress("0x1b926fbb24a9f78dcdd3272f2d86f5d0660e59c0")
	UNIVERSAL_DEPLOYER_2_ADDRESS   = common.HexToAddress("0x8a5bc19e22d6ad55a2c763b93a75d09f321fe764")
	UNIVERSAL_DEPLOYER_FUNDING     = big.NewInt(1).Mul(big.NewInt(300), big.NewInt(100_000_000_000_000))
	UNIVERSAL_DEPLOYER_TX          = "" /* 536-byte string literal not displayed */

	// expected bytecode for the universal deployer 2. If this changes for whatever reason then the universal
	// deployer's addresses of contracts it's deployed will change, and so will UNIVERSAL_DEPLOYER_2_ADDRESS.
	//
	// do not change this value. it is here to integrity check within the UniversalDeployer. if you do change
	// it however, then make sure to also update UNIVERSAL_DEPLOYER_2_ADDRESS.
	//
	// this value was originally copied from typings/contracts/factories/UniversalDeployer2__factory.ts
	// from https://github.com/0xsequence/sequence.js/blob/master/packages/deployer
	UNIVERSAL_DEPLOYER_2_BYTECODE = common.FromHex("0x608060405234801561001057600080fd5b5061013d806100206000396000f3fe60806040526004361061001e5760003560e01c80639c4ae2d014610023575b600080fd5b6100cb6004803603604081101561003957600080fd5b81019060208101813564010000000081111561005457600080fd5b82018360208201111561006657600080fd5b8035906020019184600183028401116401000000008311171561008857600080fd5b91908080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092955050913592506100cd915050565b005b60008183516020850134f56040805173ffffffffffffffffffffffffffffffffffffffff83168152905191925081900360200190a050505056fea264697066735822122033609f614f03931b92d88c309d698449bb77efcd517328d341fa4f923c5d8c7964736f6c63430007060033")

	UNIVERSAL_DEPLOYER_2_ABI = ethcontract.MustParseABI(`[
    {
      "anonymous": true,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "_addr",
          "type": "address"
        }
      ],
      "name": "Deploy",
      "type": "event"
    },
    {
      "inputs": [
        {
          "internalType": "bytes",
          "name": "_creationCode",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "_instance",
          "type": "uint256"
        }
      ],
      "name": "deploy",
      "outputs": [],
      "stateMutability": "payable",
      "type": "function"
    }
  ]`)
)
View Source
var (
	EIP2740_EOA_DEPLOYER_ADDRESS = common.HexToAddress("0xBb6e024b9cFFACB947A71991E386681B1Cd1477D")
	EIP2740_DEPLOYER_ADDRESS     = common.HexToAddress("0xce0042B868300000d44A59004Da54A005ffdcf9f")
	EIP2740_DEPLOYER_TX          = "" /* 736-byte string literal not displayed */
	EIP2740_DEPLOYER_FUNDING     = big.NewInt(1).Mul(big.NewInt(300), big.NewInt(100_000_000_000_000))

	EIP2740_DEPLOYER_ABI = ethcontract.MustParseABI(`[
    {
        "constant": false,
        "inputs": [
            {
                "internalType": "bytes",
                "name": "_initCode",
                "type": "bytes"
            },
            {
                "internalType": "bytes32",
                "name": "_salt",
                "type": "bytes32"
            }
        ],
        "name": "deploy",
        "outputs": [
            {
                "internalType": "address payable",
                "name": "createdContract",
                "type": "address"
            }
        ],
        "payable": false,
        "stateMutability": "nonpayable",
        "type": "function"
    }
  ]`)
)

Functions

func ComputeCreate2Address

func ComputeCreate2Address(contractABI abi.ABI, contractBin []byte, contractInstance uint, contractArgs ...interface{}) (common.Address, []byte, error)

Types

type EIP2740Deployer added in v0.22.0

type EIP2740Deployer struct {
	Wallet *ethwallet.Wallet
	// contains filtered or unexported fields
}

func NewEIP2740Deployer added in v0.22.0

func NewEIP2740Deployer(wallet *ethwallet.Wallet) (*EIP2740Deployer, error)

func (*EIP2740Deployer) ComputeCreate2Address added in v0.22.0

func (e *EIP2740Deployer) ComputeCreate2Address(contractABI abi.ABI, contractBin []byte, contractInstance uint, contractArgs ...interface{}) (common.Address, []byte, error)

func (*EIP2740Deployer) Deploy added in v0.22.0

func (e *EIP2740Deployer) Deploy(ctx context.Context, contractABI abi.ABI, contractBin []byte, contractInstance uint, txParams interface{}, gasLimit uint, contractArgs ...interface{}) (common.Address, error)

type UniversalDeployer

type UniversalDeployer struct {
	Wallet *ethwallet.Wallet
	// contains filtered or unexported fields
}

func NewUniversalDeployer

func NewUniversalDeployer(wallet *ethwallet.Wallet) (*UniversalDeployer, error)

func (*UniversalDeployer) Deploy

func (u *UniversalDeployer) Deploy(ctx context.Context, contractABI abi.ABI, contractBin []byte, contractInstance uint, txParams interface{}, gasLimit uint, contractArgs ...interface{}) (common.Address, error)

Jump to

Keyboard shortcuts

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