// Code generated by abigen. DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.

package contracts

import (
	"fmt"
	"math/big"
	"reflect"
	"strings"

	"github.com/erigontech/erigon/common"
	"github.com/erigontech/erigon/common/event"
	"github.com/erigontech/erigon/execution/abi"
	"github.com/erigontech/erigon/execution/abi/bind"
	"github.com/erigontech/erigon/execution/types"
)

// Reference imports to suppress errors if they are not otherwise used.
var (
	_ = big.NewInt
	_ = strings.NewReader
	_ = bind.Bind
	_ = common.Big1
	_ = types.BloomLookup
	_ = event.NewSubscription
	_ = fmt.Errorf
	_ = reflect.ValueOf
)

// SelfDestructFactoryABI is the input ABI used to generate the binding from.
const SelfDestructFactoryABI = "[{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\"}],\"name\":\"deploy\",\"outputs\":[{\"internalType\":\"contractSelfDestructInConstructor\",\"name\":\"instance\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"}]"

// SelfDestructFactoryBin is the compiled bytecode used for deploying new contracts.
var SelfDestructFactoryBin = "0x608060405234801561000f575f80fd5b5060da8061001c5f395ff3fe608060405260043610601b575f3560e01c80632b85ba3814601f575b5f80fd5b602e602a3660046086565b604a565b6040516001600160a01b03909116815260200160405180910390f35b5f8134604051605790607b565b82906040518091039083f5915050801580156074573d5f803e3d5ffd5b5092915050565b600880609d83390190565b5f602082840312156095575f80fd5b503591905056fe608060405230fffea26469706673582212200ff3a6aa0c0f57f4a7028aae793c41576dddc1149986d12146b7d5c1f984f3b664736f6c63430008180033"

// DeploySelfDestructFactory deploys a new Ethereum contract, binding an instance of SelfDestructFactory to it.
func DeploySelfDestructFactory(auth *bind.TransactOpts, backend bind.ContractBackend) (common.Address, types.Transaction, *SelfDestructFactory, error) {
	parsed, err := abi.JSON(strings.NewReader(SelfDestructFactoryABI))
	if err != nil {
		return common.Address{}, nil, nil, err
	}

	address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(SelfDestructFactoryBin), backend)
	if err != nil {
		return common.Address{}, nil, nil, err
	}
	return address, tx, &SelfDestructFactory{SelfDestructFactoryCaller: SelfDestructFactoryCaller{contract: contract}, SelfDestructFactoryTransactor: SelfDestructFactoryTransactor{contract: contract}, SelfDestructFactoryFilterer: SelfDestructFactoryFilterer{contract: contract}}, nil
}

// SelfDestructFactory is an auto generated Go binding around an Ethereum contract.
type SelfDestructFactory struct {
	SelfDestructFactoryCaller     // Read-only binding to the contract
	SelfDestructFactoryTransactor // Write-only binding to the contract
	SelfDestructFactoryFilterer   // Log filterer for contract events
}

// SelfDestructFactoryCaller is an auto generated read-only Go binding around an Ethereum contract.
type SelfDestructFactoryCaller struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// SelfDestructFactoryTransactor is an auto generated write-only Go binding around an Ethereum contract.
type SelfDestructFactoryTransactor struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// SelfDestructFactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type SelfDestructFactoryFilterer struct {
	contract *bind.BoundContract // Generic contract wrapper for the low level calls
}

// SelfDestructFactorySession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type SelfDestructFactorySession struct {
	Contract     *SelfDestructFactory // Generic contract binding to set the session for
	CallOpts     bind.CallOpts        // Call options to use throughout this session
	TransactOpts bind.TransactOpts    // Transaction auth options to use throughout this session
}

// SelfDestructFactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type SelfDestructFactoryCallerSession struct {
	Contract *SelfDestructFactoryCaller // Generic contract caller binding to set the session for
	CallOpts bind.CallOpts              // Call options to use throughout this session
}

// SelfDestructFactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type SelfDestructFactoryTransactorSession struct {
	Contract     *SelfDestructFactoryTransactor // Generic contract transactor binding to set the session for
	TransactOpts bind.TransactOpts              // Transaction auth options to use throughout this session
}

// SelfDestructFactoryRaw is an auto generated low-level Go binding around an Ethereum contract.
type SelfDestructFactoryRaw struct {
	Contract *SelfDestructFactory // Generic contract binding to access the raw methods on
}

// SelfDestructFactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type SelfDestructFactoryCallerRaw struct {
	Contract *SelfDestructFactoryCaller // Generic read-only contract binding to access the raw methods on
}

// SelfDestructFactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type SelfDestructFactoryTransactorRaw struct {
	Contract *SelfDestructFactoryTransactor // Generic write-only contract binding to access the raw methods on
}

// NewSelfDestructFactory creates a new instance of SelfDestructFactory, bound to a specific deployed contract.
func NewSelfDestructFactory(address common.Address, backend bind.ContractBackend) (*SelfDestructFactory, error) {
	contract, err := bindSelfDestructFactory(address, backend, backend, backend)
	if err != nil {
		return nil, err
	}
	return &SelfDestructFactory{SelfDestructFactoryCaller: SelfDestructFactoryCaller{contract: contract}, SelfDestructFactoryTransactor: SelfDestructFactoryTransactor{contract: contract}, SelfDestructFactoryFilterer: SelfDestructFactoryFilterer{contract: contract}}, nil
}

