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

package contracts

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

	"github.com/cenkalti/backoff/v4"
	ethereum "github.com/erigontech/erigon"
	"github.com/erigontech/erigon/common"
	"github.com/erigontech/erigon/execution/abi"
	"github.com/erigontech/erigon/execution/abi/bind"
	"github.com/erigontech/erigon/execution/types"
	"github.com/erigontech/erigon/p2p/event"
)

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

// KeyperSetABI is the input ABI used to generate the binding from.
const KeyperSetABI = "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AlreadyFinalized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"OwnableInvalidOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"OwnableUnauthorizedAccount\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"newMembers\",\"type\":\"address[]\"}],\"name\":\"addMembers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"index\",\"type\":\"uint64\"}],\"name\":\"getMember\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getMembers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumMembers\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getPublisher\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getThreshold\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"a\",\"type\":\"address\"}],\"name\":\"isAllowedToBroadcastEonKey\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isFinalized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"setFinalized\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_publisher\",\"type\":\"address\"}],\"name\":\"setPublisher\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"_threshold\",\"type\":\"uint64\"}],\"name\":\"setThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]"

// KeyperSetBin is the compiled bytecode used for deploying new contracts.
var KeyperSetBin = "0x6080604052348015600e575f5ffd5b503380603357604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b603a81603f565b50608e565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106b98061009b5f395ff3fe608060405234801561000f575f5ffd5b50600436106100e5575f3560e01c80638da5cb5b11610088578063cde1532d11610063578063cde1532d146101c3578063dbf4ab4e146101ec578063e75235b814610204578063f2fde38b14610216575f5ffd5b80638da5cb5b1461018b5780639eab52531461019b578063cab63661146101b0575f5ffd5b80632e8e6cad116100c35780632e8e6cad146101285780636f4d469b14610153578063715018a6146101665780638d4e40831461016e575f5ffd5b806317c4de35146100e957806317d5430a146100fe5780631de7725314610120575b5f5ffd5b6100fc6100f7366004610527565b610229565b005b6001545b60405167ffffffffffffffff90911681526020015b60405180910390f35b6100fc61027f565b61013b610136366004610527565b61029b565b6040516001600160a01b039091168152602001610117565b6100fc610161366004610555565b6102d3565b6100fc610394565b5f54600160a01b900460ff165b6040519015158152602001610117565b5f546001600160a01b031661013b565b6101a36103a7565b60405161011791906105c6565b6100fc6101be366004610611565b610407565b61017b6101d1366004610611565b600254600160401b90046001600160a01b0390811691161490565b600254600160401b90046001600160a01b031661013b565b60025467ffffffffffffffff16610102565b6100fc610224366004610611565b61046a565b6102316104ac565b5f54600160a01b900460ff161561025b5760405163475a253560e01b815260040160405180910390fd5b6002805467ffffffffffffffff191667ffffffffffffffff92909216919091179055565b6102876104ac565b5f805460ff60a01b1916600160a01b179055565b5f60018267ffffffffffffffff16815481106102b9576102b9610637565b5f918252602090912001546001600160a01b031692915050565b6102db6104ac565b5f54600160a01b900460ff16156103055760405163475a253560e01b815260040160405180910390fd5b5f5b67ffffffffffffffff811682111561038f57600183838367ffffffffffffffff1681811061033757610337610637565b905060200201602081019061034c9190610611565b81546001810183555f928352602090922090910180546001600160a01b0319166001600160a01b03909216919091179055806103878161064b565b915050610307565b505050565b61039c6104ac565b6103a55f6104d8565b565b606060018054806020026020016040519081016040528092919081815260200182805480156103fd57602002820191905f5260205f20905b81546001600160a01b031681526001909101906020018083116103df575b5050505050905090565b61040f6104ac565b5f54600160a01b900460ff16156104395760405163475a253560e01b815260040160405180910390fd5b600280546001600160a01b03909216600160401b0268010000000000000000600160e01b0319909216919091179055565b6104726104ac565b6001600160a01b0381166104a057604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b6104a9816104d8565b50565b5f546001600160a01b031633146103a55760405163118cdaa760e01b8152336004820152602401610497565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610537575f5ffd5b813567ffffffffffffffff8116811461054e575f5ffd5b9392505050565b5f5f60208385031215610566575f5ffd5b823567ffffffffffffffff81111561057c575f5ffd5b8301601f8101851361058c575f5ffd5b803567ffffffffffffffff8111156105a2575f5ffd5b8560208260051b84010111156105b6575f5ffd5b6020919091019590945092505050565b602080825282518282018190525f918401906040840190835b818110156106065783516001600160a01b03168352602093840193909201916001016105df565b509095945050505050565b5f60208284031215610621575f5ffd5b81356001600160a01b038116811461054e575f5ffd5b634e487b7160e01b5f52603260045260245ffd5b5f67ffffffffffffffff821667ffffffffffffffff810361067a57634e487b7160e01b5f52601160045260245ffd5b6001019291505056fea2646970667358221220247f8f5d02424f7b23b35c015748a1e1b4030a3d2455cf1bff0e96d6699a226364736f6c634300081c0033"

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

	ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
	backOff := backoff.WithContext(backoff.BackOff(backoff.NewConstantBackOff(50*time.Millisecond)), ctx)
	defer cancel()
	type binding struct {
		address  common.Address
		tx       types.Transaction
		contract *bind.BoundContract
	}
	b, err := backoff.RetryWithData(func() (binding, error) {
		address, tx, contract, err := bind.DeployContract(auth, parsed, common.FromHex(KeyperSetBin), backend)
		if err != nil {
			return binding{}, err
		}
		return binding{address, tx, contract}, nil
	}, backOff)
	if err != nil {
		return common.Address{}, nil, nil, err
	}
	return b.address, b.tx, &KeyperSet{KeyperSetCaller: KeyperSetCaller{contract: b.contract}, KeyperSetTransactor: KeyperSetTransactor{contract: b.contract}, KeyperSetFilterer: KeyperSetFilterer{contract: b.contract}}, nil
}

