github.com/diadata-org/diadata@v1.4.593/pkg/dia/scraper/exchange-scrapers/maverick/pairfactory/pairfactory.go (about)

     1  // Code generated - DO NOT EDIT.
     2  // This file is a generated binding and any manual changes will be lost.
     3  
     4  package pairfactory
     5  
     6  import (
     7  	"errors"
     8  	"math/big"
     9  	"strings"
    10  
    11  	ethereum "github.com/ethereum/go-ethereum"
    12  	"github.com/ethereum/go-ethereum/accounts/abi"
    13  	"github.com/ethereum/go-ethereum/accounts/abi/bind"
    14  	"github.com/ethereum/go-ethereum/common"
    15  	"github.com/ethereum/go-ethereum/core/types"
    16  	"github.com/ethereum/go-ethereum/event"
    17  )
    18  
    19  // Reference imports to suppress errors if they are not otherwise used.
    20  var (
    21  	_ = errors.New
    22  	_ = big.NewInt
    23  	_ = strings.NewReader
    24  	_ = ethereum.NotFound
    25  	_ = bind.Bind
    26  	_ = common.Big1
    27  	_ = types.BloomLookup
    28  	_ = event.NewSubscription
    29  	_ = abi.ConvertType
    30  )
    31  
    32  // PairfactoryMetaData contains all meta data concerning the Pairfactory contract.
    33  var PairfactoryMetaData = &bind.MetaData{
    34  	ABI: "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"poolAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"tickSpacing\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"int32\",\"name\":\"activeTick\",\"type\":\"int32\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"lookback\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"protocolFeeRatio\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"contractIERC20\",\"name\":\"tokenA\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"contractIERC20\",\"name\":\"tokenB\",\"type\":\"address\"}],\"name\":\"PoolCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"SetFactoryOwner\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"protocolFeeRatio\",\"type\":\"uint64\"}],\"name\":\"SetFactoryProtocolFeeRatio\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_tickSpacing\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"_lookback\",\"type\":\"int256\"},{\"internalType\":\"int32\",\"name\":\"_activeTick\",\"type\":\"int32\"},{\"internalType\":\"contractIERC20\",\"name\":\"_tokenA\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"_tokenB\",\"type\":\"address\"}],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIPool\",\"name\":\"pool\",\"type\":\"address\"}],\"name\":\"isFactoryPool\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"tickSpacing\",\"type\":\"uint256\"},{\"internalType\":\"int256\",\"name\":\"lookback\",\"type\":\"int256\"},{\"internalType\":\"contractIERC20\",\"name\":\"tokenA\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"tokenB\",\"type\":\"address\"}],\"name\":\"lookup\",\"outputs\":[{\"internalType\":\"contractIPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"position\",\"outputs\":[{\"internalType\":\"contractIPosition\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFeeRatio\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
    35  }
    36  
    37  // PairfactoryABI is the input ABI used to generate the binding from.
    38  // Deprecated: Use PairfactoryMetaData.ABI instead.
    39  var PairfactoryABI = PairfactoryMetaData.ABI
    40  
    41  // Pairfactory is an auto generated Go binding around an Ethereum contract.
    42  type Pairfactory struct {
    43  	PairfactoryCaller     // Read-only binding to the contract
    44  	PairfactoryTransactor // Write-only binding to the contract
    45  	PairfactoryFilterer   // Log filterer for contract events
    46  }
    47  
    48  // PairfactoryCaller is an auto generated read-only Go binding around an Ethereum contract.
    49  type PairfactoryCaller struct {
    50  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    51  }
    52  
    53  // PairfactoryTransactor is an auto generated write-only Go binding around an Ethereum contract.
    54  type PairfactoryTransactor struct {
    55  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    56  }
    57  
    58  // PairfactoryFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
    59  type PairfactoryFilterer struct {
    60  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    61  }
    62  
    63  // PairfactorySession is an auto generated Go binding around an Ethereum contract,
    64  // with pre-set call and transact options.
    65  type PairfactorySession struct {
    66  	Contract     *Pairfactory      // Generic contract binding to set the session for
    67  	CallOpts     bind.CallOpts     // Call options to use throughout this session
    68  	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    69  }
    70  
    71  // PairfactoryCallerSession is an auto generated read-only Go binding around an Ethereum contract,
    72  // with pre-set call options.
    73  type PairfactoryCallerSession struct {
    74  	Contract *PairfactoryCaller // Generic contract caller binding to set the session for
    75  	CallOpts bind.CallOpts      // Call options to use throughout this session
    76  }
    77  
    78  // PairfactoryTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
    79  // with pre-set transact options.
    80  type PairfactoryTransactorSession struct {
    81  	Contract     *PairfactoryTransactor // Generic contract transactor binding to set the session for
    82  	TransactOpts bind.TransactOpts      // Transaction auth options to use throughout this session
    83  }
    84  
    85  // PairfactoryRaw is an auto generated low-level Go binding around an Ethereum contract.
    86  type PairfactoryRaw struct {
    87  	Contract *Pairfactory // Generic contract binding to access the raw methods on
    88  }
    89  
    90  // PairfactoryCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
    91  type PairfactoryCallerRaw struct {
    92  	Contract *PairfactoryCaller // Generic read-only contract binding to access the raw methods on
    93  }
    94  
    95  // PairfactoryTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
    96  type PairfactoryTransactorRaw struct {
    97  	Contract *PairfactoryTransactor // Generic write-only contract binding to access the raw methods on
    98  }
    99  
   100  // NewPairfactory creates a new instance of Pairfactory, bound to a specific deployed contract.
   101  func NewPairfactory(address common.Address, backend bind.ContractBackend) (*Pairfactory, error) {
   102  	contract, err := bindPairfactory(address, backend, backend, backend)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &Pairfactory{PairfactoryCaller: PairfactoryCaller{contract: contract}, PairfactoryTransactor: PairfactoryTransactor{contract: contract}, PairfactoryFilterer: PairfactoryFilterer{contract: contract}}, nil
   107  }
   108  
   109  // NewPairfactoryCaller creates a new read-only instance of Pairfactory, bound to a specific deployed contract.
   110  func NewPairfactoryCaller(address common.Address, caller bind.ContractCaller) (*PairfactoryCaller, error) {
   111  	contract, err := bindPairfactory(address, caller, nil, nil)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return &PairfactoryCaller{contract: contract}, nil
   116  }
   117  
   118  // NewPairfactoryTransactor creates a new write-only instance of Pairfactory, bound to a specific deployed contract.
   119  func NewPairfactoryTransactor(address common.Address, transactor bind.ContractTransactor) (*PairfactoryTransactor, error) {
   120  	contract, err := bindPairfactory(address, nil, transactor, nil)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &PairfactoryTransactor{contract: contract}, nil
   125  }
   126  
   127  // NewPairfactoryFilterer creates a new log filterer instance of Pairfactory, bound to a specific deployed contract.
   128  func NewPairfactoryFilterer(address common.Address, filterer bind.ContractFilterer) (*PairfactoryFilterer, error) {
   129  	contract, err := bindPairfactory(address, nil, nil, filterer)
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return &PairfactoryFilterer{contract: contract}, nil
   134  }
   135  
   136  // bindPairfactory binds a generic wrapper to an already deployed contract.
   137  func bindPairfactory(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
   138  	parsed, err := PairfactoryMetaData.GetAbi()
   139  	if err != nil {
   140  		return nil, err
   141  	}
   142  	return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil
   143  }
   144  
   145  // Call invokes the (constant) contract method with params as input values and
   146  // sets the output to result. The result type might be a single field for simple
   147  // returns, a slice of interfaces for anonymous returns and a struct for named
   148  // returns.
   149  func (_Pairfactory *PairfactoryRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   150  	return _Pairfactory.Contract.PairfactoryCaller.contract.Call(opts, result, method, params...)
   151  }
   152  
   153  // Transfer initiates a plain transaction to move funds to the contract, calling
   154  // its default method if one is available.
   155  func (_Pairfactory *PairfactoryRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   156  	return _Pairfactory.Contract.PairfactoryTransactor.contract.Transfer(opts)
   157  }
   158  
   159  // Transact invokes the (paid) contract method with params as input values.
   160  func (_Pairfactory *PairfactoryRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   161  	return _Pairfactory.Contract.PairfactoryTransactor.contract.Transact(opts, method, params...)
   162  }
   163  
   164  // Call invokes the (constant) contract method with params as input values and
   165  // sets the output to result. The result type might be a single field for simple
   166  // returns, a slice of interfaces for anonymous returns and a struct for named
   167  // returns.
   168  func (_Pairfactory *PairfactoryCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   169  	return _Pairfactory.Contract.contract.Call(opts, result, method, params...)
   170  }
   171  
   172  // Transfer initiates a plain transaction to move funds to the contract, calling
   173  // its default method if one is available.
   174  func (_Pairfactory *PairfactoryTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   175  	return _Pairfactory.Contract.contract.Transfer(opts)
   176  }
   177  
   178  // Transact invokes the (paid) contract method with params as input values.
   179  func (_Pairfactory *PairfactoryTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   180  	return _Pairfactory.Contract.contract.Transact(opts, method, params...)
   181  }
   182  
   183  // IsFactoryPool is a free data retrieval call binding the contract method 0x578eaca4.
   184  //
   185  // Solidity: function isFactoryPool(address pool) view returns(bool)
   186  func (_Pairfactory *PairfactoryCaller) IsFactoryPool(opts *bind.CallOpts, pool common.Address) (bool, error) {
   187  	var out []interface{}
   188  	err := _Pairfactory.contract.Call(opts, &out, "isFactoryPool", pool)
   189  
   190  	if err != nil {
   191  		return *new(bool), err
   192  	}
   193  
   194  	out0 := *abi.ConvertType(out[0], new(bool)).(*bool)
   195  
   196  	return out0, err
   197  
   198  }
   199  
   200  // IsFactoryPool is a free data retrieval call binding the contract method 0x578eaca4.
   201  //
   202  // Solidity: function isFactoryPool(address pool) view returns(bool)
   203  func (_Pairfactory *PairfactorySession) IsFactoryPool(pool common.Address) (bool, error) {
   204  	return _Pairfactory.Contract.IsFactoryPool(&_Pairfactory.CallOpts, pool)
   205  }
   206  
   207  // IsFactoryPool is a free data retrieval call binding the contract method 0x578eaca4.
   208  //
   209  // Solidity: function isFactoryPool(address pool) view returns(bool)
   210  func (_Pairfactory *PairfactoryCallerSession) IsFactoryPool(pool common.Address) (bool, error) {
   211  	return _Pairfactory.Contract.IsFactoryPool(&_Pairfactory.CallOpts, pool)
   212  }
   213  
   214  // Lookup is a free data retrieval call binding the contract method 0xc697217a.
   215  //
   216  // Solidity: function lookup(uint256 fee, uint256 tickSpacing, int256 lookback, address tokenA, address tokenB) view returns(address)
   217  func (_Pairfactory *PairfactoryCaller) Lookup(opts *bind.CallOpts, fee *big.Int, tickSpacing *big.Int, lookback *big.Int, tokenA common.Address, tokenB common.Address) (common.Address, error) {
   218  	var out []interface{}
   219  	err := _Pairfactory.contract.Call(opts, &out, "lookup", fee, tickSpacing, lookback, tokenA, tokenB)
   220  
   221  	if err != nil {
   222  		return *new(common.Address), err
   223  	}
   224  
   225  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   226  
   227  	return out0, err
   228  
   229  }
   230  
   231  // Lookup is a free data retrieval call binding the contract method 0xc697217a.
   232  //
   233  // Solidity: function lookup(uint256 fee, uint256 tickSpacing, int256 lookback, address tokenA, address tokenB) view returns(address)
   234  func (_Pairfactory *PairfactorySession) Lookup(fee *big.Int, tickSpacing *big.Int, lookback *big.Int, tokenA common.Address, tokenB common.Address) (common.Address, error) {
   235  	return _Pairfactory.Contract.Lookup(&_Pairfactory.CallOpts, fee, tickSpacing, lookback, tokenA, tokenB)
   236  }
   237  
   238  // Lookup is a free data retrieval call binding the contract method 0xc697217a.
   239  //
   240  // Solidity: function lookup(uint256 fee, uint256 tickSpacing, int256 lookback, address tokenA, address tokenB) view returns(address)
   241  func (_Pairfactory *PairfactoryCallerSession) Lookup(fee *big.Int, tickSpacing *big.Int, lookback *big.Int, tokenA common.Address, tokenB common.Address) (common.Address, error) {
   242  	return _Pairfactory.Contract.Lookup(&_Pairfactory.CallOpts, fee, tickSpacing, lookback, tokenA, tokenB)
   243  }
   244  
   245  // Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
   246  //
   247  // Solidity: function owner() view returns(address)
   248  func (_Pairfactory *PairfactoryCaller) Owner(opts *bind.CallOpts) (common.Address, error) {
   249  	var out []interface{}
   250  	err := _Pairfactory.contract.Call(opts, &out, "owner")
   251  
   252  	if err != nil {
   253  		return *new(common.Address), err
   254  	}
   255  
   256  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   257  
   258  	return out0, err
   259  
   260  }
   261  
   262  // Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
   263  //
   264  // Solidity: function owner() view returns(address)
   265  func (_Pairfactory *PairfactorySession) Owner() (common.Address, error) {
   266  	return _Pairfactory.Contract.Owner(&_Pairfactory.CallOpts)
   267  }
   268  
   269  // Owner is a free data retrieval call binding the contract method 0x8da5cb5b.
   270  //
   271  // Solidity: function owner() view returns(address)
   272  func (_Pairfactory *PairfactoryCallerSession) Owner() (common.Address, error) {
   273  	return _Pairfactory.Contract.Owner(&_Pairfactory.CallOpts)
   274  }
   275  
   276  // Position is a free data retrieval call binding the contract method 0x09218e91.
   277  //
   278  // Solidity: function position() view returns(address)
   279  func (_Pairfactory *PairfactoryCaller) Position(opts *bind.CallOpts) (common.Address, error) {
   280  	var out []interface{}
   281  	err := _Pairfactory.contract.Call(opts, &out, "position")
   282  
   283  	if err != nil {
   284  		return *new(common.Address), err
   285  	}
   286  
   287  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   288  
   289  	return out0, err
   290  
   291  }
   292  
   293  // Position is a free data retrieval call binding the contract method 0x09218e91.
   294  //
   295  // Solidity: function position() view returns(address)
   296  func (_Pairfactory *PairfactorySession) Position() (common.Address, error) {
   297  	return _Pairfactory.Contract.Position(&_Pairfactory.CallOpts)
   298  }
   299  
   300  // Position is a free data retrieval call binding the contract method 0x09218e91.
   301  //
   302  // Solidity: function position() view returns(address)
   303  func (_Pairfactory *PairfactoryCallerSession) Position() (common.Address, error) {
   304  	return _Pairfactory.Contract.Position(&_Pairfactory.CallOpts)
   305  }
   306  
   307  // ProtocolFeeRatio is a free data retrieval call binding the contract method 0x7a27d9f6.
   308  //
   309  // Solidity: function protocolFeeRatio() view returns(uint64)
   310  func (_Pairfactory *PairfactoryCaller) ProtocolFeeRatio(opts *bind.CallOpts) (uint64, error) {
   311  	var out []interface{}
   312  	err := _Pairfactory.contract.Call(opts, &out, "protocolFeeRatio")
   313  
   314  	if err != nil {
   315  		return *new(uint64), err
   316  	}
   317  
   318  	out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64)
   319  
   320  	return out0, err
   321  
   322  }
   323  
   324  // ProtocolFeeRatio is a free data retrieval call binding the contract method 0x7a27d9f6.
   325  //
   326  // Solidity: function protocolFeeRatio() view returns(uint64)
   327  func (_Pairfactory *PairfactorySession) ProtocolFeeRatio() (uint64, error) {
   328  	return _Pairfactory.Contract.ProtocolFeeRatio(&_Pairfactory.CallOpts)
   329  }
   330  
   331  // ProtocolFeeRatio is a free data retrieval call binding the contract method 0x7a27d9f6.
   332  //
   333  // Solidity: function protocolFeeRatio() view returns(uint64)
   334  func (_Pairfactory *PairfactoryCallerSession) ProtocolFeeRatio() (uint64, error) {
   335  	return _Pairfactory.Contract.ProtocolFeeRatio(&_Pairfactory.CallOpts)
   336  }
   337  
   338  // Create is a paid mutator transaction binding the contract method 0x71861ede.
   339  //
   340  // Solidity: function create(uint256 _fee, uint256 _tickSpacing, int256 _lookback, int32 _activeTick, address _tokenA, address _tokenB) returns(address)
   341  func (_Pairfactory *PairfactoryTransactor) Create(opts *bind.TransactOpts, _fee *big.Int, _tickSpacing *big.Int, _lookback *big.Int, _activeTick int32, _tokenA common.Address, _tokenB common.Address) (*types.Transaction, error) {
   342  	return _Pairfactory.contract.Transact(opts, "create", _fee, _tickSpacing, _lookback, _activeTick, _tokenA, _tokenB)
   343  }
   344  
   345  // Create is a paid mutator transaction binding the contract method 0x71861ede.
   346  //
   347  // Solidity: function create(uint256 _fee, uint256 _tickSpacing, int256 _lookback, int32 _activeTick, address _tokenA, address _tokenB) returns(address)
   348  func (_Pairfactory *PairfactorySession) Create(_fee *big.Int, _tickSpacing *big.Int, _lookback *big.Int, _activeTick int32, _tokenA common.Address, _tokenB common.Address) (*types.Transaction, error) {
   349  	return _Pairfactory.Contract.Create(&_Pairfactory.TransactOpts, _fee, _tickSpacing, _lookback, _activeTick, _tokenA, _tokenB)
   350  }
   351  
   352  // Create is a paid mutator transaction binding the contract method 0x71861ede.
   353  //
   354  // Solidity: function create(uint256 _fee, uint256 _tickSpacing, int256 _lookback, int32 _activeTick, address _tokenA, address _tokenB) returns(address)
   355  func (_Pairfactory *PairfactoryTransactorSession) Create(_fee *big.Int, _tickSpacing *big.Int, _lookback *big.Int, _activeTick int32, _tokenA common.Address, _tokenB common.Address) (*types.Transaction, error) {
   356  	return _Pairfactory.Contract.Create(&_Pairfactory.TransactOpts, _fee, _tickSpacing, _lookback, _activeTick, _tokenA, _tokenB)
   357  }
   358  
   359  // PairfactoryPoolCreatedIterator is returned from FilterPoolCreated and is used to iterate over the raw logs and unpacked data for PoolCreated events raised by the Pairfactory contract.
   360  type PairfactoryPoolCreatedIterator struct {
   361  	Event *PairfactoryPoolCreated // Event containing the contract specifics and raw log
   362  
   363  	contract *bind.BoundContract // Generic contract to use for unpacking event data
   364  	event    string              // Event name to use for unpacking event data
   365  
   366  	logs chan types.Log        // Log channel receiving the found contract events
   367  	sub  ethereum.Subscription // Subscription for errors, completion and termination
   368  	done bool                  // Whether the subscription completed delivering logs
   369  	fail error                 // Occurred error to stop iteration
   370  }
   371  
   372  // Next advances the iterator to the subsequent event, returning whether there
   373  // are any more events found. In case of a retrieval or parsing error, false is
   374  // returned and Error() can be queried for the exact failure.
   375  func (it *PairfactoryPoolCreatedIterator) Next() bool {
   376  	// If the iterator failed, stop iterating
   377  	if it.fail != nil {
   378  		return false
   379  	}
   380  	// If the iterator completed, deliver directly whatever's available
   381  	if it.done {
   382  		select {
   383  		case log := <-it.logs:
   384  			it.Event = new(PairfactoryPoolCreated)
   385  			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   386  				it.fail = err
   387  				return false
   388  			}
   389  			it.Event.Raw = log
   390  			return true
   391  
   392  		default:
   393  			return false
   394  		}
   395  	}
   396  	// Iterator still in progress, wait for either a data or an error event
   397  	select {
   398  	case log := <-it.logs:
   399  		it.Event = new(PairfactoryPoolCreated)
   400  		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   401  			it.fail = err
   402  			return false
   403  		}
   404  		it.Event.Raw = log
   405  		return true
   406  
   407  	case err := <-it.sub.Err():
   408  		it.done = true
   409  		it.fail = err
   410  		return it.Next()
   411  	}
   412  }
   413  
   414  // Error returns any retrieval or parsing error occurred during filtering.
   415  func (it *PairfactoryPoolCreatedIterator) Error() error {
   416  	return it.fail
   417  }
   418  
   419  // Close terminates the iteration process, releasing any pending underlying
   420  // resources.
   421  func (it *PairfactoryPoolCreatedIterator) Close() error {
   422  	it.sub.Unsubscribe()
   423  	return nil
   424  }
   425  
   426  // PairfactoryPoolCreated represents a PoolCreated event raised by the Pairfactory contract.
   427  type PairfactoryPoolCreated struct {
   428  	PoolAddress      common.Address
   429  	Fee              *big.Int
   430  	TickSpacing      *big.Int
   431  	ActiveTick       int32
   432  	Lookback         *big.Int
   433  	ProtocolFeeRatio uint64
   434  	TokenA           common.Address
   435  	TokenB           common.Address
   436  	Raw              types.Log // Blockchain specific contextual infos
   437  }
   438  
   439  // FilterPoolCreated is a free log retrieval operation binding the contract event 0x9b3fb3a17b4e94eb4d1217257372dcc712218fcd4bc1c28482bd8a6804a7c775.
   440  //
   441  // Solidity: event PoolCreated(address poolAddress, uint256 fee, uint256 tickSpacing, int32 activeTick, int256 lookback, uint64 protocolFeeRatio, address tokenA, address tokenB)
   442  func (_Pairfactory *PairfactoryFilterer) FilterPoolCreated(opts *bind.FilterOpts) (*PairfactoryPoolCreatedIterator, error) {
   443  
   444  	logs, sub, err := _Pairfactory.contract.FilterLogs(opts, "PoolCreated")
   445  	if err != nil {
   446  		return nil, err
   447  	}
   448  	return &PairfactoryPoolCreatedIterator{contract: _Pairfactory.contract, event: "PoolCreated", logs: logs, sub: sub}, nil
   449  }
   450  
   451  // WatchPoolCreated is a free log subscription operation binding the contract event 0x9b3fb3a17b4e94eb4d1217257372dcc712218fcd4bc1c28482bd8a6804a7c775.
   452  //
   453  // Solidity: event PoolCreated(address poolAddress, uint256 fee, uint256 tickSpacing, int32 activeTick, int256 lookback, uint64 protocolFeeRatio, address tokenA, address tokenB)
   454  func (_Pairfactory *PairfactoryFilterer) WatchPoolCreated(opts *bind.WatchOpts, sink chan<- *PairfactoryPoolCreated) (event.Subscription, error) {
   455  
   456  	logs, sub, err := _Pairfactory.contract.WatchLogs(opts, "PoolCreated")
   457  	if err != nil {
   458  		return nil, err
   459  	}
   460  	return event.NewSubscription(func(quit <-chan struct{}) error {
   461  		defer sub.Unsubscribe()
   462  		for {
   463  			select {
   464  			case log := <-logs:
   465  				// New log arrived, parse the event and forward to the user
   466  				event := new(PairfactoryPoolCreated)
   467  				if err := _Pairfactory.contract.UnpackLog(event, "PoolCreated", log); err != nil {
   468  					return err
   469  				}
   470  				event.Raw = log
   471  
   472  				select {
   473  				case sink <- event:
   474  				case err := <-sub.Err():
   475  					return err
   476  				case <-quit:
   477  					return nil
   478  				}
   479  			case err := <-sub.Err():
   480  				return err
   481  			case <-quit:
   482  				return nil
   483  			}
   484  		}
   485  	}), nil
   486  }
   487  
   488  // ParsePoolCreated is a log parse operation binding the contract event 0x9b3fb3a17b4e94eb4d1217257372dcc712218fcd4bc1c28482bd8a6804a7c775.
   489  //
   490  // Solidity: event PoolCreated(address poolAddress, uint256 fee, uint256 tickSpacing, int32 activeTick, int256 lookback, uint64 protocolFeeRatio, address tokenA, address tokenB)
   491  func (_Pairfactory *PairfactoryFilterer) ParsePoolCreated(log types.Log) (*PairfactoryPoolCreated, error) {
   492  	event := new(PairfactoryPoolCreated)
   493  	if err := _Pairfactory.contract.UnpackLog(event, "PoolCreated", log); err != nil {
   494  		return nil, err
   495  	}
   496  	event.Raw = log
   497  	return event, nil
   498  }
   499  
   500  // PairfactorySetFactoryOwnerIterator is returned from FilterSetFactoryOwner and is used to iterate over the raw logs and unpacked data for SetFactoryOwner events raised by the Pairfactory contract.
   501  type PairfactorySetFactoryOwnerIterator struct {
   502  	Event *PairfactorySetFactoryOwner // Event containing the contract specifics and raw log
   503  
   504  	contract *bind.BoundContract // Generic contract to use for unpacking event data
   505  	event    string              // Event name to use for unpacking event data
   506  
   507  	logs chan types.Log        // Log channel receiving the found contract events
   508  	sub  ethereum.Subscription // Subscription for errors, completion and termination
   509  	done bool                  // Whether the subscription completed delivering logs
   510  	fail error                 // Occurred error to stop iteration
   511  }
   512  
   513  // Next advances the iterator to the subsequent event, returning whether there
   514  // are any more events found. In case of a retrieval or parsing error, false is
   515  // returned and Error() can be queried for the exact failure.
   516  func (it *PairfactorySetFactoryOwnerIterator) Next() bool {
   517  	// If the iterator failed, stop iterating
   518  	if it.fail != nil {
   519  		return false
   520  	}
   521  	// If the iterator completed, deliver directly whatever's available
   522  	if it.done {
   523  		select {
   524  		case log := <-it.logs:
   525  			it.Event = new(PairfactorySetFactoryOwner)
   526  			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   527  				it.fail = err
   528  				return false
   529  			}
   530  			it.Event.Raw = log
   531  			return true
   532  
   533  		default:
   534  			return false
   535  		}
   536  	}
   537  	// Iterator still in progress, wait for either a data or an error event
   538  	select {
   539  	case log := <-it.logs:
   540  		it.Event = new(PairfactorySetFactoryOwner)
   541  		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   542  			it.fail = err
   543  			return false
   544  		}
   545  		it.Event.Raw = log
   546  		return true
   547  
   548  	case err := <-it.sub.Err():
   549  		it.done = true
   550  		it.fail = err
   551  		return it.Next()
   552  	}
   553  }
   554  
   555  // Error returns any retrieval or parsing error occurred during filtering.
   556  func (it *PairfactorySetFactoryOwnerIterator) Error() error {
   557  	return it.fail
   558  }
   559  
   560  // Close terminates the iteration process, releasing any pending underlying
   561  // resources.
   562  func (it *PairfactorySetFactoryOwnerIterator) Close() error {
   563  	it.sub.Unsubscribe()
   564  	return nil
   565  }
   566  
   567  // PairfactorySetFactoryOwner represents a SetFactoryOwner event raised by the Pairfactory contract.
   568  type PairfactorySetFactoryOwner struct {
   569  	Owner common.Address
   570  	Raw   types.Log // Blockchain specific contextual infos
   571  }
   572  
   573  // FilterSetFactoryOwner is a free log retrieval operation binding the contract event 0xdbb9c2f238268c9ccb9adfe9e27e349c8d4841cca1d2ffe849ae9114177b8fc1.
   574  //
   575  // Solidity: event SetFactoryOwner(address owner)
   576  func (_Pairfactory *PairfactoryFilterer) FilterSetFactoryOwner(opts *bind.FilterOpts) (*PairfactorySetFactoryOwnerIterator, error) {
   577  
   578  	logs, sub, err := _Pairfactory.contract.FilterLogs(opts, "SetFactoryOwner")
   579  	if err != nil {
   580  		return nil, err
   581  	}
   582  	return &PairfactorySetFactoryOwnerIterator{contract: _Pairfactory.contract, event: "SetFactoryOwner", logs: logs, sub: sub}, nil
   583  }
   584  
   585  // WatchSetFactoryOwner is a free log subscription operation binding the contract event 0xdbb9c2f238268c9ccb9adfe9e27e349c8d4841cca1d2ffe849ae9114177b8fc1.
   586  //
   587  // Solidity: event SetFactoryOwner(address owner)
   588  func (_Pairfactory *PairfactoryFilterer) WatchSetFactoryOwner(opts *bind.WatchOpts, sink chan<- *PairfactorySetFactoryOwner) (event.Subscription, error) {
   589  
   590  	logs, sub, err := _Pairfactory.contract.WatchLogs(opts, "SetFactoryOwner")
   591  	if err != nil {
   592  		return nil, err
   593  	}
   594  	return event.NewSubscription(func(quit <-chan struct{}) error {
   595  		defer sub.Unsubscribe()
   596  		for {
   597  			select {
   598  			case log := <-logs:
   599  				// New log arrived, parse the event and forward to the user
   600  				event := new(PairfactorySetFactoryOwner)
   601  				if err := _Pairfactory.contract.UnpackLog(event, "SetFactoryOwner", log); err != nil {
   602  					return err
   603  				}
   604  				event.Raw = log
   605  
   606  				select {
   607  				case sink <- event:
   608  				case err := <-sub.Err():
   609  					return err
   610  				case <-quit:
   611  					return nil
   612  				}
   613  			case err := <-sub.Err():
   614  				return err
   615  			case <-quit:
   616  				return nil
   617  			}
   618  		}
   619  	}), nil
   620  }
   621  
   622  // ParseSetFactoryOwner is a log parse operation binding the contract event 0xdbb9c2f238268c9ccb9adfe9e27e349c8d4841cca1d2ffe849ae9114177b8fc1.
   623  //
   624  // Solidity: event SetFactoryOwner(address owner)
   625  func (_Pairfactory *PairfactoryFilterer) ParseSetFactoryOwner(log types.Log) (*PairfactorySetFactoryOwner, error) {
   626  	event := new(PairfactorySetFactoryOwner)
   627  	if err := _Pairfactory.contract.UnpackLog(event, "SetFactoryOwner", log); err != nil {
   628  		return nil, err
   629  	}
   630  	event.Raw = log
   631  	return event, nil
   632  }
   633  
   634  // PairfactorySetFactoryProtocolFeeRatioIterator is returned from FilterSetFactoryProtocolFeeRatio and is used to iterate over the raw logs and unpacked data for SetFactoryProtocolFeeRatio events raised by the Pairfactory contract.
   635  type PairfactorySetFactoryProtocolFeeRatioIterator struct {
   636  	Event *PairfactorySetFactoryProtocolFeeRatio // Event containing the contract specifics and raw log
   637  
   638  	contract *bind.BoundContract // Generic contract to use for unpacking event data
   639  	event    string              // Event name to use for unpacking event data
   640  
   641  	logs chan types.Log        // Log channel receiving the found contract events
   642  	sub  ethereum.Subscription // Subscription for errors, completion and termination
   643  	done bool                  // Whether the subscription completed delivering logs
   644  	fail error                 // Occurred error to stop iteration
   645  }
   646  
   647  // Next advances the iterator to the subsequent event, returning whether there
   648  // are any more events found. In case of a retrieval or parsing error, false is
   649  // returned and Error() can be queried for the exact failure.
   650  func (it *PairfactorySetFactoryProtocolFeeRatioIterator) Next() bool {
   651  	// If the iterator failed, stop iterating
   652  	if it.fail != nil {
   653  		return false
   654  	}
   655  	// If the iterator completed, deliver directly whatever's available
   656  	if it.done {
   657  		select {
   658  		case log := <-it.logs:
   659  			it.Event = new(PairfactorySetFactoryProtocolFeeRatio)
   660  			if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   661  				it.fail = err
   662  				return false
   663  			}
   664  			it.Event.Raw = log
   665  			return true
   666  
   667  		default:
   668  			return false
   669  		}
   670  	}
   671  	// Iterator still in progress, wait for either a data or an error event
   672  	select {
   673  	case log := <-it.logs:
   674  		it.Event = new(PairfactorySetFactoryProtocolFeeRatio)
   675  		if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
   676  			it.fail = err
   677  			return false
   678  		}
   679  		it.Event.Raw = log
   680  		return true
   681  
   682  	case err := <-it.sub.Err():
   683  		it.done = true
   684  		it.fail = err
   685  		return it.Next()
   686  	}
   687  }
   688  
   689  // Error returns any retrieval or parsing error occurred during filtering.
   690  func (it *PairfactorySetFactoryProtocolFeeRatioIterator) Error() error {
   691  	return it.fail
   692  }
   693  
   694  // Close terminates the iteration process, releasing any pending underlying
   695  // resources.
   696  func (it *PairfactorySetFactoryProtocolFeeRatioIterator) Close() error {
   697  	it.sub.Unsubscribe()
   698  	return nil
   699  }
   700  
   701  // PairfactorySetFactoryProtocolFeeRatio represents a SetFactoryProtocolFeeRatio event raised by the Pairfactory contract.
   702  type PairfactorySetFactoryProtocolFeeRatio struct {
   703  	ProtocolFeeRatio uint64
   704  	Raw              types.Log // Blockchain specific contextual infos
   705  }
   706  
   707  // FilterSetFactoryProtocolFeeRatio is a free log retrieval operation binding the contract event 0xa0b96532ac38eaae102ba1ac8b6cde2019d7170e8a984863a7755fda6408a55f.
   708  //
   709  // Solidity: event SetFactoryProtocolFeeRatio(uint64 protocolFeeRatio)
   710  func (_Pairfactory *PairfactoryFilterer) FilterSetFactoryProtocolFeeRatio(opts *bind.FilterOpts) (*PairfactorySetFactoryProtocolFeeRatioIterator, error) {
   711  
   712  	logs, sub, err := _Pairfactory.contract.FilterLogs(opts, "SetFactoryProtocolFeeRatio")
   713  	if err != nil {
   714  		return nil, err
   715  	}
   716  	return &PairfactorySetFactoryProtocolFeeRatioIterator{contract: _Pairfactory.contract, event: "SetFactoryProtocolFeeRatio", logs: logs, sub: sub}, nil
   717  }
   718  
   719  // WatchSetFactoryProtocolFeeRatio is a free log subscription operation binding the contract event 0xa0b96532ac38eaae102ba1ac8b6cde2019d7170e8a984863a7755fda6408a55f.
   720  //
   721  // Solidity: event SetFactoryProtocolFeeRatio(uint64 protocolFeeRatio)
   722  func (_Pairfactory *PairfactoryFilterer) WatchSetFactoryProtocolFeeRatio(opts *bind.WatchOpts, sink chan<- *PairfactorySetFactoryProtocolFeeRatio) (event.Subscription, error) {
   723  
   724  	logs, sub, err := _Pairfactory.contract.WatchLogs(opts, "SetFactoryProtocolFeeRatio")
   725  	if err != nil {
   726  		return nil, err
   727  	}
   728  	return event.NewSubscription(func(quit <-chan struct{}) error {
   729  		defer sub.Unsubscribe()
   730  		for {
   731  			select {
   732  			case log := <-logs:
   733  				// New log arrived, parse the event and forward to the user
   734  				event := new(PairfactorySetFactoryProtocolFeeRatio)
   735  				if err := _Pairfactory.contract.UnpackLog(event, "SetFactoryProtocolFeeRatio", log); err != nil {
   736  					return err
   737  				}
   738  				event.Raw = log
   739  
   740  				select {
   741  				case sink <- event:
   742  				case err := <-sub.Err():
   743  					return err
   744  				case <-quit:
   745  					return nil
   746  				}
   747  			case err := <-sub.Err():
   748  				return err
   749  			case <-quit:
   750  				return nil
   751  			}
   752  		}
   753  	}), nil
   754  }
   755  
   756  // ParseSetFactoryProtocolFeeRatio is a log parse operation binding the contract event 0xa0b96532ac38eaae102ba1ac8b6cde2019d7170e8a984863a7755fda6408a55f.
   757  //
   758  // Solidity: event SetFactoryProtocolFeeRatio(uint64 protocolFeeRatio)
   759  func (_Pairfactory *PairfactoryFilterer) ParseSetFactoryProtocolFeeRatio(log types.Log) (*PairfactorySetFactoryProtocolFeeRatio, error) {
   760  	event := new(PairfactorySetFactoryProtocolFeeRatio)
   761  	if err := _Pairfactory.contract.UnpackLog(event, "SetFactoryProtocolFeeRatio", log); err != nil {
   762  		return nil, err
   763  	}
   764  	event.Raw = log
   765  	return event, nil
   766  }