// NewSelfDestructFactoryCaller creates a new read-only instance of SelfDestructFactory, bound to a specific deployed contract.
func NewSelfDestructFactoryCaller(address common.Address, caller bind.ContractCaller) (*SelfDestructFactoryCaller, error) {
	contract, err := bindSelfDestructFactory(address, caller, nil, nil)
	if err != nil {
		return nil, err
	}
	return &SelfDestructFactoryCaller{contract: contract}, nil
}

// NewSelfDestructFactoryTransactor creates a new write-only instance of SelfDestructFactory, bound to a specific deployed contract.
func NewSelfDestructFactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*SelfDestructFactoryTransactor, error) {
	contract, err := bindSelfDestructFactory(address, nil, transactor, nil)
	if err != nil {
		return nil, err
	}
	return &SelfDestructFactoryTransactor{contract: contract}, nil
}

// NewSelfDestructFactoryFilterer creates a new log filterer instance of SelfDestructFactory, bound to a specific deployed contract.
func NewSelfDestructFactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*SelfDestructFactoryFilterer, error) {
	contract, err := bindSelfDestructFactory(address, nil, nil, filterer)
	if err != nil {
		return nil, err
	}
	return &SelfDestructFactoryFilterer{contract: contract}, nil
}

// bindSelfDestructFactory binds a generic wrapper to an already deployed contract.
func bindSelfDestructFactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
	parsed, err := abi.JSON(strings.NewReader(SelfDestructFactoryABI))
	if err != nil {
		return nil, err
	}
	return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
}

// Call invokes the (constant) contract method with params as input values and
// sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named
// returns.
func (_SelfDestructFactory *SelfDestructFactoryRaw) Call(opts *bind.CallOpts, result *[]any, method string, params ...any) error {
	return _SelfDestructFactory.Contract.SelfDestructFactoryCaller.contract.Call(opts, result, method, params...)
}

// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
func (_SelfDestructFactory *SelfDestructFactoryRaw) Transfer(opts *bind.TransactOpts) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.SelfDestructFactoryTransactor.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_SelfDestructFactory *SelfDestructFactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...any) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.SelfDestructFactoryTransactor.contract.Transact(opts, method, params...)
}

// Call invokes the (constant) contract method with params as input values and
// sets the output to result. The result type might be a single field for simple
// returns, a slice of interfaces for anonymous returns and a struct for named
// returns.
func (_SelfDestructFactory *SelfDestructFactoryCallerRaw) Call(opts *bind.CallOpts, result *[]any, method string, params ...any) error {
	return _SelfDestructFactory.Contract.contract.Call(opts, result, method, params...)
}

// Transfer initiates a plain transaction to move funds to the contract, calling
// its default method if one is available.
func (_SelfDestructFactory *SelfDestructFactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_SelfDestructFactory *SelfDestructFactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...any) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.contract.Transact(opts, method, params...)
}

// Deploy is a paid mutator transaction binding the contract method 0x2b85ba38.
//
// Solidity: function deploy(bytes32 salt) payable returns(address instance)
func (_SelfDestructFactory *SelfDestructFactoryTransactor) Deploy(opts *bind.TransactOpts, salt [32]byte) (types.Transaction, error) {
	return _SelfDestructFactory.contract.Transact(opts, "deploy", salt)
}

// Deploy is a paid mutator transaction binding the contract method 0x2b85ba38.
//
// Solidity: function deploy(bytes32 salt) payable returns(address instance)
func (_SelfDestructFactory *SelfDestructFactorySession) Deploy(salt [32]byte) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.Deploy(&_SelfDestructFactory.TransactOpts, salt)
}

// Deploy is a paid mutator transaction binding the contract method 0x2b85ba38.
//
// Solidity: function deploy(bytes32 salt) payable returns(address instance)
func (_SelfDestructFactory *SelfDestructFactoryTransactorSession) Deploy(salt [32]byte) (types.Transaction, error) {
	return _SelfDestructFactory.Contract.Deploy(&_SelfDestructFactory.TransactOpts, salt)
}

// SelfDestructFactoryDeployParams is an auto generated read-only Go binding of transcaction calldata params
type SelfDestructFactoryDeployParams struct {
	Param_salt [32]byte
}

// Parse Deploy method from calldata of a transaction
//
// Solidity: function deploy(bytes32 salt) payable returns(address instance)
func ParseSelfDestructFactoryDeployParams(calldata []byte) (*SelfDestructFactoryDeployParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

	_abi, err := abi.JSON(strings.NewReader(SelfDestructFactoryABI))
	if err != nil {
		return nil, fmt.Errorf("failed to get abi of registry metadata: %w", err)
	}

	out, err := _abi.Methods["deploy"].Inputs.Unpack(calldata[4:])
	if err != nil {
		return nil, fmt.Errorf("failed to unpack deploy params data: %w", err)
	}

	var paramsResult = new(SelfDestructFactoryDeployParams)
	value := reflect.ValueOf(paramsResult).Elem()

	if value.NumField() != len(out) {
		return nil, fmt.Errorf("failed to match calldata with param field number")
	}

	out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte)

	return &SelfDestructFactoryDeployParams{
		Param_salt: out0,
	}, nil
}