// KeyperSet is an auto generated Go binding around an Ethereum contract.
type KeyperSet struct {
	KeyperSetCaller     // Read-only binding to the contract
	KeyperSetTransactor // Write-only binding to the contract
	KeyperSetFilterer   // Log filterer for contract events
}

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

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

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

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

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

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

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

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

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

// NewKeyperSet creates a new instance of KeyperSet, bound to a specific deployed contract.
func NewKeyperSet(address common.Address, backend bind.ContractBackend) (*KeyperSet, error) {
	contract, err := bindKeyperSet(address, backend, backend, backend)
	if err != nil {
		return nil, err
	}
	return &KeyperSet{KeyperSetCaller: KeyperSetCaller{contract: contract}, KeyperSetTransactor: KeyperSetTransactor{contract: contract}, KeyperSetFilterer: KeyperSetFilterer{contract: contract}}, nil
}

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

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

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

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

// Transact invokes the (paid) contract method with params as input values.
func (_KeyperSet *KeyperSetRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (types.Transaction, error) {
	return _KeyperSet.Contract.KeyperSetTransactor.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 (_KeyperSet *KeyperSetCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
	return _KeyperSet.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 (_KeyperSet *KeyperSetTransactorRaw) Transfer(opts *bind.TransactOpts) (types.Transaction, error) {
	return _KeyperSet.Contract.contract.Transfer(opts)
}

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

// GetMember is a free data retrieval call binding the contract method 0x2e8e6cad.
//
// Solidity: function getMember(uint64 index) view returns(address)
func (_KeyperSet *KeyperSetCaller) GetMember(opts *bind.CallOpts, index uint64) (common.Address, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "getMember", index)

	if err != nil {
		return *new(common.Address), err
	}

	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)

	return out0, err

}

// GetMember is a free data retrieval call binding the contract method 0x2e8e6cad.
//
// Solidity: function getMember(uint64 index) view returns(address)
func (_KeyperSet *KeyperSetSession) GetMember(index uint64) (common.Address, error) {
	return _KeyperSet.Contract.GetMember(&_KeyperSet.CallOpts, index)
}

// GetMember is a free data retrieval call binding the contract method 0x2e8e6cad.
//
// Solidity: function getMember(uint64 index) view returns(address)
func (_KeyperSet *KeyperSetCallerSession) GetMember(index uint64) (common.Address, error) {
	return _KeyperSet.Contract.GetMember(&_KeyperSet.CallOpts, index)
}

// GetMembers is a free data retrieval call binding the contract method 0x9eab5253.
//
// Solidity: function getMembers() view returns(address[])
func (_KeyperSet *KeyperSetCaller) GetMembers(opts *bind.CallOpts) ([]common.Address, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "getMembers")

	if err != nil {
		return *new([]common.Address), err
	}

	out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address)

	return out0, err

}

