// 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
)

// DisperseABI is the input ABI used to generate the binding from.
const DisperseABI = "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"recipients\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"disperseEther\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}]"

// DisperseBin is the compiled bytecode used for deploying new contracts.
var DisperseBin = "0x6080604052348015600e575f5ffd5b506102238061001c5f395ff3fe60806040526004361061001d575f3560e01c8063e63d38ed14610021575b5f5ffd5b61003461002f366004610140565b610036565b005b5f5b838110156100bd57848482818110610052576100526101ac565b905060200201602081019061006791906101c0565b6001600160a01b03166108fc848484818110610085576100856101ac565b9050602002013590811502906040515f60405180830381858888f193505050501580156100b4573d5f5f3e3d5ffd5b50600101610038565b504780156100f157604051339082156108fc029083905f818181858888f193505050501580156100ef573d5f5f3e3d5ffd5b505b5050505050565b5f5f83601f840112610108575f5ffd5b50813567ffffffffffffffff81111561011f575f5ffd5b6020830191508360208260051b8501011115610139575f5ffd5b9250929050565b5f5f5f5f60408587031215610153575f5ffd5b843567ffffffffffffffff811115610169575f5ffd5b610175878288016100f8565b909550935050602085013567ffffffffffffffff811115610194575f5ffd5b6101a0878288016100f8565b95989497509550505050565b634e487b7160e01b5f52603260045260245ffd5b5f602082840312156101d0575f5ffd5b81356001600160a01b03811681146101e6575f5ffd5b939250505056fea2646970667358221220bc225555db7d1bbba50718967aff6a3d87aca4b4ccf147d5a6dccc3a49cee4fa64736f6c634300081e0033"

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

	address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(DisperseBin), backend)
	if err != nil {
		return common.Address{}, nil, nil, err
	}
	return address, tx, &Disperse{DisperseCaller: DisperseCaller{contract: contract}, DisperseTransactor: DisperseTransactor{contract: contract}, DisperseFilterer: DisperseFilterer{contract: contract}}, nil
}

// Disperse is an auto generated Go binding around an Ethereum contract.
type Disperse struct {
	DisperseCaller     // Read-only binding to the contract
	DisperseTransactor // Write-only binding to the contract
	DisperseFilterer   // Log filterer for contract events
}

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

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

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

// DisperseSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type DisperseSession struct {
	Contract     *Disperse         // 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
}

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

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

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

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

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

// NewDisperse creates a new instance of Disperse, bound to a specific deployed contract.
func NewDisperse(address common.Address, backend bind.ContractBackend) (*Disperse, error) {
	contract, err := bindDisperse(address, backend, backend, backend)
	if err != nil {
		return nil, err
	}
	return &Disperse{DisperseCaller: DisperseCaller{contract: contract}, DisperseTransactor: DisperseTransactor{contract: contract}, DisperseFilterer: DisperseFilterer{contract: contract}}, nil
}

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

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

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

// bindDisperse binds a generic wrapper to an already deployed contract.
func bindDisperse(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
	parsed, err := abi.JSON(strings.NewReader(DisperseABI))
	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 (_Disperse *DisperseRaw) Call(opts *bind.CallOpts, result *[]any, method string, params ...any) error {
	return _Disperse.Contract.DisperseCaller.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 (_Disperse *DisperseRaw) Transfer(opts *bind.TransactOpts) (types.Transaction, error) {
	return _Disperse.Contract.DisperseTransactor.contract.Transfer(opts)
}

// Transact invokes the (paid) contract method with params as input values.
func (_Disperse *DisperseRaw) Transact(opts *bind.TransactOpts, method string, params ...any) (types.Transaction, error) {
	return _Disperse.Contract.DisperseTransactor.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 (_Disperse *DisperseCallerRaw) Call(opts *bind.CallOpts, result *[]any, method string, params ...any) error {
	return _Disperse.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 (_Disperse *DisperseTransactorRaw) Transfer(opts *bind.TransactOpts) (types.Transaction, error) {
	return _Disperse.Contract.contract.Transfer(opts)
}

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

// DisperseEther is a paid mutator transaction binding the contract method 0xe63d38ed.
//
// Solidity: function disperseEther(address[] recipients, uint256[] values) payable returns()
func (_Disperse *DisperseTransactor) DisperseEther(opts *bind.TransactOpts, recipients []common.Address, values []*big.Int) (types.Transaction, error) {
	return _Disperse.contract.Transact(opts, "disperseEther", recipients, values)
}

// DisperseEther is a paid mutator transaction binding the contract method 0xe63d38ed.
//
// Solidity: function disperseEther(address[] recipients, uint256[] values) payable returns()
func (_Disperse *DisperseSession) DisperseEther(recipients []common.Address, values []*big.Int) (types.Transaction, error) {
	return _Disperse.Contract.DisperseEther(&_Disperse.TransactOpts, recipients, values)
}

// DisperseEther is a paid mutator transaction binding the contract method 0xe63d38ed.
//
// Solidity: function disperseEther(address[] recipients, uint256[] values) payable returns()
func (_Disperse *DisperseTransactorSession) DisperseEther(recipients []common.Address, values []*big.Int) (types.Transaction, error) {
	return _Disperse.Contract.DisperseEther(&_Disperse.TransactOpts, recipients, values)
}

// DisperseDisperseEtherParams is an auto generated read-only Go binding of transcaction calldata params
type DisperseDisperseEtherParams struct {
	Param_recipients []common.Address
	Param_values     []*big.Int
}

// Parse DisperseEther method from calldata of a transaction
//
// Solidity: function disperseEther(address[] recipients, uint256[] values) payable returns()
func ParseDisperseDisperseEtherParams(calldata []byte) (*DisperseDisperseEtherParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

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

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

	var paramsResult = new(DisperseDisperseEtherParams)
	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([]common.Address)).(*[]common.Address)
	out1 := *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int)

	return &DisperseDisperseEtherParams{
		Param_recipients: out0, Param_values: out1,
	}, nil
}
