diff --git a/abi/pancake/pancake_pool.go b/abi/pancake/pancake_pool.go new file mode 100644 index 0000000..cfe7fa1 --- /dev/null +++ b/abi/pancake/pancake_pool.go @@ -0,0 +1,2643 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package pancake + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// PancakeMetaData contains all meta data concerning the Pancake contract. +var PancakeMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Burn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"Collect\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"name\":\"CollectProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"paid1\",\"type\":\"uint256\"}],\"name\":\"Flash\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextOld\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"observationCardinalityNextNew\",\"type\":\"uint16\"}],\"name\":\"IncreaseObservationCardinalityNext\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"}],\"name\":\"Initialize\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"indexed\":true,\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"name\":\"Mint\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol0Old\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol1Old\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol0New\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"feeProtocol1New\",\"type\":\"uint32\"}],\"name\":\"SetFeeProtocol\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"addr\",\"type\":\"address\"}],\"name\":\"SetLmPoolEvent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"},{\"indexed\":false,\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"protocolFeesToken0\",\"type\":\"uint128\"},{\"indexed\":false,\"internalType\":\"uint128\",\"name\":\"protocolFeesToken1\",\"type\":\"uint128\"}],\"name\":\"Swap\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"}],\"name\":\"burn\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collect\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint128\",\"name\":\"amount0Requested\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1Requested\",\"type\":\"uint128\"}],\"name\":\"collectProtocol\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"amount0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"amount1\",\"type\":\"uint128\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"internalType\":\"uint24\",\"name\":\"\",\"type\":\"uint24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal0X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"feeGrowthGlobal1X128\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"flash\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"}],\"name\":\"increaseObservationCardinalityNext\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lmPool\",\"outputs\":[{\"internalType\":\"contractIPancakeV3LmPool\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"},{\"internalType\":\"uint128\",\"name\":\"amount\",\"type\":\"uint128\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"mint\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amount0\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount1\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"internalType\":\"int56\",\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityCumulativeX128\",\"type\":\"uint160\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32[]\",\"name\":\"secondsAgos\",\"type\":\"uint32[]\"}],\"name\":\"observe\",\"outputs\":[{\"internalType\":\"int56[]\",\"name\":\"tickCumulatives\",\"type\":\"int56[]\"},{\"internalType\":\"uint160[]\",\"name\":\"secondsPerLiquidityCumulativeX128s\",\"type\":\"uint160[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"positions\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidity\",\"type\":\"uint128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside0LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthInside1LastX128\",\"type\":\"uint256\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"tokensOwed1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protocolFees\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"token0\",\"type\":\"uint128\"},{\"internalType\":\"uint128\",\"name\":\"token1\",\"type\":\"uint128\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"feeProtocol0\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol1\",\"type\":\"uint32\"}],\"name\":\"setFeeProtocol\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_lmPool\",\"type\":\"address\"}],\"name\":\"setLmPool\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"slot0\",\"outputs\":[{\"internalType\":\"uint160\",\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"internalType\":\"int24\",\"name\":\"tick\",\"type\":\"int24\"},{\"internalType\":\"uint16\",\"name\":\"observationIndex\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinality\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"feeProtocol\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"unlocked\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"tickLower\",\"type\":\"int24\"},{\"internalType\":\"int24\",\"name\":\"tickUpper\",\"type\":\"int24\"}],\"name\":\"snapshotCumulativesInside\",\"outputs\":[{\"internalType\":\"int56\",\"name\":\"tickCumulativeInside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityInsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsInside\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"internalType\":\"int256\",\"name\":\"amountSpecified\",\"type\":\"int256\"},{\"internalType\":\"uint160\",\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"amount0\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"amount1\",\"type\":\"int256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int16\",\"name\":\"\",\"type\":\"int16\"}],\"name\":\"tickBitmap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"int24\",\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"internalType\":\"uint128\",\"name\":\"liquidityGross\",\"type\":\"uint128\"},{\"internalType\":\"int128\",\"name\":\"liquidityNet\",\"type\":\"int128\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside0X128\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeGrowthOutside1X128\",\"type\":\"uint256\"},{\"internalType\":\"int56\",\"name\":\"tickCumulativeOutside\",\"type\":\"int56\"},{\"internalType\":\"uint160\",\"name\":\"secondsPerLiquidityOutsideX128\",\"type\":\"uint160\"},{\"internalType\":\"uint32\",\"name\":\"secondsOutside\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"initialized\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// PancakeABI is the input ABI used to generate the binding from. +// Deprecated: Use PancakeMetaData.ABI instead. +var PancakeABI = PancakeMetaData.ABI + +// Pancake is an auto generated Go binding around an Ethereum contract. +type Pancake struct { + PancakeCaller // Read-only binding to the contract + PancakeTransactor // Write-only binding to the contract + PancakeFilterer // Log filterer for contract events +} + +// PancakeCaller is an auto generated read-only Go binding around an Ethereum contract. +type PancakeCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PancakeTransactor is an auto generated write-only Go binding around an Ethereum contract. +type PancakeTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PancakeFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type PancakeFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// PancakeSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type PancakeSession struct { + Contract *Pancake // 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 +} + +// PancakeCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type PancakeCallerSession struct { + Contract *PancakeCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// PancakeTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type PancakeTransactorSession struct { + Contract *PancakeTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// PancakeRaw is an auto generated low-level Go binding around an Ethereum contract. +type PancakeRaw struct { + Contract *Pancake // Generic contract binding to access the raw methods on +} + +// PancakeCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type PancakeCallerRaw struct { + Contract *PancakeCaller // Generic read-only contract binding to access the raw methods on +} + +// PancakeTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type PancakeTransactorRaw struct { + Contract *PancakeTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewPancake creates a new instance of Pancake, bound to a specific deployed contract. +func NewPancake(address common.Address, backend bind.ContractBackend) (*Pancake, error) { + contract, err := bindPancake(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &Pancake{PancakeCaller: PancakeCaller{contract: contract}, PancakeTransactor: PancakeTransactor{contract: contract}, PancakeFilterer: PancakeFilterer{contract: contract}}, nil +} + +// NewPancakeCaller creates a new read-only instance of Pancake, bound to a specific deployed contract. +func NewPancakeCaller(address common.Address, caller bind.ContractCaller) (*PancakeCaller, error) { + contract, err := bindPancake(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &PancakeCaller{contract: contract}, nil +} + +// NewPancakeTransactor creates a new write-only instance of Pancake, bound to a specific deployed contract. +func NewPancakeTransactor(address common.Address, transactor bind.ContractTransactor) (*PancakeTransactor, error) { + contract, err := bindPancake(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &PancakeTransactor{contract: contract}, nil +} + +// NewPancakeFilterer creates a new log filterer instance of Pancake, bound to a specific deployed contract. +func NewPancakeFilterer(address common.Address, filterer bind.ContractFilterer) (*PancakeFilterer, error) { + contract, err := bindPancake(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &PancakeFilterer{contract: contract}, nil +} + +// bindPancake binds a generic wrapper to an already deployed contract. +func bindPancake(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := PancakeMetaData.GetAbi() + 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 (_Pancake *PancakeRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Pancake.Contract.PancakeCaller.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 (_Pancake *PancakeRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pancake.Contract.PancakeTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Pancake *PancakeRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Pancake.Contract.PancakeTransactor.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 (_Pancake *PancakeCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _Pancake.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 (_Pancake *PancakeTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _Pancake.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_Pancake *PancakeTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _Pancake.Contract.contract.Transact(opts, method, params...) +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_Pancake *PancakeCaller) Factory(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "factory") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_Pancake *PancakeSession) Factory() (common.Address, error) { + return _Pancake.Contract.Factory(&_Pancake.CallOpts) +} + +// Factory is a free data retrieval call binding the contract method 0xc45a0155. +// +// Solidity: function factory() view returns(address) +func (_Pancake *PancakeCallerSession) Factory() (common.Address, error) { + return _Pancake.Contract.Factory(&_Pancake.CallOpts) +} + +// Fee is a free data retrieval call binding the contract method 0xddca3f43. +// +// Solidity: function fee() view returns(uint24) +func (_Pancake *PancakeCaller) Fee(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "fee") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Fee is a free data retrieval call binding the contract method 0xddca3f43. +// +// Solidity: function fee() view returns(uint24) +func (_Pancake *PancakeSession) Fee() (*big.Int, error) { + return _Pancake.Contract.Fee(&_Pancake.CallOpts) +} + +// Fee is a free data retrieval call binding the contract method 0xddca3f43. +// +// Solidity: function fee() view returns(uint24) +func (_Pancake *PancakeCallerSession) Fee() (*big.Int, error) { + return _Pancake.Contract.Fee(&_Pancake.CallOpts) +} + +// FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. +// +// Solidity: function feeGrowthGlobal0X128() view returns(uint256) +func (_Pancake *PancakeCaller) FeeGrowthGlobal0X128(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "feeGrowthGlobal0X128") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. +// +// Solidity: function feeGrowthGlobal0X128() view returns(uint256) +func (_Pancake *PancakeSession) FeeGrowthGlobal0X128() (*big.Int, error) { + return _Pancake.Contract.FeeGrowthGlobal0X128(&_Pancake.CallOpts) +} + +// FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399. +// +// Solidity: function feeGrowthGlobal0X128() view returns(uint256) +func (_Pancake *PancakeCallerSession) FeeGrowthGlobal0X128() (*big.Int, error) { + return _Pancake.Contract.FeeGrowthGlobal0X128(&_Pancake.CallOpts) +} + +// FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. +// +// Solidity: function feeGrowthGlobal1X128() view returns(uint256) +func (_Pancake *PancakeCaller) FeeGrowthGlobal1X128(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "feeGrowthGlobal1X128") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. +// +// Solidity: function feeGrowthGlobal1X128() view returns(uint256) +func (_Pancake *PancakeSession) FeeGrowthGlobal1X128() (*big.Int, error) { + return _Pancake.Contract.FeeGrowthGlobal1X128(&_Pancake.CallOpts) +} + +// FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319. +// +// Solidity: function feeGrowthGlobal1X128() view returns(uint256) +func (_Pancake *PancakeCallerSession) FeeGrowthGlobal1X128() (*big.Int, error) { + return _Pancake.Contract.FeeGrowthGlobal1X128(&_Pancake.CallOpts) +} + +// Liquidity is a free data retrieval call binding the contract method 0x1a686502. +// +// Solidity: function liquidity() view returns(uint128) +func (_Pancake *PancakeCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "liquidity") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// Liquidity is a free data retrieval call binding the contract method 0x1a686502. +// +// Solidity: function liquidity() view returns(uint128) +func (_Pancake *PancakeSession) Liquidity() (*big.Int, error) { + return _Pancake.Contract.Liquidity(&_Pancake.CallOpts) +} + +// Liquidity is a free data retrieval call binding the contract method 0x1a686502. +// +// Solidity: function liquidity() view returns(uint128) +func (_Pancake *PancakeCallerSession) Liquidity() (*big.Int, error) { + return _Pancake.Contract.Liquidity(&_Pancake.CallOpts) +} + +// LmPool is a free data retrieval call binding the contract method 0x540d4918. +// +// Solidity: function lmPool() view returns(address) +func (_Pancake *PancakeCaller) LmPool(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "lmPool") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// LmPool is a free data retrieval call binding the contract method 0x540d4918. +// +// Solidity: function lmPool() view returns(address) +func (_Pancake *PancakeSession) LmPool() (common.Address, error) { + return _Pancake.Contract.LmPool(&_Pancake.CallOpts) +} + +// LmPool is a free data retrieval call binding the contract method 0x540d4918. +// +// Solidity: function lmPool() view returns(address) +func (_Pancake *PancakeCallerSession) LmPool() (common.Address, error) { + return _Pancake.Contract.LmPool(&_Pancake.CallOpts) +} + +// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. +// +// Solidity: function maxLiquidityPerTick() view returns(uint128) +func (_Pancake *PancakeCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "maxLiquidityPerTick") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. +// +// Solidity: function maxLiquidityPerTick() view returns(uint128) +func (_Pancake *PancakeSession) MaxLiquidityPerTick() (*big.Int, error) { + return _Pancake.Contract.MaxLiquidityPerTick(&_Pancake.CallOpts) +} + +// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a. +// +// Solidity: function maxLiquidityPerTick() view returns(uint128) +func (_Pancake *PancakeCallerSession) MaxLiquidityPerTick() (*big.Int, error) { + return _Pancake.Contract.MaxLiquidityPerTick(&_Pancake.CallOpts) +} + +// Observations is a free data retrieval call binding the contract method 0x252c09d7. +// +// Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) +func (_Pancake *PancakeCaller) Observations(opts *bind.CallOpts, arg0 *big.Int) (struct { + BlockTimestamp uint32 + TickCumulative *big.Int + SecondsPerLiquidityCumulativeX128 *big.Int + Initialized bool +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "observations", arg0) + + outstruct := new(struct { + BlockTimestamp uint32 + TickCumulative *big.Int + SecondsPerLiquidityCumulativeX128 *big.Int + Initialized bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.BlockTimestamp = *abi.ConvertType(out[0], new(uint32)).(*uint32) + outstruct.TickCumulative = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.SecondsPerLiquidityCumulativeX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.Initialized = *abi.ConvertType(out[3], new(bool)).(*bool) + + return *outstruct, err + +} + +// Observations is a free data retrieval call binding the contract method 0x252c09d7. +// +// Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) +func (_Pancake *PancakeSession) Observations(arg0 *big.Int) (struct { + BlockTimestamp uint32 + TickCumulative *big.Int + SecondsPerLiquidityCumulativeX128 *big.Int + Initialized bool +}, error) { + return _Pancake.Contract.Observations(&_Pancake.CallOpts, arg0) +} + +// Observations is a free data retrieval call binding the contract method 0x252c09d7. +// +// Solidity: function observations(uint256 ) view returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized) +func (_Pancake *PancakeCallerSession) Observations(arg0 *big.Int) (struct { + BlockTimestamp uint32 + TickCumulative *big.Int + SecondsPerLiquidityCumulativeX128 *big.Int + Initialized bool +}, error) { + return _Pancake.Contract.Observations(&_Pancake.CallOpts, arg0) +} + +// Observe is a free data retrieval call binding the contract method 0x883bdbfd. +// +// Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) +func (_Pancake *PancakeCaller) Observe(opts *bind.CallOpts, secondsAgos []uint32) (struct { + TickCumulatives []*big.Int + SecondsPerLiquidityCumulativeX128s []*big.Int +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "observe", secondsAgos) + + outstruct := new(struct { + TickCumulatives []*big.Int + SecondsPerLiquidityCumulativeX128s []*big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.TickCumulatives = *abi.ConvertType(out[0], new([]*big.Int)).(*[]*big.Int) + outstruct.SecondsPerLiquidityCumulativeX128s = *abi.ConvertType(out[1], new([]*big.Int)).(*[]*big.Int) + + return *outstruct, err + +} + +// Observe is a free data retrieval call binding the contract method 0x883bdbfd. +// +// Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) +func (_Pancake *PancakeSession) Observe(secondsAgos []uint32) (struct { + TickCumulatives []*big.Int + SecondsPerLiquidityCumulativeX128s []*big.Int +}, error) { + return _Pancake.Contract.Observe(&_Pancake.CallOpts, secondsAgos) +} + +// Observe is a free data retrieval call binding the contract method 0x883bdbfd. +// +// Solidity: function observe(uint32[] secondsAgos) view returns(int56[] tickCumulatives, uint160[] secondsPerLiquidityCumulativeX128s) +func (_Pancake *PancakeCallerSession) Observe(secondsAgos []uint32) (struct { + TickCumulatives []*big.Int + SecondsPerLiquidityCumulativeX128s []*big.Int +}, error) { + return _Pancake.Contract.Observe(&_Pancake.CallOpts, secondsAgos) +} + +// Positions is a free data retrieval call binding the contract method 0x514ea4bf. +// +// Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) +func (_Pancake *PancakeCaller) Positions(opts *bind.CallOpts, arg0 [32]byte) (struct { + Liquidity *big.Int + FeeGrowthInside0LastX128 *big.Int + FeeGrowthInside1LastX128 *big.Int + TokensOwed0 *big.Int + TokensOwed1 *big.Int +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "positions", arg0) + + outstruct := new(struct { + Liquidity *big.Int + FeeGrowthInside0LastX128 *big.Int + FeeGrowthInside1LastX128 *big.Int + TokensOwed0 *big.Int + TokensOwed1 *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Liquidity = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.FeeGrowthInside0LastX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.FeeGrowthInside1LastX128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.TokensOwed0 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.TokensOwed1 = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// Positions is a free data retrieval call binding the contract method 0x514ea4bf. +// +// Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) +func (_Pancake *PancakeSession) Positions(arg0 [32]byte) (struct { + Liquidity *big.Int + FeeGrowthInside0LastX128 *big.Int + FeeGrowthInside1LastX128 *big.Int + TokensOwed0 *big.Int + TokensOwed1 *big.Int +}, error) { + return _Pancake.Contract.Positions(&_Pancake.CallOpts, arg0) +} + +// Positions is a free data retrieval call binding the contract method 0x514ea4bf. +// +// Solidity: function positions(bytes32 ) view returns(uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1) +func (_Pancake *PancakeCallerSession) Positions(arg0 [32]byte) (struct { + Liquidity *big.Int + FeeGrowthInside0LastX128 *big.Int + FeeGrowthInside1LastX128 *big.Int + TokensOwed0 *big.Int + TokensOwed1 *big.Int +}, error) { + return _Pancake.Contract.Positions(&_Pancake.CallOpts, arg0) +} + +// ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. +// +// Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) +func (_Pancake *PancakeCaller) ProtocolFees(opts *bind.CallOpts) (struct { + Token0 *big.Int + Token1 *big.Int +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "protocolFees") + + outstruct := new(struct { + Token0 *big.Int + Token1 *big.Int + }) + if err != nil { + return *outstruct, err + } + + outstruct.Token0 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Token1 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + + return *outstruct, err + +} + +// ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. +// +// Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) +func (_Pancake *PancakeSession) ProtocolFees() (struct { + Token0 *big.Int + Token1 *big.Int +}, error) { + return _Pancake.Contract.ProtocolFees(&_Pancake.CallOpts) +} + +// ProtocolFees is a free data retrieval call binding the contract method 0x1ad8b03b. +// +// Solidity: function protocolFees() view returns(uint128 token0, uint128 token1) +func (_Pancake *PancakeCallerSession) ProtocolFees() (struct { + Token0 *big.Int + Token1 *big.Int +}, error) { + return _Pancake.Contract.ProtocolFees(&_Pancake.CallOpts) +} + +// Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. +// +// Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) +func (_Pancake *PancakeCaller) Slot0(opts *bind.CallOpts) (struct { + SqrtPriceX96 *big.Int + Tick *big.Int + ObservationIndex uint16 + ObservationCardinality uint16 + ObservationCardinalityNext uint16 + FeeProtocol uint32 + Unlocked bool +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "slot0") + + outstruct := new(struct { + SqrtPriceX96 *big.Int + Tick *big.Int + ObservationIndex uint16 + ObservationCardinality uint16 + ObservationCardinalityNext uint16 + FeeProtocol uint32 + Unlocked bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.SqrtPriceX96 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.ObservationIndex = *abi.ConvertType(out[2], new(uint16)).(*uint16) + outstruct.ObservationCardinality = *abi.ConvertType(out[3], new(uint16)).(*uint16) + outstruct.ObservationCardinalityNext = *abi.ConvertType(out[4], new(uint16)).(*uint16) + outstruct.FeeProtocol = *abi.ConvertType(out[5], new(uint32)).(*uint32) + outstruct.Unlocked = *abi.ConvertType(out[6], new(bool)).(*bool) + + return *outstruct, err + +} + +// Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. +// +// Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) +func (_Pancake *PancakeSession) Slot0() (struct { + SqrtPriceX96 *big.Int + Tick *big.Int + ObservationIndex uint16 + ObservationCardinality uint16 + ObservationCardinalityNext uint16 + FeeProtocol uint32 + Unlocked bool +}, error) { + return _Pancake.Contract.Slot0(&_Pancake.CallOpts) +} + +// Slot0 is a free data retrieval call binding the contract method 0x3850c7bd. +// +// Solidity: function slot0() view returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint32 feeProtocol, bool unlocked) +func (_Pancake *PancakeCallerSession) Slot0() (struct { + SqrtPriceX96 *big.Int + Tick *big.Int + ObservationIndex uint16 + ObservationCardinality uint16 + ObservationCardinalityNext uint16 + FeeProtocol uint32 + Unlocked bool +}, error) { + return _Pancake.Contract.Slot0(&_Pancake.CallOpts) +} + +// SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. +// +// Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) +func (_Pancake *PancakeCaller) SnapshotCumulativesInside(opts *bind.CallOpts, tickLower *big.Int, tickUpper *big.Int) (struct { + TickCumulativeInside *big.Int + SecondsPerLiquidityInsideX128 *big.Int + SecondsInside uint32 +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "snapshotCumulativesInside", tickLower, tickUpper) + + outstruct := new(struct { + TickCumulativeInside *big.Int + SecondsPerLiquidityInsideX128 *big.Int + SecondsInside uint32 + }) + if err != nil { + return *outstruct, err + } + + outstruct.TickCumulativeInside = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.SecondsPerLiquidityInsideX128 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.SecondsInside = *abi.ConvertType(out[2], new(uint32)).(*uint32) + + return *outstruct, err + +} + +// SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. +// +// Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) +func (_Pancake *PancakeSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { + TickCumulativeInside *big.Int + SecondsPerLiquidityInsideX128 *big.Int + SecondsInside uint32 +}, error) { + return _Pancake.Contract.SnapshotCumulativesInside(&_Pancake.CallOpts, tickLower, tickUpper) +} + +// SnapshotCumulativesInside is a free data retrieval call binding the contract method 0xa38807f2. +// +// Solidity: function snapshotCumulativesInside(int24 tickLower, int24 tickUpper) view returns(int56 tickCumulativeInside, uint160 secondsPerLiquidityInsideX128, uint32 secondsInside) +func (_Pancake *PancakeCallerSession) SnapshotCumulativesInside(tickLower *big.Int, tickUpper *big.Int) (struct { + TickCumulativeInside *big.Int + SecondsPerLiquidityInsideX128 *big.Int + SecondsInside uint32 +}, error) { + return _Pancake.Contract.SnapshotCumulativesInside(&_Pancake.CallOpts, tickLower, tickUpper) +} + +// TickBitmap is a free data retrieval call binding the contract method 0x5339c296. +// +// Solidity: function tickBitmap(int16 ) view returns(uint256) +func (_Pancake *PancakeCaller) TickBitmap(opts *bind.CallOpts, arg0 int16) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "tickBitmap", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TickBitmap is a free data retrieval call binding the contract method 0x5339c296. +// +// Solidity: function tickBitmap(int16 ) view returns(uint256) +func (_Pancake *PancakeSession) TickBitmap(arg0 int16) (*big.Int, error) { + return _Pancake.Contract.TickBitmap(&_Pancake.CallOpts, arg0) +} + +// TickBitmap is a free data retrieval call binding the contract method 0x5339c296. +// +// Solidity: function tickBitmap(int16 ) view returns(uint256) +func (_Pancake *PancakeCallerSession) TickBitmap(arg0 int16) (*big.Int, error) { + return _Pancake.Contract.TickBitmap(&_Pancake.CallOpts, arg0) +} + +// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. +// +// Solidity: function tickSpacing() view returns(int24) +func (_Pancake *PancakeCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "tickSpacing") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. +// +// Solidity: function tickSpacing() view returns(int24) +func (_Pancake *PancakeSession) TickSpacing() (*big.Int, error) { + return _Pancake.Contract.TickSpacing(&_Pancake.CallOpts) +} + +// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c. +// +// Solidity: function tickSpacing() view returns(int24) +func (_Pancake *PancakeCallerSession) TickSpacing() (*big.Int, error) { + return _Pancake.Contract.TickSpacing(&_Pancake.CallOpts) +} + +// Ticks is a free data retrieval call binding the contract method 0xf30dba93. +// +// Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) +func (_Pancake *PancakeCaller) Ticks(opts *bind.CallOpts, arg0 *big.Int) (struct { + LiquidityGross *big.Int + LiquidityNet *big.Int + FeeGrowthOutside0X128 *big.Int + FeeGrowthOutside1X128 *big.Int + TickCumulativeOutside *big.Int + SecondsPerLiquidityOutsideX128 *big.Int + SecondsOutside uint32 + Initialized bool +}, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "ticks", arg0) + + outstruct := new(struct { + LiquidityGross *big.Int + LiquidityNet *big.Int + FeeGrowthOutside0X128 *big.Int + FeeGrowthOutside1X128 *big.Int + TickCumulativeOutside *big.Int + SecondsPerLiquidityOutsideX128 *big.Int + SecondsOutside uint32 + Initialized bool + }) + if err != nil { + return *outstruct, err + } + + outstruct.LiquidityGross = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + outstruct.LiquidityNet = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) + outstruct.FeeGrowthOutside0X128 = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) + outstruct.FeeGrowthOutside1X128 = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + outstruct.TickCumulativeOutside = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.SecondsPerLiquidityOutsideX128 = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) + outstruct.SecondsOutside = *abi.ConvertType(out[6], new(uint32)).(*uint32) + outstruct.Initialized = *abi.ConvertType(out[7], new(bool)).(*bool) + + return *outstruct, err + +} + +// Ticks is a free data retrieval call binding the contract method 0xf30dba93. +// +// Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) +func (_Pancake *PancakeSession) Ticks(arg0 *big.Int) (struct { + LiquidityGross *big.Int + LiquidityNet *big.Int + FeeGrowthOutside0X128 *big.Int + FeeGrowthOutside1X128 *big.Int + TickCumulativeOutside *big.Int + SecondsPerLiquidityOutsideX128 *big.Int + SecondsOutside uint32 + Initialized bool +}, error) { + return _Pancake.Contract.Ticks(&_Pancake.CallOpts, arg0) +} + +// Ticks is a free data retrieval call binding the contract method 0xf30dba93. +// +// Solidity: function ticks(int24 ) view returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized) +func (_Pancake *PancakeCallerSession) Ticks(arg0 *big.Int) (struct { + LiquidityGross *big.Int + LiquidityNet *big.Int + FeeGrowthOutside0X128 *big.Int + FeeGrowthOutside1X128 *big.Int + TickCumulativeOutside *big.Int + SecondsPerLiquidityOutsideX128 *big.Int + SecondsOutside uint32 + Initialized bool +}, error) { + return _Pancake.Contract.Ticks(&_Pancake.CallOpts, arg0) +} + +// Token0 is a free data retrieval call binding the contract method 0x0dfe1681. +// +// Solidity: function token0() view returns(address) +func (_Pancake *PancakeCaller) Token0(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "token0") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Token0 is a free data retrieval call binding the contract method 0x0dfe1681. +// +// Solidity: function token0() view returns(address) +func (_Pancake *PancakeSession) Token0() (common.Address, error) { + return _Pancake.Contract.Token0(&_Pancake.CallOpts) +} + +// Token0 is a free data retrieval call binding the contract method 0x0dfe1681. +// +// Solidity: function token0() view returns(address) +func (_Pancake *PancakeCallerSession) Token0() (common.Address, error) { + return _Pancake.Contract.Token0(&_Pancake.CallOpts) +} + +// Token1 is a free data retrieval call binding the contract method 0xd21220a7. +// +// Solidity: function token1() view returns(address) +func (_Pancake *PancakeCaller) Token1(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Pancake.contract.Call(opts, &out, "token1") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Token1 is a free data retrieval call binding the contract method 0xd21220a7. +// +// Solidity: function token1() view returns(address) +func (_Pancake *PancakeSession) Token1() (common.Address, error) { + return _Pancake.Contract.Token1(&_Pancake.CallOpts) +} + +// Token1 is a free data retrieval call binding the contract method 0xd21220a7. +// +// Solidity: function token1() view returns(address) +func (_Pancake *PancakeCallerSession) Token1() (common.Address, error) { + return _Pancake.Contract.Token1(&_Pancake.CallOpts) +} + +// Burn is a paid mutator transaction binding the contract method 0xa34123a7. +// +// Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeTransactor) Burn(opts *bind.TransactOpts, tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "burn", tickLower, tickUpper, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0xa34123a7. +// +// Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Burn(&_Pancake.TransactOpts, tickLower, tickUpper, amount) +} + +// Burn is a paid mutator transaction binding the contract method 0xa34123a7. +// +// Solidity: function burn(int24 tickLower, int24 tickUpper, uint128 amount) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeTransactorSession) Burn(tickLower *big.Int, tickUpper *big.Int, amount *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Burn(&_Pancake.TransactOpts, tickLower, tickUpper, amount) +} + +// Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. +// +// Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeTransactor) Collect(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "collect", recipient, tickLower, tickUpper, amount0Requested, amount1Requested) +} + +// Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. +// +// Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Collect(&_Pancake.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) +} + +// Collect is a paid mutator transaction binding the contract method 0x4f1eb3d8. +// +// Solidity: function collect(address recipient, int24 tickLower, int24 tickUpper, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeTransactorSession) Collect(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Collect(&_Pancake.TransactOpts, recipient, tickLower, tickUpper, amount0Requested, amount1Requested) +} + +// CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. +// +// Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeTransactor) CollectProtocol(opts *bind.TransactOpts, recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "collectProtocol", recipient, amount0Requested, amount1Requested) +} + +// CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. +// +// Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeSession) CollectProtocol(recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.CollectProtocol(&_Pancake.TransactOpts, recipient, amount0Requested, amount1Requested) +} + +// CollectProtocol is a paid mutator transaction binding the contract method 0x85b66729. +// +// Solidity: function collectProtocol(address recipient, uint128 amount0Requested, uint128 amount1Requested) returns(uint128 amount0, uint128 amount1) +func (_Pancake *PancakeTransactorSession) CollectProtocol(recipient common.Address, amount0Requested *big.Int, amount1Requested *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.CollectProtocol(&_Pancake.TransactOpts, recipient, amount0Requested, amount1Requested) +} + +// Flash is a paid mutator transaction binding the contract method 0x490e6cbc. +// +// Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() +func (_Pancake *PancakeTransactor) Flash(opts *bind.TransactOpts, recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "flash", recipient, amount0, amount1, data) +} + +// Flash is a paid mutator transaction binding the contract method 0x490e6cbc. +// +// Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() +func (_Pancake *PancakeSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Flash(&_Pancake.TransactOpts, recipient, amount0, amount1, data) +} + +// Flash is a paid mutator transaction binding the contract method 0x490e6cbc. +// +// Solidity: function flash(address recipient, uint256 amount0, uint256 amount1, bytes data) returns() +func (_Pancake *PancakeTransactorSession) Flash(recipient common.Address, amount0 *big.Int, amount1 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Flash(&_Pancake.TransactOpts, recipient, amount0, amount1, data) +} + +// IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. +// +// Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() +func (_Pancake *PancakeTransactor) IncreaseObservationCardinalityNext(opts *bind.TransactOpts, observationCardinalityNext uint16) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "increaseObservationCardinalityNext", observationCardinalityNext) +} + +// IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. +// +// Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() +func (_Pancake *PancakeSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { + return _Pancake.Contract.IncreaseObservationCardinalityNext(&_Pancake.TransactOpts, observationCardinalityNext) +} + +// IncreaseObservationCardinalityNext is a paid mutator transaction binding the contract method 0x32148f67. +// +// Solidity: function increaseObservationCardinalityNext(uint16 observationCardinalityNext) returns() +func (_Pancake *PancakeTransactorSession) IncreaseObservationCardinalityNext(observationCardinalityNext uint16) (*types.Transaction, error) { + return _Pancake.Contract.IncreaseObservationCardinalityNext(&_Pancake.TransactOpts, observationCardinalityNext) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf637731d. +// +// Solidity: function initialize(uint160 sqrtPriceX96) returns() +func (_Pancake *PancakeTransactor) Initialize(opts *bind.TransactOpts, sqrtPriceX96 *big.Int) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "initialize", sqrtPriceX96) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf637731d. +// +// Solidity: function initialize(uint160 sqrtPriceX96) returns() +func (_Pancake *PancakeSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Initialize(&_Pancake.TransactOpts, sqrtPriceX96) +} + +// Initialize is a paid mutator transaction binding the contract method 0xf637731d. +// +// Solidity: function initialize(uint160 sqrtPriceX96) returns() +func (_Pancake *PancakeTransactorSession) Initialize(sqrtPriceX96 *big.Int) (*types.Transaction, error) { + return _Pancake.Contract.Initialize(&_Pancake.TransactOpts, sqrtPriceX96) +} + +// Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. +// +// Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeTransactor) Mint(opts *bind.TransactOpts, recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "mint", recipient, tickLower, tickUpper, amount, data) +} + +// Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. +// +// Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Mint(&_Pancake.TransactOpts, recipient, tickLower, tickUpper, amount, data) +} + +// Mint is a paid mutator transaction binding the contract method 0x3c8a7d8d. +// +// Solidity: function mint(address recipient, int24 tickLower, int24 tickUpper, uint128 amount, bytes data) returns(uint256 amount0, uint256 amount1) +func (_Pancake *PancakeTransactorSession) Mint(recipient common.Address, tickLower *big.Int, tickUpper *big.Int, amount *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Mint(&_Pancake.TransactOpts, recipient, tickLower, tickUpper, amount, data) +} + +// SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. +// +// Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() +func (_Pancake *PancakeTransactor) SetFeeProtocol(opts *bind.TransactOpts, feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "setFeeProtocol", feeProtocol0, feeProtocol1) +} + +// SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. +// +// Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() +func (_Pancake *PancakeSession) SetFeeProtocol(feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { + return _Pancake.Contract.SetFeeProtocol(&_Pancake.TransactOpts, feeProtocol0, feeProtocol1) +} + +// SetFeeProtocol is a paid mutator transaction binding the contract method 0xb0d0d211. +// +// Solidity: function setFeeProtocol(uint32 feeProtocol0, uint32 feeProtocol1) returns() +func (_Pancake *PancakeTransactorSession) SetFeeProtocol(feeProtocol0 uint32, feeProtocol1 uint32) (*types.Transaction, error) { + return _Pancake.Contract.SetFeeProtocol(&_Pancake.TransactOpts, feeProtocol0, feeProtocol1) +} + +// SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. +// +// Solidity: function setLmPool(address _lmPool) returns() +func (_Pancake *PancakeTransactor) SetLmPool(opts *bind.TransactOpts, _lmPool common.Address) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "setLmPool", _lmPool) +} + +// SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. +// +// Solidity: function setLmPool(address _lmPool) returns() +func (_Pancake *PancakeSession) SetLmPool(_lmPool common.Address) (*types.Transaction, error) { + return _Pancake.Contract.SetLmPool(&_Pancake.TransactOpts, _lmPool) +} + +// SetLmPool is a paid mutator transaction binding the contract method 0xcc7e7fa2. +// +// Solidity: function setLmPool(address _lmPool) returns() +func (_Pancake *PancakeTransactorSession) SetLmPool(_lmPool common.Address) (*types.Transaction, error) { + return _Pancake.Contract.SetLmPool(&_Pancake.TransactOpts, _lmPool) +} + +// Swap is a paid mutator transaction binding the contract method 0x128acb08. +// +// Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) +func (_Pancake *PancakeTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.contract.Transact(opts, "swap", recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) +} + +// Swap is a paid mutator transaction binding the contract method 0x128acb08. +// +// Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) +func (_Pancake *PancakeSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Swap(&_Pancake.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) +} + +// Swap is a paid mutator transaction binding the contract method 0x128acb08. +// +// Solidity: function swap(address recipient, bool zeroForOne, int256 amountSpecified, uint160 sqrtPriceLimitX96, bytes data) returns(int256 amount0, int256 amount1) +func (_Pancake *PancakeTransactorSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) { + return _Pancake.Contract.Swap(&_Pancake.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data) +} + +// PancakeBurnIterator is returned from FilterBurn and is used to iterate over the raw logs and unpacked data for Burn events raised by the Pancake contract. +type PancakeBurnIterator struct { + Event *PancakeBurn // 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 *PancakeBurnIterator) 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(PancakeBurn) + 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(PancakeBurn) + 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 *PancakeBurnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeBurnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeBurn represents a Burn event raised by the Pancake contract. +type PancakeBurn struct { + Owner common.Address + TickLower *big.Int + TickUpper *big.Int + Amount *big.Int + Amount0 *big.Int + Amount1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBurn is a free log retrieval operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. +// +// Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) FilterBurn(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PancakeBurnIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) + if err != nil { + return nil, err + } + return &PancakeBurnIterator{contract: _Pancake.contract, event: "Burn", logs: logs, sub: sub}, nil +} + +// WatchBurn is a free log subscription operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. +// +// Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) WatchBurn(opts *bind.WatchOpts, sink chan<- *PancakeBurn, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Burn", ownerRule, tickLowerRule, tickUpperRule) + 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(PancakeBurn) + if err := _Pancake.contract.UnpackLog(event, "Burn", 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 +} + +// ParseBurn is a log parse operation binding the contract event 0x0c396cd989a39f4459b5fa1aed6a9a8dcdbc45908acfd67e028cd568da98982c. +// +// Solidity: event Burn(address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) ParseBurn(log types.Log) (*PancakeBurn, error) { + event := new(PancakeBurn) + if err := _Pancake.contract.UnpackLog(event, "Burn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeCollectIterator is returned from FilterCollect and is used to iterate over the raw logs and unpacked data for Collect events raised by the Pancake contract. +type PancakeCollectIterator struct { + Event *PancakeCollect // 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 *PancakeCollectIterator) 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(PancakeCollect) + 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(PancakeCollect) + 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 *PancakeCollectIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeCollectIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeCollect represents a Collect event raised by the Pancake contract. +type PancakeCollect struct { + Owner common.Address + Recipient common.Address + TickLower *big.Int + TickUpper *big.Int + Amount0 *big.Int + Amount1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollect is a free log retrieval operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. +// +// Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) FilterCollect(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PancakeCollectIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) + if err != nil { + return nil, err + } + return &PancakeCollectIterator{contract: _Pancake.contract, event: "Collect", logs: logs, sub: sub}, nil +} + +// WatchCollect is a free log subscription operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. +// +// Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) WatchCollect(opts *bind.WatchOpts, sink chan<- *PancakeCollect, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Collect", ownerRule, tickLowerRule, tickUpperRule) + 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(PancakeCollect) + if err := _Pancake.contract.UnpackLog(event, "Collect", 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 +} + +// ParseCollect is a log parse operation binding the contract event 0x70935338e69775456a85ddef226c395fb668b63fa0115f5f20610b388e6ca9c0. +// +// Solidity: event Collect(address indexed owner, address recipient, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) ParseCollect(log types.Log) (*PancakeCollect, error) { + event := new(PancakeCollect) + if err := _Pancake.contract.UnpackLog(event, "Collect", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeCollectProtocolIterator is returned from FilterCollectProtocol and is used to iterate over the raw logs and unpacked data for CollectProtocol events raised by the Pancake contract. +type PancakeCollectProtocolIterator struct { + Event *PancakeCollectProtocol // 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 *PancakeCollectProtocolIterator) 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(PancakeCollectProtocol) + 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(PancakeCollectProtocol) + 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 *PancakeCollectProtocolIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeCollectProtocolIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeCollectProtocol represents a CollectProtocol event raised by the Pancake contract. +type PancakeCollectProtocol struct { + Sender common.Address + Recipient common.Address + Amount0 *big.Int + Amount1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterCollectProtocol is a free log retrieval operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. +// +// Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) FilterCollectProtocol(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PancakeCollectProtocolIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "CollectProtocol", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &PancakeCollectProtocolIterator{contract: _Pancake.contract, event: "CollectProtocol", logs: logs, sub: sub}, nil +} + +// WatchCollectProtocol is a free log subscription operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. +// +// Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) WatchCollectProtocol(opts *bind.WatchOpts, sink chan<- *PancakeCollectProtocol, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "CollectProtocol", senderRule, recipientRule) + 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(PancakeCollectProtocol) + if err := _Pancake.contract.UnpackLog(event, "CollectProtocol", 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 +} + +// ParseCollectProtocol is a log parse operation binding the contract event 0x596b573906218d3411850b26a6b437d6c4522fdb43d2d2386263f86d50b8b151. +// +// Solidity: event CollectProtocol(address indexed sender, address indexed recipient, uint128 amount0, uint128 amount1) +func (_Pancake *PancakeFilterer) ParseCollectProtocol(log types.Log) (*PancakeCollectProtocol, error) { + event := new(PancakeCollectProtocol) + if err := _Pancake.contract.UnpackLog(event, "CollectProtocol", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeFlashIterator is returned from FilterFlash and is used to iterate over the raw logs and unpacked data for Flash events raised by the Pancake contract. +type PancakeFlashIterator struct { + Event *PancakeFlash // 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 *PancakeFlashIterator) 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(PancakeFlash) + 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(PancakeFlash) + 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 *PancakeFlashIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeFlashIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeFlash represents a Flash event raised by the Pancake contract. +type PancakeFlash struct { + Sender common.Address + Recipient common.Address + Amount0 *big.Int + Amount1 *big.Int + Paid0 *big.Int + Paid1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterFlash is a free log retrieval operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. +// +// Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) +func (_Pancake *PancakeFilterer) FilterFlash(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PancakeFlashIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Flash", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &PancakeFlashIterator{contract: _Pancake.contract, event: "Flash", logs: logs, sub: sub}, nil +} + +// WatchFlash is a free log subscription operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. +// +// Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) +func (_Pancake *PancakeFilterer) WatchFlash(opts *bind.WatchOpts, sink chan<- *PancakeFlash, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Flash", senderRule, recipientRule) + 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(PancakeFlash) + if err := _Pancake.contract.UnpackLog(event, "Flash", 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 +} + +// ParseFlash is a log parse operation binding the contract event 0xbdbdb71d7860376ba52b25a5028beea23581364a40522f6bcfb86bb1f2dca633. +// +// Solidity: event Flash(address indexed sender, address indexed recipient, uint256 amount0, uint256 amount1, uint256 paid0, uint256 paid1) +func (_Pancake *PancakeFilterer) ParseFlash(log types.Log) (*PancakeFlash, error) { + event := new(PancakeFlash) + if err := _Pancake.contract.UnpackLog(event, "Flash", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeIncreaseObservationCardinalityNextIterator is returned from FilterIncreaseObservationCardinalityNext and is used to iterate over the raw logs and unpacked data for IncreaseObservationCardinalityNext events raised by the Pancake contract. +type PancakeIncreaseObservationCardinalityNextIterator struct { + Event *PancakeIncreaseObservationCardinalityNext // 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 *PancakeIncreaseObservationCardinalityNextIterator) 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(PancakeIncreaseObservationCardinalityNext) + 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(PancakeIncreaseObservationCardinalityNext) + 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 *PancakeIncreaseObservationCardinalityNextIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeIncreaseObservationCardinalityNextIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeIncreaseObservationCardinalityNext represents a IncreaseObservationCardinalityNext event raised by the Pancake contract. +type PancakeIncreaseObservationCardinalityNext struct { + ObservationCardinalityNextOld uint16 + ObservationCardinalityNextNew uint16 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterIncreaseObservationCardinalityNext is a free log retrieval operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. +// +// Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) +func (_Pancake *PancakeFilterer) FilterIncreaseObservationCardinalityNext(opts *bind.FilterOpts) (*PancakeIncreaseObservationCardinalityNextIterator, error) { + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "IncreaseObservationCardinalityNext") + if err != nil { + return nil, err + } + return &PancakeIncreaseObservationCardinalityNextIterator{contract: _Pancake.contract, event: "IncreaseObservationCardinalityNext", logs: logs, sub: sub}, nil +} + +// WatchIncreaseObservationCardinalityNext is a free log subscription operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. +// +// Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) +func (_Pancake *PancakeFilterer) WatchIncreaseObservationCardinalityNext(opts *bind.WatchOpts, sink chan<- *PancakeIncreaseObservationCardinalityNext) (event.Subscription, error) { + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "IncreaseObservationCardinalityNext") + 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(PancakeIncreaseObservationCardinalityNext) + if err := _Pancake.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", 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 +} + +// ParseIncreaseObservationCardinalityNext is a log parse operation binding the contract event 0xac49e518f90a358f652e4400164f05a5d8f7e35e7747279bc3a93dbf584e125a. +// +// Solidity: event IncreaseObservationCardinalityNext(uint16 observationCardinalityNextOld, uint16 observationCardinalityNextNew) +func (_Pancake *PancakeFilterer) ParseIncreaseObservationCardinalityNext(log types.Log) (*PancakeIncreaseObservationCardinalityNext, error) { + event := new(PancakeIncreaseObservationCardinalityNext) + if err := _Pancake.contract.UnpackLog(event, "IncreaseObservationCardinalityNext", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeInitializeIterator is returned from FilterInitialize and is used to iterate over the raw logs and unpacked data for Initialize events raised by the Pancake contract. +type PancakeInitializeIterator struct { + Event *PancakeInitialize // 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 *PancakeInitializeIterator) 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(PancakeInitialize) + 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(PancakeInitialize) + 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 *PancakeInitializeIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeInitializeIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeInitialize represents a Initialize event raised by the Pancake contract. +type PancakeInitialize struct { + SqrtPriceX96 *big.Int + Tick *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialize is a free log retrieval operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. +// +// Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) +func (_Pancake *PancakeFilterer) FilterInitialize(opts *bind.FilterOpts) (*PancakeInitializeIterator, error) { + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Initialize") + if err != nil { + return nil, err + } + return &PancakeInitializeIterator{contract: _Pancake.contract, event: "Initialize", logs: logs, sub: sub}, nil +} + +// WatchInitialize is a free log subscription operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. +// +// Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) +func (_Pancake *PancakeFilterer) WatchInitialize(opts *bind.WatchOpts, sink chan<- *PancakeInitialize) (event.Subscription, error) { + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Initialize") + 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(PancakeInitialize) + if err := _Pancake.contract.UnpackLog(event, "Initialize", 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 +} + +// ParseInitialize is a log parse operation binding the contract event 0x98636036cb66a9c19a37435efc1e90142190214e8abeb821bdba3f2990dd4c95. +// +// Solidity: event Initialize(uint160 sqrtPriceX96, int24 tick) +func (_Pancake *PancakeFilterer) ParseInitialize(log types.Log) (*PancakeInitialize, error) { + event := new(PancakeInitialize) + if err := _Pancake.contract.UnpackLog(event, "Initialize", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeMintIterator is returned from FilterMint and is used to iterate over the raw logs and unpacked data for Mint events raised by the Pancake contract. +type PancakeMintIterator struct { + Event *PancakeMint // 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 *PancakeMintIterator) 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(PancakeMint) + 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(PancakeMint) + 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 *PancakeMintIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeMintIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeMint represents a Mint event raised by the Pancake contract. +type PancakeMint struct { + Sender common.Address + Owner common.Address + TickLower *big.Int + TickUpper *big.Int + Amount *big.Int + Amount0 *big.Int + Amount1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMint is a free log retrieval operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. +// +// Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) FilterMint(opts *bind.FilterOpts, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (*PancakeMintIterator, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) + if err != nil { + return nil, err + } + return &PancakeMintIterator{contract: _Pancake.contract, event: "Mint", logs: logs, sub: sub}, nil +} + +// WatchMint is a free log subscription operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. +// +// Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) WatchMint(opts *bind.WatchOpts, sink chan<- *PancakeMint, owner []common.Address, tickLower []*big.Int, tickUpper []*big.Int) (event.Subscription, error) { + + var ownerRule []interface{} + for _, ownerItem := range owner { + ownerRule = append(ownerRule, ownerItem) + } + var tickLowerRule []interface{} + for _, tickLowerItem := range tickLower { + tickLowerRule = append(tickLowerRule, tickLowerItem) + } + var tickUpperRule []interface{} + for _, tickUpperItem := range tickUpper { + tickUpperRule = append(tickUpperRule, tickUpperItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Mint", ownerRule, tickLowerRule, tickUpperRule) + 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(PancakeMint) + if err := _Pancake.contract.UnpackLog(event, "Mint", 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 +} + +// ParseMint is a log parse operation binding the contract event 0x7a53080ba414158be7ec69b987b5fb7d07dee101fe85488f0853ae16239d0bde. +// +// Solidity: event Mint(address sender, address indexed owner, int24 indexed tickLower, int24 indexed tickUpper, uint128 amount, uint256 amount0, uint256 amount1) +func (_Pancake *PancakeFilterer) ParseMint(log types.Log) (*PancakeMint, error) { + event := new(PancakeMint) + if err := _Pancake.contract.UnpackLog(event, "Mint", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeSetFeeProtocolIterator is returned from FilterSetFeeProtocol and is used to iterate over the raw logs and unpacked data for SetFeeProtocol events raised by the Pancake contract. +type PancakeSetFeeProtocolIterator struct { + Event *PancakeSetFeeProtocol // 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 *PancakeSetFeeProtocolIterator) 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(PancakeSetFeeProtocol) + 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(PancakeSetFeeProtocol) + 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 *PancakeSetFeeProtocolIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeSetFeeProtocolIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeSetFeeProtocol represents a SetFeeProtocol event raised by the Pancake contract. +type PancakeSetFeeProtocol struct { + FeeProtocol0Old uint32 + FeeProtocol1Old uint32 + FeeProtocol0New uint32 + FeeProtocol1New uint32 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetFeeProtocol is a free log retrieval operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. +// +// Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) +func (_Pancake *PancakeFilterer) FilterSetFeeProtocol(opts *bind.FilterOpts) (*PancakeSetFeeProtocolIterator, error) { + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "SetFeeProtocol") + if err != nil { + return nil, err + } + return &PancakeSetFeeProtocolIterator{contract: _Pancake.contract, event: "SetFeeProtocol", logs: logs, sub: sub}, nil +} + +// WatchSetFeeProtocol is a free log subscription operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. +// +// Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) +func (_Pancake *PancakeFilterer) WatchSetFeeProtocol(opts *bind.WatchOpts, sink chan<- *PancakeSetFeeProtocol) (event.Subscription, error) { + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "SetFeeProtocol") + 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(PancakeSetFeeProtocol) + if err := _Pancake.contract.UnpackLog(event, "SetFeeProtocol", 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 +} + +// ParseSetFeeProtocol is a log parse operation binding the contract event 0xb3159fed3ddfba67bae294599eafe2d0ec98c08bb38e0e5fb87d33154b6e05aa. +// +// Solidity: event SetFeeProtocol(uint32 feeProtocol0Old, uint32 feeProtocol1Old, uint32 feeProtocol0New, uint32 feeProtocol1New) +func (_Pancake *PancakeFilterer) ParseSetFeeProtocol(log types.Log) (*PancakeSetFeeProtocol, error) { + event := new(PancakeSetFeeProtocol) + if err := _Pancake.contract.UnpackLog(event, "SetFeeProtocol", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeSetLmPoolEventIterator is returned from FilterSetLmPoolEvent and is used to iterate over the raw logs and unpacked data for SetLmPoolEvent events raised by the Pancake contract. +type PancakeSetLmPoolEventIterator struct { + Event *PancakeSetLmPoolEvent // 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 *PancakeSetLmPoolEventIterator) 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(PancakeSetLmPoolEvent) + 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(PancakeSetLmPoolEvent) + 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 *PancakeSetLmPoolEventIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeSetLmPoolEventIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeSetLmPoolEvent represents a SetLmPoolEvent event raised by the Pancake contract. +type PancakeSetLmPoolEvent struct { + Addr common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSetLmPoolEvent is a free log retrieval operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. +// +// Solidity: event SetLmPoolEvent(address addr) +func (_Pancake *PancakeFilterer) FilterSetLmPoolEvent(opts *bind.FilterOpts) (*PancakeSetLmPoolEventIterator, error) { + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "SetLmPoolEvent") + if err != nil { + return nil, err + } + return &PancakeSetLmPoolEventIterator{contract: _Pancake.contract, event: "SetLmPoolEvent", logs: logs, sub: sub}, nil +} + +// WatchSetLmPoolEvent is a free log subscription operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. +// +// Solidity: event SetLmPoolEvent(address addr) +func (_Pancake *PancakeFilterer) WatchSetLmPoolEvent(opts *bind.WatchOpts, sink chan<- *PancakeSetLmPoolEvent) (event.Subscription, error) { + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "SetLmPoolEvent") + 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(PancakeSetLmPoolEvent) + if err := _Pancake.contract.UnpackLog(event, "SetLmPoolEvent", 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 +} + +// ParseSetLmPoolEvent is a log parse operation binding the contract event 0x29983690a85a11696ce8a357993744f8d5a74fde14653e517cc2f8608a7235e9. +// +// Solidity: event SetLmPoolEvent(address addr) +func (_Pancake *PancakeFilterer) ParseSetLmPoolEvent(log types.Log) (*PancakeSetLmPoolEvent, error) { + event := new(PancakeSetLmPoolEvent) + if err := _Pancake.contract.UnpackLog(event, "SetLmPoolEvent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// PancakeSwapIterator is returned from FilterSwap and is used to iterate over the raw logs and unpacked data for Swap events raised by the Pancake contract. +type PancakeSwapIterator struct { + Event *PancakeSwap // 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 *PancakeSwapIterator) 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(PancakeSwap) + 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(PancakeSwap) + 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 *PancakeSwapIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *PancakeSwapIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// PancakeSwap represents a Swap event raised by the Pancake contract. +type PancakeSwap struct { + Sender common.Address + Recipient common.Address + Amount0 *big.Int + Amount1 *big.Int + SqrtPriceX96 *big.Int + Liquidity *big.Int + Tick *big.Int + ProtocolFeesToken0 *big.Int + ProtocolFeesToken1 *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSwap is a free log retrieval operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. +// +// Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) +func (_Pancake *PancakeFilterer) FilterSwap(opts *bind.FilterOpts, sender []common.Address, recipient []common.Address) (*PancakeSwapIterator, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.FilterLogs(opts, "Swap", senderRule, recipientRule) + if err != nil { + return nil, err + } + return &PancakeSwapIterator{contract: _Pancake.contract, event: "Swap", logs: logs, sub: sub}, nil +} + +// WatchSwap is a free log subscription operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. +// +// Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) +func (_Pancake *PancakeFilterer) WatchSwap(opts *bind.WatchOpts, sink chan<- *PancakeSwap, sender []common.Address, recipient []common.Address) (event.Subscription, error) { + + var senderRule []interface{} + for _, senderItem := range sender { + senderRule = append(senderRule, senderItem) + } + var recipientRule []interface{} + for _, recipientItem := range recipient { + recipientRule = append(recipientRule, recipientItem) + } + + logs, sub, err := _Pancake.contract.WatchLogs(opts, "Swap", senderRule, recipientRule) + 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(PancakeSwap) + if err := _Pancake.contract.UnpackLog(event, "Swap", 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 +} + +// ParseSwap is a log parse operation binding the contract event 0x19b47279256b2a23a1665c810c8d55a1758940ee09377d4f8d26497a3577dc83. +// +// Solidity: event Swap(address indexed sender, address indexed recipient, int256 amount0, int256 amount1, uint160 sqrtPriceX96, uint128 liquidity, int24 tick, uint128 protocolFeesToken0, uint128 protocolFeesToken1) +func (_Pancake *PancakeFilterer) ParseSwap(log types.Log) (*PancakeSwap, error) { + event := new(PancakeSwap) + if err := _Pancake.contract.UnpackLog(event, "Swap", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/client/spot_prices.go b/client/spot_prices.go index 1cdcfa8..7eacdb2 100644 --- a/client/spot_prices.go +++ b/client/spot_prices.go @@ -8,6 +8,7 @@ import ( "github.com/ethereum/go-ethereum/common" balancerpool "github.com/ojo-network/ethereum-api/abi/balancer/pool" "github.com/ojo-network/ethereum-api/abi/camelot" + "github.com/ojo-network/ethereum-api/abi/pancake" "github.com/ojo-network/ethereum-api/abi/uniswap" "github.com/ojo-network/ethereum-api/pool" "github.com/ojo-network/indexer/indexer" @@ -27,15 +28,19 @@ func (c *Client) PollSpotPrices(pools []pool.Pool) { switch c.poolContract { case pool.PoolUniswap: spotPrice = c.QueryUniswapSpotPrice(p, blockNum) - c.logger.Info().Interface("spotPrice", spotPrice).Msg("spot price received") + c.logger.Info().Interface("Uniswap spotPrice", spotPrice).Msg("spot price received") c.indexer.AddPrice(spotPrice) case pool.PoolAlgebra: spotPrice = c.QueryAlgebraSpotPrice(p, blockNum) - c.logger.Info().Interface("spotPrice", spotPrice).Msg("spot price received") + c.logger.Info().Interface("Alegbra spotPrice", spotPrice).Msg("spot price received") c.indexer.AddPrice(spotPrice) case pool.PoolBalancer: spotPrice = c.QueryBalancerSpotPrice(p, blockNum) - c.logger.Info().Interface("spotPrice", spotPrice).Msg("spot price received") + c.logger.Info().Interface("Balancer spotPrice", spotPrice).Msg("spot price received") + c.indexer.AddPrice(spotPrice) + case pool.PoolPancake: + spotPrice = c.QueryPancakeSpotPrice(p, blockNum) + c.logger.Info().Interface("Pancake spotPrice", spotPrice).Msg("spot price received") c.indexer.AddPrice(spotPrice) } } @@ -104,3 +109,23 @@ func (c *Client) QueryBalancerSpotPrice(p pool.Pool, blockNum uint64) indexer.Sp Price: sdkmath.LegacyNewDecFromBigIntWithPrec(poolRate, 18), } } + +// QueryPancakeSpotPrice queries the spot price of a pancake pool +func (c *Client) QueryPancakeSpotPrice(p pool.Pool, blockNum uint64) indexer.SpotPrice { + pancakeCaller, err := pancake.NewPancakeCaller(common.HexToAddress(p.Address), c.ethClient) + if err != nil { + c.reportError(fmt.Errorf("error initializing %s pool caller: %w", p.ExchangePair(), err)) + return indexer.SpotPrice{} + } + slot0, err := pancakeCaller.Slot0(nil) + if err != nil { + c.reportError(fmt.Errorf("error getting %s pool balance: %w", p.ExchangePair(), err)) + return indexer.SpotPrice{} + } + return indexer.SpotPrice{ + BlockNum: indexer.BlockNum(blockNum), + Timestamp: utils.CurrentUnixTime(), + ExchangePair: p.ExchangePair(), + Price: p.SqrtPriceX96ToDec(slot0.SqrtPriceX96), + } +} diff --git a/client/swaps.go b/client/swaps.go index 80e7cc1..2ee5e9e 100644 --- a/client/swaps.go +++ b/client/swaps.go @@ -8,6 +8,7 @@ import ( balancerpool "github.com/ojo-network/ethereum-api/abi/balancer/pool" "github.com/ojo-network/ethereum-api/abi/balancer/vault" "github.com/ojo-network/ethereum-api/abi/camelot" + "github.com/ojo-network/ethereum-api/abi/pancake" "github.com/ojo-network/ethereum-api/abi/uniswap" "github.com/ojo-network/ethereum-api/pool" ) @@ -36,6 +37,11 @@ func (c *Client) WatchSwapsAndRestart(p pool.Pool) { if err != nil { c.reportError(fmt.Errorf("error watching %s swap events", p.ExchangePair())) } + case pool.PoolPancake: + err := c.WatchPancakeSwapEvent(p) + if err != nil { + c.reportError(fmt.Errorf("error watching %s swap events", p.ExchangePair())) + } } } } @@ -131,7 +137,7 @@ func (c *Client) WatchBalancerSwapEvent(p pool.Pool) error { tokenInParam := make([]common.Address, 1) tokenInParam[0] = common.HexToAddress(p.BaseAddress) tokenOutParam := []common.Address{} - for _, tokenAddress := range p.QuoteAddresses{ + for _, tokenAddress := range p.QuoteAddresses { tokenOutParam = append(tokenOutParam, common.HexToAddress(tokenAddress)) } @@ -171,3 +177,36 @@ func (c *Client) WatchBalancerSwapEvent(p pool.Pool) error { } } } + +// WatchPancakeSwapEvent watches for swap events on a pancake pool +func (c *Client) WatchPancakeSwapEvent(p pool.Pool) error { + pancakeFilterer, err := pancake.NewPancakeFilterer(common.HexToAddress(p.Address), c.ethClient) + if err != nil { + return err + } + + eventSink := make(chan *pancake.PancakeSwap) + opts := &bind.WatchOpts{Start: nil, Context: c.ctx} + c.logger.Info().Msgf("subscribing to %s swap events", p.ExchangePair()) + subscription, err := pancakeFilterer.WatchSwap(opts, eventSink, nil, nil) + if err != nil { + return err + } + + for { + select { + case <-c.ctx.Done(): + c.logger.Info().Msgf("unsubscribing from %s swap events", p.ExchangePair()) + subscription.Unsubscribe() + return nil + case err := <-subscription.Err(): + return err + case event := <-eventSink: + swap := p.ConvertPancakeEventToSwap(event) + spotPrice := p.ConvertPancakeEventToSpotPrice(event) + c.logger.Info().Interface("pancake swap", swap).Msg("pancake swap event received") + c.indexer.AddSwap(swap) + c.indexer.AddPrice(spotPrice) + } + } +} diff --git a/pool/pool.go b/pool/pool.go index 837657c..8e6c140 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -7,6 +7,7 @@ import ( "github.com/ojo-network/ethereum-api/abi/balancer/vault" "github.com/ojo-network/ethereum-api/abi/camelot" + "github.com/ojo-network/ethereum-api/abi/pancake" "github.com/ojo-network/ethereum-api/abi/uniswap" "github.com/ojo-network/indexer/indexer" "github.com/ojo-network/indexer/utils" @@ -84,6 +85,25 @@ func (p *Pool) ConvertBalancerEventToSwap(event *vault.PoolSwap, price *big.Int) } } +func (p *Pool) ConvertPancakeEventToSpotPrice(event *pancake.PancakeSwap) indexer.SpotPrice { + return indexer.SpotPrice{ + BlockNum: indexer.BlockNum(event.Raw.BlockNumber), + Timestamp: utils.CurrentUnixTime(), + ExchangePair: p.ExchangePair(), + Price: p.SqrtPriceX96ToDec(event.SqrtPriceX96), + } +} + +func (p *Pool) ConvertPancakeEventToSwap(event *pancake.PancakeSwap) indexer.Swap { + return indexer.Swap{ + BlockNum: indexer.BlockNum(event.Raw.BlockNumber), + Timestamp: utils.CurrentUnixTime(), + ExchangePair: p.ExchangePair(), + Price: p.SqrtPriceX96ToDec(event.SqrtPriceX96), + Volume: p.swapPancakeVolume(event), + } +} + func (p *Pool) SqrtPriceX96ToDec(sqrtPriceX96 *big.Int) sdkmath.LegacyDec { sdkValue := sdkmath.LegacyNewDecFromBigInt(sqrtPriceX96) @@ -138,3 +158,13 @@ func (p *Pool) swapBalancerVolume(event *vault.PoolSwap) sdkmath.LegacyDec { return volume.Quo(sdkmath.LegacyNewDec(10).Power(uint64(p.BaseDecimal))) } } + +func (p *Pool) swapPancakeVolume(event *pancake.PancakeSwap) sdkmath.LegacyDec { + if p.InvertPrice { + volume := sdkmath.LegacyNewDecFromBigInt(event.Amount1).Abs() + return volume.Quo(sdkmath.LegacyNewDec(10).Power(uint64(p.QuoteDecimal))) + } else { + volume := sdkmath.LegacyNewDecFromBigInt(event.Amount0).Abs() + return volume.Quo(sdkmath.LegacyNewDec(10).Power(uint64(p.BaseDecimal))) + } +} diff --git a/pool/supported_exchanges.go b/pool/supported_exchanges.go index f7bd055..344345b 100644 --- a/pool/supported_exchanges.go +++ b/pool/supported_exchanges.go @@ -6,13 +6,16 @@ type PoolContract string const ExchangeUniswap ExchangeName = "uniswap" const ExchangeCamelot ExchangeName = "camelot" const ExchangeBalancer ExchangeName = "balancer" +const ExchangePancake ExchangeName = "pancake" const PoolUniswap PoolContract = "uniswappool" const PoolAlgebra PoolContract = "algebrapool" const PoolBalancer PoolContract = "balancerpool" +const PoolPancake PoolContract = "pancakepool" // maps exchange to pool contract of that exchange var SupportedExchanges = map[ExchangeName]PoolContract{ ExchangeUniswap: PoolUniswap, ExchangeCamelot: PoolAlgebra, ExchangeBalancer: PoolBalancer, + ExchangePancake: PoolPancake, } diff --git a/sample-config.yaml b/sample-config.yaml index 72b28a6..964b0e8 100644 --- a/sample-config.yaml +++ b/sample-config.yaml @@ -115,6 +115,16 @@ exchanges: base_decimal: 18 quote_decimal: 18 invert_price: false + - name: "pancake" + node_urls: + - "wss://mainnet.infura.io/ws/v3/6849a09aeeb044b592d46bcdce07ccef" + pools: + - address: "0x365EA9E5Cec960390f35b6509548e84073168A8B" + base: "SWBTC" + quote: "WBTC" + base_decimal: 18 + quote_decimal: 18 + invert_price: false server: listen_addr: "0.0.0.0:5005"