// GetMembers is a free data retrieval call binding the contract method 0x9eab5253.
//
// Solidity: function getMembers() view returns(address[])
func (_KeyperSet *KeyperSetSession) GetMembers() ([]common.Address, error) {
	return _KeyperSet.Contract.GetMembers(&_KeyperSet.CallOpts)
}

// GetMembers is a free data retrieval call binding the contract method 0x9eab5253.
//
// Solidity: function getMembers() view returns(address[])
func (_KeyperSet *KeyperSetCallerSession) GetMembers() ([]common.Address, error) {
	return _KeyperSet.Contract.GetMembers(&_KeyperSet.CallOpts)
}

// GetNumMembers is a free data retrieval call binding the contract method 0x17d5430a.
//
// Solidity: function getNumMembers() view returns(uint64)
func (_KeyperSet *KeyperSetCaller) GetNumMembers(opts *bind.CallOpts) (uint64, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "getNumMembers")

	if err != nil {
		return *new(uint64), err
	}

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

	return out0, err

}

// GetNumMembers is a free data retrieval call binding the contract method 0x17d5430a.
//
// Solidity: function getNumMembers() view returns(uint64)
func (_KeyperSet *KeyperSetSession) GetNumMembers() (uint64, error) {
	return _KeyperSet.Contract.GetNumMembers(&_KeyperSet.CallOpts)
}

// GetNumMembers is a free data retrieval call binding the contract method 0x17d5430a.
//
// Solidity: function getNumMembers() view returns(uint64)
func (_KeyperSet *KeyperSetCallerSession) GetNumMembers() (uint64, error) {
	return _KeyperSet.Contract.GetNumMembers(&_KeyperSet.CallOpts)
}

// GetPublisher is a free data retrieval call binding the contract method 0xdbf4ab4e.
//
// Solidity: function getPublisher() view returns(address)
func (_KeyperSet *KeyperSetCaller) GetPublisher(opts *bind.CallOpts) (common.Address, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "getPublisher")

	if err != nil {
		return *new(common.Address), err
	}

	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)

	return out0, err

}

// GetPublisher is a free data retrieval call binding the contract method 0xdbf4ab4e.
//
// Solidity: function getPublisher() view returns(address)
func (_KeyperSet *KeyperSetSession) GetPublisher() (common.Address, error) {
	return _KeyperSet.Contract.GetPublisher(&_KeyperSet.CallOpts)
}

// GetPublisher is a free data retrieval call binding the contract method 0xdbf4ab4e.
//
// Solidity: function getPublisher() view returns(address)
func (_KeyperSet *KeyperSetCallerSession) GetPublisher() (common.Address, error) {
	return _KeyperSet.Contract.GetPublisher(&_KeyperSet.CallOpts)
}

// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8.
//
// Solidity: function getThreshold() view returns(uint64)
func (_KeyperSet *KeyperSetCaller) GetThreshold(opts *bind.CallOpts) (uint64, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "getThreshold")

	if err != nil {
		return *new(uint64), err
	}

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

	return out0, err

}

// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8.
//
// Solidity: function getThreshold() view returns(uint64)
func (_KeyperSet *KeyperSetSession) GetThreshold() (uint64, error) {
	return _KeyperSet.Contract.GetThreshold(&_KeyperSet.CallOpts)
}

// GetThreshold is a free data retrieval call binding the contract method 0xe75235b8.
//
// Solidity: function getThreshold() view returns(uint64)
func (_KeyperSet *KeyperSetCallerSession) GetThreshold() (uint64, error) {
	return _KeyperSet.Contract.GetThreshold(&_KeyperSet.CallOpts)
}

// IsAllowedToBroadcastEonKey is a free data retrieval call binding the contract method 0xcde1532d.
//
// Solidity: function isAllowedToBroadcastEonKey(address a) view returns(bool)
func (_KeyperSet *KeyperSetCaller) IsAllowedToBroadcastEonKey(opts *bind.CallOpts, a common.Address) (bool, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "isAllowedToBroadcastEonKey", a)

	if err != nil {
		return *new(bool), err
	}

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

	return out0, err

}

// IsAllowedToBroadcastEonKey is a free data retrieval call binding the contract method 0xcde1532d.
//
// Solidity: function isAllowedToBroadcastEonKey(address a) view returns(bool)
func (_KeyperSet *KeyperSetSession) IsAllowedToBroadcastEonKey(a common.Address) (bool, error) {
	return _KeyperSet.Contract.IsAllowedToBroadcastEonKey(&_KeyperSet.CallOpts, a)
}

// IsAllowedToBroadcastEonKey is a free data retrieval call binding the contract method 0xcde1532d.
//
// Solidity: function isAllowedToBroadcastEonKey(address a) view returns(bool)
func (_KeyperSet *KeyperSetCallerSession) IsAllowedToBroadcastEonKey(a common.Address) (bool, error) {
	return _KeyperSet.Contract.IsAllowedToBroadcastEonKey(&_KeyperSet.CallOpts, a)
}

// IsFinalized is a free data retrieval call binding the contract method 0x8d4e4083.
//
// Solidity: function isFinalized() view returns(bool)
func (_KeyperSet *KeyperSetCaller) IsFinalized(opts *bind.CallOpts) (bool, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "isFinalized")

	if err != nil {
		return *new(bool), err
	}

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

	return out0, err

}

// IsFinalized is a free data retrieval call binding the contract method 0x8d4e4083.
//
// Solidity: function isFinalized() view returns(bool)
func (_KeyperSet *KeyperSetSession) IsFinalized() (bool, error) {
	return _KeyperSet.Contract.IsFinalized(&_KeyperSet.CallOpts)
}

// IsFinalized is a free data retrieval call binding the contract method 0x8d4e4083.
//
// Solidity: function isFinalized() view returns(bool)
func (_KeyperSet *KeyperSetCallerSession) IsFinalized() (bool, error) {
	return _KeyperSet.Contract.IsFinalized(&_KeyperSet.CallOpts)
}

// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_KeyperSet *KeyperSetCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
	var out []interface{}
	err := _KeyperSet.contract.Call(opts, &out, "owner")

	if err != nil {
		return *new(common.Address), err
	}

	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)

	return out0, err

}

// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_KeyperSet *KeyperSetSession) Owner() (common.Address, error) {
	return _KeyperSet.Contract.Owner(&_KeyperSet.CallOpts)
}

// Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
//
// Solidity: function owner() view returns(address)
func (_KeyperSet *KeyperSetCallerSession) Owner() (common.Address, error) {
	return _KeyperSet.Contract.Owner(&_KeyperSet.CallOpts)
}

// AddMembers is a paid mutator transaction binding the contract method 0x6f4d469b.
//
// Solidity: function addMembers(address[] newMembers) returns()
func (_KeyperSet *KeyperSetTransactor) AddMembers(opts *bind.TransactOpts, newMembers []common.Address) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "addMembers", newMembers)
}

// AddMembers is a paid mutator transaction binding the contract method 0x6f4d469b.
//
// Solidity: function addMembers(address[] newMembers) returns()
func (_KeyperSet *KeyperSetSession) AddMembers(newMembers []common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.AddMembers(&_KeyperSet.TransactOpts, newMembers)
}

// AddMembers is a paid mutator transaction binding the contract method 0x6f4d469b.
//
// Solidity: function addMembers(address[] newMembers) returns()
func (_KeyperSet *KeyperSetTransactorSession) AddMembers(newMembers []common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.AddMembers(&_KeyperSet.TransactOpts, newMembers)
}

// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_KeyperSet *KeyperSetTransactor) RenounceOwnership(opts *bind.TransactOpts) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "renounceOwnership")
}

// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_KeyperSet *KeyperSetSession) RenounceOwnership() (types.Transaction, error) {
	return _KeyperSet.Contract.RenounceOwnership(&_KeyperSet.TransactOpts)
}

// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6.
//
// Solidity: function renounceOwnership() returns()
func (_KeyperSet *KeyperSetTransactorSession) RenounceOwnership() (types.Transaction, error) {
	return _KeyperSet.Contract.RenounceOwnership(&_KeyperSet.TransactOpts)
}

// SetFinalized is a paid mutator transaction binding the contract method 0x1de77253.
//
// Solidity: function setFinalized() returns()
func (_KeyperSet *KeyperSetTransactor) SetFinalized(opts *bind.TransactOpts) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "setFinalized")
}

// SetFinalized is a paid mutator transaction binding the contract method 0x1de77253.
//
// Solidity: function setFinalized() returns()
func (_KeyperSet *KeyperSetSession) SetFinalized() (types.Transaction, error) {
	return _KeyperSet.Contract.SetFinalized(&_KeyperSet.TransactOpts)
}

// SetFinalized is a paid mutator transaction binding the contract method 0x1de77253.
//
// Solidity: function setFinalized() returns()
func (_KeyperSet *KeyperSetTransactorSession) SetFinalized() (types.Transaction, error) {
	return _KeyperSet.Contract.SetFinalized(&_KeyperSet.TransactOpts)
}

// SetPublisher is a paid mutator transaction binding the contract method 0xcab63661.
//
// Solidity: function setPublisher(address _publisher) returns()
func (_KeyperSet *KeyperSetTransactor) SetPublisher(opts *bind.TransactOpts, _publisher common.Address) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "setPublisher", _publisher)
}

// SetPublisher is a paid mutator transaction binding the contract method 0xcab63661.
//
// Solidity: function setPublisher(address _publisher) returns()
func (_KeyperSet *KeyperSetSession) SetPublisher(_publisher common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.SetPublisher(&_KeyperSet.TransactOpts, _publisher)
}

// SetPublisher is a paid mutator transaction binding the contract method 0xcab63661.
//
// Solidity: function setPublisher(address _publisher) returns()
func (_KeyperSet *KeyperSetTransactorSession) SetPublisher(_publisher common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.SetPublisher(&_KeyperSet.TransactOpts, _publisher)
}

// SetThreshold is a paid mutator transaction binding the contract method 0x17c4de35.
//
// Solidity: function setThreshold(uint64 _threshold) returns()
func (_KeyperSet *KeyperSetTransactor) SetThreshold(opts *bind.TransactOpts, _threshold uint64) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "setThreshold", _threshold)
}

// SetThreshold is a paid mutator transaction binding the contract method 0x17c4de35.
//
// Solidity: function setThreshold(uint64 _threshold) returns()
func (_KeyperSet *KeyperSetSession) SetThreshold(_threshold uint64) (types.Transaction, error) {
	return _KeyperSet.Contract.SetThreshold(&_KeyperSet.TransactOpts, _threshold)
}

// SetThreshold is a paid mutator transaction binding the contract method 0x17c4de35.
//
// Solidity: function setThreshold(uint64 _threshold) returns()
func (_KeyperSet *KeyperSetTransactorSession) SetThreshold(_threshold uint64) (types.Transaction, error) {
	return _KeyperSet.Contract.SetThreshold(&_KeyperSet.TransactOpts, _threshold)
}

// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_KeyperSet *KeyperSetTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (types.Transaction, error) {
	return _KeyperSet.contract.Transact(opts, "transferOwnership", newOwner)
}

// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_KeyperSet *KeyperSetSession) TransferOwnership(newOwner common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.TransferOwnership(&_KeyperSet.TransactOpts, newOwner)
}

// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b.
//
// Solidity: function transferOwnership(address newOwner) returns()
func (_KeyperSet *KeyperSetTransactorSession) TransferOwnership(newOwner common.Address) (types.Transaction, error) {
	return _KeyperSet.Contract.TransferOwnership(&_KeyperSet.TransactOpts, newOwner)
}

// KeyperSetAddMembersParams is an auto generated read-only Go binding of transcaction calldata params
type KeyperSetAddMembersParams struct {
	Param_newMembers []common.Address
}

// Parse AddMembers method from calldata of a transaction
//
// Solidity: function addMembers(address[] newMembers) returns()
func ParseKeyperSetAddMembersParams(calldata []byte) (*KeyperSetAddMembersParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

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

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

	var paramsResult = new(KeyperSetAddMembersParams)
	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)

	return &KeyperSetAddMembersParams{
		Param_newMembers: out0,
	}, nil
}

// KeyperSetSetPublisherParams is an auto generated read-only Go binding of transcaction calldata params
type KeyperSetSetPublisherParams struct {
	Param__publisher common.Address
}

// Parse SetPublisher method from calldata of a transaction
//
// Solidity: function setPublisher(address _publisher) returns()
func ParseKeyperSetSetPublisherParams(calldata []byte) (*KeyperSetSetPublisherParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

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

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

	var paramsResult = new(KeyperSetSetPublisherParams)
	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)

	return &KeyperSetSetPublisherParams{
		Param__publisher: out0,
	}, nil
}

// KeyperSetSetThresholdParams is an auto generated read-only Go binding of transcaction calldata params
type KeyperSetSetThresholdParams struct {
	Param__threshold uint64
}

// Parse SetThreshold method from calldata of a transaction
//
// Solidity: function setThreshold(uint64 _threshold) returns()
func ParseKeyperSetSetThresholdParams(calldata []byte) (*KeyperSetSetThresholdParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

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

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

	var paramsResult = new(KeyperSetSetThresholdParams)
	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(uint64)).(*uint64)

	return &KeyperSetSetThresholdParams{
		Param__threshold: out0,
	}, nil
}

// KeyperSetTransferOwnershipParams is an auto generated read-only Go binding of transcaction calldata params
type KeyperSetTransferOwnershipParams struct {
	Param_newOwner common.Address
}

// Parse TransferOwnership method from calldata of a transaction
//
// Solidity: function transferOwnership(address newOwner) returns()
func ParseKeyperSetTransferOwnershipParams(calldata []byte) (*KeyperSetTransferOwnershipParams, error) {
	if len(calldata) <= 4 {
		return nil, fmt.Errorf("invalid calldata input")
	}

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

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

	var paramsResult = new(KeyperSetTransferOwnershipParams)
	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)

	return &KeyperSetTransferOwnershipParams{
		Param_newOwner: out0,
	}, nil
}

// KeyperSetOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the KeyperSet contract.
type KeyperSetOwnershipTransferredIterator struct {
	Event *KeyperSetOwnershipTransferred // Event containing the contract specifics and raw log

	contract *bind.BoundContract // Generic contract to use for unpacking event data
	event    string              // Event name to use for unpacking event data

	logs chan types.Log        // Log channel receiving the found contract events
	sub  ethereum.Subscription // Subscription for errors, completion and termination
	done bool                  // Whether the subscription completed delivering logs
	fail error                 // Occurred error to stop iteration
}

// Next advances the iterator to the subsequent event, returning whether there
// are any more events found. In case of a retrieval or parsing error, false is
// returned and Error() can be queried for the exact failure.
func (it *KeyperSetOwnershipTransferredIterator) Next() bool {
	// If the iterator failed, stop iterating
	if it.fail != nil {
		return false
	}
	// If the iterator completed, deliver directly whatever's available
	if it.done {
		select {
		case log := <-it.logs:
			it.Event = new(KeyperSetOwnershipTransferred)
			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
				it.fail = err
				return false
			}
			it.Event.Raw = log
			return true

		default:
			return false
		}
	}
	// Iterator still in progress, wait for either a data or an error event
	select {
	case log := <-it.logs:
		it.Event = new(KeyperSetOwnershipTransferred)
		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
			it.fail = err
			return false
		}
		it.Event.Raw = log
		return true

	case err := <-it.sub.Err():
		it.done = true
		it.fail = err
		return it.Next()
	}
}

// Error returns any retrieval or parsing error occurred during filtering.
func (it *KeyperSetOwnershipTransferredIterator) Error() error {
	return it.fail
}

// Close terminates the iteration process, releasing any pending underlying
// resources.
func (it *KeyperSetOwnershipTransferredIterator) Close() error {
	it.sub.Unsubscribe()
	return nil
}

// KeyperSetOwnershipTransferred represents a OwnershipTransferred event raised by the KeyperSet contract.
type KeyperSetOwnershipTransferred struct {
	PreviousOwner common.Address
	NewOwner      common.Address
	Raw           types.Log // Blockchain specific contextual infos
}

func (_KeyperSet *KeyperSetFilterer) OwnershipTransferredEventID() common.Hash {
	return common.HexToHash("0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0")
}

// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_KeyperSet *KeyperSetFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*KeyperSetOwnershipTransferredIterator, error) {

	var previousOwnerRule []interface{}
	for _, previousOwnerItem := range previousOwner {
		previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
	}
	var newOwnerRule []interface{}
	for _, newOwnerItem := range newOwner {
		newOwnerRule = append(newOwnerRule, newOwnerItem)
	}

	logs, sub, err := _KeyperSet.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
	if err != nil {
		return nil, err
	}
	return &KeyperSetOwnershipTransferredIterator{contract: _KeyperSet.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil
}

// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_KeyperSet *KeyperSetFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *KeyperSetOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) {

	var previousOwnerRule []interface{}
	for _, previousOwnerItem := range previousOwner {
		previousOwnerRule = append(previousOwnerRule, previousOwnerItem)
	}
	var newOwnerRule []interface{}
	for _, newOwnerItem := range newOwner {
		newOwnerRule = append(newOwnerRule, newOwnerItem)
	}

	logs, sub, err := _KeyperSet.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule)
	if err != nil {
		return nil, err
	}
	return event.NewSubscription(func(quit <-chan struct{}) error {
		defer sub.Unsubscribe()
		for {
			select {
			case log := <-logs:
				// New log arrived, parse the event and forward to the user
				event := new(KeyperSetOwnershipTransferred)
				if err := _KeyperSet.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
					return err
				}
				event.Raw = log

				select {
				case sink <- event:
				case err := <-sub.Err():
					return err
				case <-quit:
					return nil
				}
			case err := <-sub.Err():
				return err
			case <-quit:
				return nil
			}
		}
	}), nil
}

// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0.
//
// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)
func (_KeyperSet *KeyperSetFilterer) ParseOwnershipTransferred(log types.Log) (*KeyperSetOwnershipTransferred, error) {
	event := new(KeyperSetOwnershipTransferred)
	if err := _KeyperSet.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil {
		return nil, err
	}
	event.Raw = log
	return event, nil
}
