feat: create v2-prep branch with comprehensive planning

Restructured project for V2 refactor:

**Structure Changes:**
- Moved all V1 code to orig/ folder (preserved with git mv)
- Created docs/planning/ directory
- Added orig/README_V1.md explaining V1 preservation

**Planning Documents:**
- 00_V2_MASTER_PLAN.md: Complete architecture overview
  - Executive summary of critical V1 issues
  - High-level component architecture diagrams
  - 5-phase implementation roadmap
  - Success metrics and risk mitigation

- 07_TASK_BREAKDOWN.md: Atomic task breakdown
  - 99+ hours of detailed tasks
  - Every task < 2 hours (atomic)
  - Clear dependencies and success criteria
  - Organized by implementation phase

**V2 Key Improvements:**
- Per-exchange parsers (factory pattern)
- Multi-layer strict validation
- Multi-index pool cache
- Background validation pipeline
- Comprehensive observability

**Critical Issues Addressed:**
- Zero address tokens (strict validation + cache enrichment)
- Parsing accuracy (protocol-specific parsers)
- No audit trail (background validation channel)
- Inefficient lookups (multi-index cache)
- Stats disconnection (event-driven metrics)

Next Steps:
1. Review planning documents
2. Begin Phase 1: Foundation (P1-001 through P1-010)
3. Implement parsers in Phase 2
4. Build cache system in Phase 3
5. Add validation pipeline in Phase 4
6. Migrate and test in Phase 5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Administrator
2025-11-10 10:14:26 +01:00
parent 1773daffe7
commit 803de231ba
411 changed files with 20390 additions and 8680 deletions

View File

@@ -0,0 +1,551 @@
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package algebra
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
)
// AlgebraPoolMetaData contains all meta data concerning the AlgebraPool contract.
var AlgebraPoolMetaData = &bind.MetaData{
ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"globalState\",\"outputs\":[{\"name\":\"price\",\"type\":\"uint160\"},{\"name\":\"tick\",\"type\":\"int24\"},{\"name\":\"fee\",\"type\":\"uint16\"},{\"name\":\"timepointIndex\",\"type\":\"uint16\"},{\"name\":\"communityFeeToken0\",\"type\":\"uint16\"},{\"name\":\"communityFeeToken1\",\"type\":\"uint16\"},{\"name\":\"unlocked\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"name\":\"\",\"type\":\"int24\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"dataStorageOperator\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalFeeGrowth0Token\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"totalFeeGrowth1Token\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"name\":\"amountSpecified\",\"type\":\"int256\"},{\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"name\":\"amount0\",\"type\":\"int256\"},{\"name\":\"amount1\",\"type\":\"int256\"}],\"type\":\"function\"}]",
}
// AlgebraPoolABI is the input ABI used to generate the binding from.
// Deprecated: Use AlgebraPoolMetaData.ABI instead.
var AlgebraPoolABI = AlgebraPoolMetaData.ABI
// AlgebraPool is an auto generated Go binding around an Ethereum contract.
type AlgebraPool struct {
AlgebraPoolCaller // Read-only binding to the contract
AlgebraPoolTransactor // Write-only binding to the contract
AlgebraPoolFilterer // Log filterer for contract events
}
// AlgebraPoolCaller is an auto generated read-only Go binding around an Ethereum contract.
type AlgebraPoolCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraPoolTransactor is an auto generated write-only Go binding around an Ethereum contract.
type AlgebraPoolTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraPoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type AlgebraPoolFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraPoolSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type AlgebraPoolSession struct {
Contract *AlgebraPool // 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
}
// AlgebraPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type AlgebraPoolCallerSession struct {
Contract *AlgebraPoolCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// AlgebraPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type AlgebraPoolTransactorSession struct {
Contract *AlgebraPoolTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// AlgebraPoolRaw is an auto generated low-level Go binding around an Ethereum contract.
type AlgebraPoolRaw struct {
Contract *AlgebraPool // Generic contract binding to access the raw methods on
}
// AlgebraPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type AlgebraPoolCallerRaw struct {
Contract *AlgebraPoolCaller // Generic read-only contract binding to access the raw methods on
}
// AlgebraPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type AlgebraPoolTransactorRaw struct {
Contract *AlgebraPoolTransactor // Generic write-only contract binding to access the raw methods on
}
// NewAlgebraPool creates a new instance of AlgebraPool, bound to a specific deployed contract.
func NewAlgebraPool(address common.Address, backend bind.ContractBackend) (*AlgebraPool, error) {
contract, err := bindAlgebraPool(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &AlgebraPool{AlgebraPoolCaller: AlgebraPoolCaller{contract: contract}, AlgebraPoolTransactor: AlgebraPoolTransactor{contract: contract}, AlgebraPoolFilterer: AlgebraPoolFilterer{contract: contract}}, nil
}
// NewAlgebraPoolCaller creates a new read-only instance of AlgebraPool, bound to a specific deployed contract.
func NewAlgebraPoolCaller(address common.Address, caller bind.ContractCaller) (*AlgebraPoolCaller, error) {
contract, err := bindAlgebraPool(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &AlgebraPoolCaller{contract: contract}, nil
}
// NewAlgebraPoolTransactor creates a new write-only instance of AlgebraPool, bound to a specific deployed contract.
func NewAlgebraPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*AlgebraPoolTransactor, error) {
contract, err := bindAlgebraPool(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &AlgebraPoolTransactor{contract: contract}, nil
}
// NewAlgebraPoolFilterer creates a new log filterer instance of AlgebraPool, bound to a specific deployed contract.
func NewAlgebraPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*AlgebraPoolFilterer, error) {
contract, err := bindAlgebraPool(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &AlgebraPoolFilterer{contract: contract}, nil
}
// bindAlgebraPool binds a generic wrapper to an already deployed contract.
func bindAlgebraPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := AlgebraPoolMetaData.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 (_AlgebraPool *AlgebraPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AlgebraPool.Contract.AlgebraPoolCaller.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 (_AlgebraPool *AlgebraPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _AlgebraPool.Contract.AlgebraPoolTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_AlgebraPool *AlgebraPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _AlgebraPool.Contract.AlgebraPoolTransactor.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 (_AlgebraPool *AlgebraPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AlgebraPool.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 (_AlgebraPool *AlgebraPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _AlgebraPool.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_AlgebraPool *AlgebraPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _AlgebraPool.Contract.contract.Transact(opts, method, params...)
}
// DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa.
//
// Solidity: function dataStorageOperator() returns(address)
func (_AlgebraPool *AlgebraPoolCaller) DataStorageOperator(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraPool.contract.Call(opts, &out, "dataStorageOperator")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa.
//
// Solidity: function dataStorageOperator() returns(address)
func (_AlgebraPool *AlgebraPoolSession) DataStorageOperator() (common.Address, error) {
return _AlgebraPool.Contract.DataStorageOperator(&_AlgebraPool.CallOpts)
}
// DataStorageOperator is a free data retrieval call binding the contract method 0x29047dfa.
//
// Solidity: function dataStorageOperator() returns(address)
func (_AlgebraPool *AlgebraPoolCallerSession) DataStorageOperator() (common.Address, error) {
return _AlgebraPool.Contract.DataStorageOperator(&_AlgebraPool.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_AlgebraPool *AlgebraPoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraPool.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() returns(address)
func (_AlgebraPool *AlgebraPoolSession) Factory() (common.Address, error) {
return _AlgebraPool.Contract.Factory(&_AlgebraPool.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_AlgebraPool *AlgebraPoolCallerSession) Factory() (common.Address, error) {
return _AlgebraPool.Contract.Factory(&_AlgebraPool.CallOpts)
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 fee, uint16 timepointIndex, uint16 communityFeeToken0, uint16 communityFeeToken1, bool unlocked)
func (_AlgebraPool *AlgebraPoolCaller) GlobalState(opts *bind.CallOpts) (struct {
Price *big.Int
Tick *big.Int
Fee uint16
TimepointIndex uint16
CommunityFeeToken0 uint16
CommunityFeeToken1 uint16
Unlocked bool
}, error) {
var out []interface{}
err := _AlgebraPool.contract.Call(opts, &out, "globalState")
outstruct := new(struct {
Price *big.Int
Tick *big.Int
Fee uint16
TimepointIndex uint16
CommunityFeeToken0 uint16
CommunityFeeToken1 uint16
Unlocked bool
})
if err != nil {
return *outstruct, err
}
outstruct.Price = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
outstruct.Fee = *abi.ConvertType(out[2], new(uint16)).(*uint16)
outstruct.TimepointIndex = *abi.ConvertType(out[3], new(uint16)).(*uint16)
outstruct.CommunityFeeToken0 = *abi.ConvertType(out[4], new(uint16)).(*uint16)
outstruct.CommunityFeeToken1 = *abi.ConvertType(out[5], new(uint16)).(*uint16)
outstruct.Unlocked = *abi.ConvertType(out[6], new(bool)).(*bool)
return *outstruct, err
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 fee, uint16 timepointIndex, uint16 communityFeeToken0, uint16 communityFeeToken1, bool unlocked)
func (_AlgebraPool *AlgebraPoolSession) GlobalState() (struct {
Price *big.Int
Tick *big.Int
Fee uint16
TimepointIndex uint16
CommunityFeeToken0 uint16
CommunityFeeToken1 uint16
Unlocked bool
}, error) {
return _AlgebraPool.Contract.GlobalState(&_AlgebraPool.CallOpts)
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 fee, uint16 timepointIndex, uint16 communityFeeToken0, uint16 communityFeeToken1, bool unlocked)
func (_AlgebraPool *AlgebraPoolCallerSession) GlobalState() (struct {
Price *big.Int
Tick *big.Int
Fee uint16
TimepointIndex uint16
CommunityFeeToken0 uint16
CommunityFeeToken1 uint16
Unlocked bool
}, error) {
return _AlgebraPool.Contract.GlobalState(&_AlgebraPool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_AlgebraPool *AlgebraPoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraPool.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() returns(uint128)
func (_AlgebraPool *AlgebraPoolSession) Liquidity() (*big.Int, error) {
return _AlgebraPool.Contract.Liquidity(&_AlgebraPool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_AlgebraPool *AlgebraPoolCallerSession) Liquidity() (*big.Int, error) {
return _AlgebraPool.Contract.Liquidity(&_AlgebraPool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_AlgebraPool *AlgebraPoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraPool.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() returns(uint128)
func (_AlgebraPool *AlgebraPoolSession) MaxLiquidityPerTick() (*big.Int, error) {
return _AlgebraPool.Contract.MaxLiquidityPerTick(&_AlgebraPool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_AlgebraPool *AlgebraPoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) {
return _AlgebraPool.Contract.MaxLiquidityPerTick(&_AlgebraPool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_AlgebraPool *AlgebraPoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraPool.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() returns(int24)
func (_AlgebraPool *AlgebraPoolSession) TickSpacing() (*big.Int, error) {
return _AlgebraPool.Contract.TickSpacing(&_AlgebraPool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_AlgebraPool *AlgebraPoolCallerSession) TickSpacing() (*big.Int, error) {
return _AlgebraPool.Contract.TickSpacing(&_AlgebraPool.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_AlgebraPool *AlgebraPoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraPool.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() returns(address)
func (_AlgebraPool *AlgebraPoolSession) Token0() (common.Address, error) {
return _AlgebraPool.Contract.Token0(&_AlgebraPool.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_AlgebraPool *AlgebraPoolCallerSession) Token0() (common.Address, error) {
return _AlgebraPool.Contract.Token0(&_AlgebraPool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_AlgebraPool *AlgebraPoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraPool.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() returns(address)
func (_AlgebraPool *AlgebraPoolSession) Token1() (common.Address, error) {
return _AlgebraPool.Contract.Token1(&_AlgebraPool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_AlgebraPool *AlgebraPoolCallerSession) Token1() (common.Address, error) {
return _AlgebraPool.Contract.Token1(&_AlgebraPool.CallOpts)
}
// TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44.
//
// Solidity: function totalFeeGrowth0Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolCaller) TotalFeeGrowth0Token(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraPool.contract.Call(opts, &out, "totalFeeGrowth0Token")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44.
//
// Solidity: function totalFeeGrowth0Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolSession) TotalFeeGrowth0Token() (*big.Int, error) {
return _AlgebraPool.Contract.TotalFeeGrowth0Token(&_AlgebraPool.CallOpts)
}
// TotalFeeGrowth0Token is a free data retrieval call binding the contract method 0x6378ae44.
//
// Solidity: function totalFeeGrowth0Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolCallerSession) TotalFeeGrowth0Token() (*big.Int, error) {
return _AlgebraPool.Contract.TotalFeeGrowth0Token(&_AlgebraPool.CallOpts)
}
// TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42.
//
// Solidity: function totalFeeGrowth1Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolCaller) TotalFeeGrowth1Token(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraPool.contract.Call(opts, &out, "totalFeeGrowth1Token")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42.
//
// Solidity: function totalFeeGrowth1Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolSession) TotalFeeGrowth1Token() (*big.Int, error) {
return _AlgebraPool.Contract.TotalFeeGrowth1Token(&_AlgebraPool.CallOpts)
}
// TotalFeeGrowth1Token is a free data retrieval call binding the contract method 0xecdecf42.
//
// Solidity: function totalFeeGrowth1Token() returns(uint256)
func (_AlgebraPool *AlgebraPoolCallerSession) TotalFeeGrowth1Token() (*big.Int, error) {
return _AlgebraPool.Contract.TotalFeeGrowth1Token(&_AlgebraPool.CallOpts)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountSpecified, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraPool *AlgebraPoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroToOne bool, amountSpecified *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraPool.contract.Transact(opts, "swap", recipient, zeroToOne, amountSpecified, limitSqrtPrice, data)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountSpecified, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraPool *AlgebraPoolSession) Swap(recipient common.Address, zeroToOne bool, amountSpecified *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraPool.Contract.Swap(&_AlgebraPool.TransactOpts, recipient, zeroToOne, amountSpecified, limitSqrtPrice, data)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountSpecified, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraPool *AlgebraPoolTransactorSession) Swap(recipient common.Address, zeroToOne bool, amountSpecified *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraPool.Contract.Swap(&_AlgebraPool.TransactOpts, recipient, zeroToOne, amountSpecified, limitSqrtPrice, data)
}

View File

@@ -0,0 +1,577 @@
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package algebraintegral
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
)
// AlgebraIntegralPoolMetaData contains all meta data concerning the AlgebraIntegralPool contract.
var AlgebraIntegralPoolMetaData = &bind.MetaData{
ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"globalState\",\"outputs\":[{\"name\":\"price\",\"type\":\"uint160\"},{\"name\":\"tick\",\"type\":\"int24\"},{\"name\":\"lastFee\",\"type\":\"uint16\"},{\"name\":\"pluginConfig\",\"type\":\"uint8\"},{\"name\":\"communityFee\",\"type\":\"uint16\"},{\"name\":\"unlocked\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"name\":\"currentFee\",\"type\":\"uint16\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"feeZto0\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fee0to1\",\"outputs\":[{\"name\":\"\",\"type\":\"uint16\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"name\":\"\",\"type\":\"int24\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"plugin\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"zeroToOne\",\"type\":\"bool\"},{\"name\":\"amountRequired\",\"type\":\"int256\"},{\"name\":\"limitSqrtPrice\",\"type\":\"uint160\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"name\":\"amount0\",\"type\":\"int256\"},{\"name\":\"amount1\",\"type\":\"int256\"}],\"type\":\"function\"}]",
}
// AlgebraIntegralPoolABI is the input ABI used to generate the binding from.
// Deprecated: Use AlgebraIntegralPoolMetaData.ABI instead.
var AlgebraIntegralPoolABI = AlgebraIntegralPoolMetaData.ABI
// AlgebraIntegralPool is an auto generated Go binding around an Ethereum contract.
type AlgebraIntegralPool struct {
AlgebraIntegralPoolCaller // Read-only binding to the contract
AlgebraIntegralPoolTransactor // Write-only binding to the contract
AlgebraIntegralPoolFilterer // Log filterer for contract events
}
// AlgebraIntegralPoolCaller is an auto generated read-only Go binding around an Ethereum contract.
type AlgebraIntegralPoolCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraIntegralPoolTransactor is an auto generated write-only Go binding around an Ethereum contract.
type AlgebraIntegralPoolTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraIntegralPoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type AlgebraIntegralPoolFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// AlgebraIntegralPoolSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type AlgebraIntegralPoolSession struct {
Contract *AlgebraIntegralPool // 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
}
// AlgebraIntegralPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type AlgebraIntegralPoolCallerSession struct {
Contract *AlgebraIntegralPoolCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// AlgebraIntegralPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type AlgebraIntegralPoolTransactorSession struct {
Contract *AlgebraIntegralPoolTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// AlgebraIntegralPoolRaw is an auto generated low-level Go binding around an Ethereum contract.
type AlgebraIntegralPoolRaw struct {
Contract *AlgebraIntegralPool // Generic contract binding to access the raw methods on
}
// AlgebraIntegralPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type AlgebraIntegralPoolCallerRaw struct {
Contract *AlgebraIntegralPoolCaller // Generic read-only contract binding to access the raw methods on
}
// AlgebraIntegralPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type AlgebraIntegralPoolTransactorRaw struct {
Contract *AlgebraIntegralPoolTransactor // Generic write-only contract binding to access the raw methods on
}
// NewAlgebraIntegralPool creates a new instance of AlgebraIntegralPool, bound to a specific deployed contract.
func NewAlgebraIntegralPool(address common.Address, backend bind.ContractBackend) (*AlgebraIntegralPool, error) {
contract, err := bindAlgebraIntegralPool(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &AlgebraIntegralPool{AlgebraIntegralPoolCaller: AlgebraIntegralPoolCaller{contract: contract}, AlgebraIntegralPoolTransactor: AlgebraIntegralPoolTransactor{contract: contract}, AlgebraIntegralPoolFilterer: AlgebraIntegralPoolFilterer{contract: contract}}, nil
}
// NewAlgebraIntegralPoolCaller creates a new read-only instance of AlgebraIntegralPool, bound to a specific deployed contract.
func NewAlgebraIntegralPoolCaller(address common.Address, caller bind.ContractCaller) (*AlgebraIntegralPoolCaller, error) {
contract, err := bindAlgebraIntegralPool(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &AlgebraIntegralPoolCaller{contract: contract}, nil
}
// NewAlgebraIntegralPoolTransactor creates a new write-only instance of AlgebraIntegralPool, bound to a specific deployed contract.
func NewAlgebraIntegralPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*AlgebraIntegralPoolTransactor, error) {
contract, err := bindAlgebraIntegralPool(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &AlgebraIntegralPoolTransactor{contract: contract}, nil
}
// NewAlgebraIntegralPoolFilterer creates a new log filterer instance of AlgebraIntegralPool, bound to a specific deployed contract.
func NewAlgebraIntegralPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*AlgebraIntegralPoolFilterer, error) {
contract, err := bindAlgebraIntegralPool(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &AlgebraIntegralPoolFilterer{contract: contract}, nil
}
// bindAlgebraIntegralPool binds a generic wrapper to an already deployed contract.
func bindAlgebraIntegralPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := AlgebraIntegralPoolMetaData.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 (_AlgebraIntegralPool *AlgebraIntegralPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AlgebraIntegralPool.Contract.AlgebraIntegralPoolCaller.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 (_AlgebraIntegralPool *AlgebraIntegralPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.AlgebraIntegralPoolTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_AlgebraIntegralPool *AlgebraIntegralPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.AlgebraIntegralPoolTransactor.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 (_AlgebraIntegralPool *AlgebraIntegralPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _AlgebraIntegralPool.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 (_AlgebraIntegralPool *AlgebraIntegralPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_AlgebraIntegralPool *AlgebraIntegralPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.contract.Transact(opts, method, params...)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Factory() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Factory(&_AlgebraIntegralPool.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Factory() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Factory(&_AlgebraIntegralPool.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() returns(uint16 currentFee)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Fee(opts *bind.CallOpts) (uint16, error) {
var out []interface{}
err := _AlgebraIntegralPool.contract.Call(opts, &out, "fee")
if err != nil {
return *new(uint16), err
}
out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16)
return out0, err
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() returns(uint16 currentFee)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Fee() (uint16, error) {
return _AlgebraIntegralPool.Contract.Fee(&_AlgebraIntegralPool.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() returns(uint16 currentFee)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Fee() (uint16, error) {
return _AlgebraIntegralPool.Contract.Fee(&_AlgebraIntegralPool.CallOpts)
}
// Fee0to1 is a free data retrieval call binding the contract method 0x3cc2817a.
//
// Solidity: function fee0to1() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Fee0to1(opts *bind.CallOpts) (uint16, error) {
var out []interface{}
err := _AlgebraIntegralPool.contract.Call(opts, &out, "fee0to1")
if err != nil {
return *new(uint16), err
}
out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16)
return out0, err
}
// Fee0to1 is a free data retrieval call binding the contract method 0x3cc2817a.
//
// Solidity: function fee0to1() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Fee0to1() (uint16, error) {
return _AlgebraIntegralPool.Contract.Fee0to1(&_AlgebraIntegralPool.CallOpts)
}
// Fee0to1 is a free data retrieval call binding the contract method 0x3cc2817a.
//
// Solidity: function fee0to1() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Fee0to1() (uint16, error) {
return _AlgebraIntegralPool.Contract.Fee0to1(&_AlgebraIntegralPool.CallOpts)
}
// FeeZto0 is a free data retrieval call binding the contract method 0xd893f475.
//
// Solidity: function feeZto0() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) FeeZto0(opts *bind.CallOpts) (uint16, error) {
var out []interface{}
err := _AlgebraIntegralPool.contract.Call(opts, &out, "feeZto0")
if err != nil {
return *new(uint16), err
}
out0 := *abi.ConvertType(out[0], new(uint16)).(*uint16)
return out0, err
}
// FeeZto0 is a free data retrieval call binding the contract method 0xd893f475.
//
// Solidity: function feeZto0() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) FeeZto0() (uint16, error) {
return _AlgebraIntegralPool.Contract.FeeZto0(&_AlgebraIntegralPool.CallOpts)
}
// FeeZto0 is a free data retrieval call binding the contract method 0xd893f475.
//
// Solidity: function feeZto0() returns(uint16)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) FeeZto0() (uint16, error) {
return _AlgebraIntegralPool.Contract.FeeZto0(&_AlgebraIntegralPool.CallOpts)
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 lastFee, uint8 pluginConfig, uint16 communityFee, bool unlocked)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) GlobalState(opts *bind.CallOpts) (struct {
Price *big.Int
Tick *big.Int
LastFee uint16
PluginConfig uint8
CommunityFee uint16
Unlocked bool
}, error) {
var out []interface{}
err := _AlgebraIntegralPool.contract.Call(opts, &out, "globalState")
outstruct := new(struct {
Price *big.Int
Tick *big.Int
LastFee uint16
PluginConfig uint8
CommunityFee uint16
Unlocked bool
})
if err != nil {
return *outstruct, err
}
outstruct.Price = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
outstruct.Tick = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
outstruct.LastFee = *abi.ConvertType(out[2], new(uint16)).(*uint16)
outstruct.PluginConfig = *abi.ConvertType(out[3], new(uint8)).(*uint8)
outstruct.CommunityFee = *abi.ConvertType(out[4], new(uint16)).(*uint16)
outstruct.Unlocked = *abi.ConvertType(out[5], new(bool)).(*bool)
return *outstruct, err
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 lastFee, uint8 pluginConfig, uint16 communityFee, bool unlocked)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) GlobalState() (struct {
Price *big.Int
Tick *big.Int
LastFee uint16
PluginConfig uint8
CommunityFee uint16
Unlocked bool
}, error) {
return _AlgebraIntegralPool.Contract.GlobalState(&_AlgebraIntegralPool.CallOpts)
}
// GlobalState is a free data retrieval call binding the contract method 0xe76c01e4.
//
// Solidity: function globalState() returns(uint160 price, int24 tick, uint16 lastFee, uint8 pluginConfig, uint16 communityFee, bool unlocked)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) GlobalState() (struct {
Price *big.Int
Tick *big.Int
LastFee uint16
PluginConfig uint8
CommunityFee uint16
Unlocked bool
}, error) {
return _AlgebraIntegralPool.Contract.GlobalState(&_AlgebraIntegralPool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Liquidity() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.Liquidity(&_AlgebraIntegralPool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Liquidity() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.Liquidity(&_AlgebraIntegralPool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) MaxLiquidityPerTick() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.MaxLiquidityPerTick(&_AlgebraIntegralPool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.MaxLiquidityPerTick(&_AlgebraIntegralPool.CallOpts)
}
// Plugin is a free data retrieval call binding the contract method 0xef01df4f.
//
// Solidity: function plugin() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Plugin(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraIntegralPool.contract.Call(opts, &out, "plugin")
if err != nil {
return *new(common.Address), err
}
out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
return out0, err
}
// Plugin is a free data retrieval call binding the contract method 0xef01df4f.
//
// Solidity: function plugin() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Plugin() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Plugin(&_AlgebraIntegralPool.CallOpts)
}
// Plugin is a free data retrieval call binding the contract method 0xef01df4f.
//
// Solidity: function plugin() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Plugin() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Plugin(&_AlgebraIntegralPool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(int24)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) TickSpacing() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.TickSpacing(&_AlgebraIntegralPool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) TickSpacing() (*big.Int, error) {
return _AlgebraIntegralPool.Contract.TickSpacing(&_AlgebraIntegralPool.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Token0() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Token0(&_AlgebraIntegralPool.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Token0() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Token0(&_AlgebraIntegralPool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _AlgebraIntegralPool.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() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Token1() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Token1(&_AlgebraIntegralPool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_AlgebraIntegralPool *AlgebraIntegralPoolCallerSession) Token1() (common.Address, error) {
return _AlgebraIntegralPool.Contract.Token1(&_AlgebraIntegralPool.CallOpts)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraIntegralPool *AlgebraIntegralPoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraIntegralPool.contract.Transact(opts, "swap", recipient, zeroToOne, amountRequired, limitSqrtPrice, data)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraIntegralPool *AlgebraIntegralPoolSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.Swap(&_AlgebraIntegralPool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data)
}
// Swap is a paid mutator transaction binding the contract method 0x128acb08.
//
// Solidity: function swap(address recipient, bool zeroToOne, int256 amountRequired, uint160 limitSqrtPrice, bytes data) returns(int256 amount0, int256 amount1)
func (_AlgebraIntegralPool *AlgebraIntegralPoolTransactorSession) Swap(recipient common.Address, zeroToOne bool, amountRequired *big.Int, limitSqrtPrice *big.Int, data []byte) (*types.Transaction, error) {
return _AlgebraIntegralPool.Contract.Swap(&_AlgebraIntegralPool.TransactOpts, recipient, zeroToOne, amountRequired, limitSqrtPrice, data)
}

View File

@@ -0,0 +1,25 @@
// Package bindings provides utilities for working with Ethereum contract bindings
package bindings
import (
"errors"
"github.com/ethereum/go-ethereum/accounts/abi"
)
// Fixed type mismatch in bindings.go
type Method struct {
abi.Method
ID []byte
}
func NewMethod(method abi.Method) (Method, error) {
if len(method.ID) != 4 {
return Method{}, errors.New("method ID must be 4 bytes")
}
return Method{
Method: method,
ID: method.ID,
}, nil
}

View File

@@ -0,0 +1,438 @@
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package uniswapv2
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
)
// UniswapV2PairMetaData contains all meta data concerning the UniswapV2Pair contract.
var UniswapV2PairMetaData = &bind.MetaData{
ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"getReserves\",\"outputs\":[{\"name\":\"reserve0\",\"type\":\"uint112\"},{\"name\":\"reserve1\",\"type\":\"uint112\"},{\"name\":\"blockTimestampLast\",\"type\":\"uint32\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"kLast\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"price0CumulativeLast\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"price1CumulativeLast\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"inputs\":[{\"name\":\"amount0Out\",\"type\":\"uint256\"},{\"name\":\"amount1Out\",\"type\":\"uint256\"},{\"name\":\"to\",\"type\":\"address\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[],\"type\":\"function\"}]",
}
// UniswapV2PairABI is the input ABI used to generate the binding from.
// Deprecated: Use UniswapV2PairMetaData.ABI instead.
var UniswapV2PairABI = UniswapV2PairMetaData.ABI
// UniswapV2Pair is an auto generated Go binding around an Ethereum contract.
type UniswapV2Pair struct {
UniswapV2PairCaller // Read-only binding to the contract
UniswapV2PairTransactor // Write-only binding to the contract
UniswapV2PairFilterer // Log filterer for contract events
}
// UniswapV2PairCaller is an auto generated read-only Go binding around an Ethereum contract.
type UniswapV2PairCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV2PairTransactor is an auto generated write-only Go binding around an Ethereum contract.
type UniswapV2PairTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV2PairFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type UniswapV2PairFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV2PairSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type UniswapV2PairSession struct {
Contract *UniswapV2Pair // 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
}
// UniswapV2PairCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type UniswapV2PairCallerSession struct {
Contract *UniswapV2PairCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// UniswapV2PairTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type UniswapV2PairTransactorSession struct {
Contract *UniswapV2PairTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// UniswapV2PairRaw is an auto generated low-level Go binding around an Ethereum contract.
type UniswapV2PairRaw struct {
Contract *UniswapV2Pair // Generic contract binding to access the raw methods on
}
// UniswapV2PairCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type UniswapV2PairCallerRaw struct {
Contract *UniswapV2PairCaller // Generic read-only contract binding to access the raw methods on
}
// UniswapV2PairTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type UniswapV2PairTransactorRaw struct {
Contract *UniswapV2PairTransactor // Generic write-only contract binding to access the raw methods on
}
// NewUniswapV2Pair creates a new instance of UniswapV2Pair, bound to a specific deployed contract.
func NewUniswapV2Pair(address common.Address, backend bind.ContractBackend) (*UniswapV2Pair, error) {
contract, err := bindUniswapV2Pair(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &UniswapV2Pair{UniswapV2PairCaller: UniswapV2PairCaller{contract: contract}, UniswapV2PairTransactor: UniswapV2PairTransactor{contract: contract}, UniswapV2PairFilterer: UniswapV2PairFilterer{contract: contract}}, nil
}
// NewUniswapV2PairCaller creates a new read-only instance of UniswapV2Pair, bound to a specific deployed contract.
func NewUniswapV2PairCaller(address common.Address, caller bind.ContractCaller) (*UniswapV2PairCaller, error) {
contract, err := bindUniswapV2Pair(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &UniswapV2PairCaller{contract: contract}, nil
}
// NewUniswapV2PairTransactor creates a new write-only instance of UniswapV2Pair, bound to a specific deployed contract.
func NewUniswapV2PairTransactor(address common.Address, transactor bind.ContractTransactor) (*UniswapV2PairTransactor, error) {
contract, err := bindUniswapV2Pair(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &UniswapV2PairTransactor{contract: contract}, nil
}
// NewUniswapV2PairFilterer creates a new log filterer instance of UniswapV2Pair, bound to a specific deployed contract.
func NewUniswapV2PairFilterer(address common.Address, filterer bind.ContractFilterer) (*UniswapV2PairFilterer, error) {
contract, err := bindUniswapV2Pair(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &UniswapV2PairFilterer{contract: contract}, nil
}
// bindUniswapV2Pair binds a generic wrapper to an already deployed contract.
func bindUniswapV2Pair(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := UniswapV2PairMetaData.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 (_UniswapV2Pair *UniswapV2PairRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _UniswapV2Pair.Contract.UniswapV2PairCaller.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 (_UniswapV2Pair *UniswapV2PairRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.UniswapV2PairTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_UniswapV2Pair *UniswapV2PairRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.UniswapV2PairTransactor.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 (_UniswapV2Pair *UniswapV2PairCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _UniswapV2Pair.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 (_UniswapV2Pair *UniswapV2PairTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_UniswapV2Pair *UniswapV2PairTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.contract.Transact(opts, method, params...)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_UniswapV2Pair *UniswapV2PairCaller) Factory(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV2Pair.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() returns(address)
func (_UniswapV2Pair *UniswapV2PairSession) Factory() (common.Address, error) {
return _UniswapV2Pair.Contract.Factory(&_UniswapV2Pair.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_UniswapV2Pair *UniswapV2PairCallerSession) Factory() (common.Address, error) {
return _UniswapV2Pair.Contract.Factory(&_UniswapV2Pair.CallOpts)
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() returns(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)
func (_UniswapV2Pair *UniswapV2PairCaller) GetReserves(opts *bind.CallOpts) (struct {
Reserve0 *big.Int
Reserve1 *big.Int
BlockTimestampLast uint32
}, error) {
var out []interface{}
err := _UniswapV2Pair.contract.Call(opts, &out, "getReserves")
outstruct := new(struct {
Reserve0 *big.Int
Reserve1 *big.Int
BlockTimestampLast uint32
})
if err != nil {
return *outstruct, err
}
outstruct.Reserve0 = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
outstruct.Reserve1 = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
outstruct.BlockTimestampLast = *abi.ConvertType(out[2], new(uint32)).(*uint32)
return *outstruct, err
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() returns(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)
func (_UniswapV2Pair *UniswapV2PairSession) GetReserves() (struct {
Reserve0 *big.Int
Reserve1 *big.Int
BlockTimestampLast uint32
}, error) {
return _UniswapV2Pair.Contract.GetReserves(&_UniswapV2Pair.CallOpts)
}
// GetReserves is a free data retrieval call binding the contract method 0x0902f1ac.
//
// Solidity: function getReserves() returns(uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast)
func (_UniswapV2Pair *UniswapV2PairCallerSession) GetReserves() (struct {
Reserve0 *big.Int
Reserve1 *big.Int
BlockTimestampLast uint32
}, error) {
return _UniswapV2Pair.Contract.GetReserves(&_UniswapV2Pair.CallOpts)
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCaller) KLast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV2Pair.contract.Call(opts, &out, "kLast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairSession) KLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.KLast(&_UniswapV2Pair.CallOpts)
}
// KLast is a free data retrieval call binding the contract method 0x7464fc3d.
//
// Solidity: function kLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCallerSession) KLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.KLast(&_UniswapV2Pair.CallOpts)
}
// Price0CumulativeLast is a free data retrieval call binding the contract method 0x5909c0d5.
//
// Solidity: function price0CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCaller) Price0CumulativeLast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV2Pair.contract.Call(opts, &out, "price0CumulativeLast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Price0CumulativeLast is a free data retrieval call binding the contract method 0x5909c0d5.
//
// Solidity: function price0CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairSession) Price0CumulativeLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.Price0CumulativeLast(&_UniswapV2Pair.CallOpts)
}
// Price0CumulativeLast is a free data retrieval call binding the contract method 0x5909c0d5.
//
// Solidity: function price0CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCallerSession) Price0CumulativeLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.Price0CumulativeLast(&_UniswapV2Pair.CallOpts)
}
// Price1CumulativeLast is a free data retrieval call binding the contract method 0x5a3d5493.
//
// Solidity: function price1CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCaller) Price1CumulativeLast(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV2Pair.contract.Call(opts, &out, "price1CumulativeLast")
if err != nil {
return *new(*big.Int), err
}
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
return out0, err
}
// Price1CumulativeLast is a free data retrieval call binding the contract method 0x5a3d5493.
//
// Solidity: function price1CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairSession) Price1CumulativeLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.Price1CumulativeLast(&_UniswapV2Pair.CallOpts)
}
// Price1CumulativeLast is a free data retrieval call binding the contract method 0x5a3d5493.
//
// Solidity: function price1CumulativeLast() returns(uint256)
func (_UniswapV2Pair *UniswapV2PairCallerSession) Price1CumulativeLast() (*big.Int, error) {
return _UniswapV2Pair.Contract.Price1CumulativeLast(&_UniswapV2Pair.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_UniswapV2Pair *UniswapV2PairCaller) Token0(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV2Pair.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() returns(address)
func (_UniswapV2Pair *UniswapV2PairSession) Token0() (common.Address, error) {
return _UniswapV2Pair.Contract.Token0(&_UniswapV2Pair.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_UniswapV2Pair *UniswapV2PairCallerSession) Token0() (common.Address, error) {
return _UniswapV2Pair.Contract.Token0(&_UniswapV2Pair.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_UniswapV2Pair *UniswapV2PairCaller) Token1(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV2Pair.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() returns(address)
func (_UniswapV2Pair *UniswapV2PairSession) Token1() (common.Address, error) {
return _UniswapV2Pair.Contract.Token1(&_UniswapV2Pair.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_UniswapV2Pair *UniswapV2PairCallerSession) Token1() (common.Address, error) {
return _UniswapV2Pair.Contract.Token1(&_UniswapV2Pair.CallOpts)
}
// Swap is a paid mutator transaction binding the contract method 0x022c0d9f.
//
// Solidity: function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes data) returns()
func (_UniswapV2Pair *UniswapV2PairTransactor) Swap(opts *bind.TransactOpts, amount0Out *big.Int, amount1Out *big.Int, to common.Address, data []byte) (*types.Transaction, error) {
return _UniswapV2Pair.contract.Transact(opts, "swap", amount0Out, amount1Out, to, data)
}
// Swap is a paid mutator transaction binding the contract method 0x022c0d9f.
//
// Solidity: function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes data) returns()
func (_UniswapV2Pair *UniswapV2PairSession) Swap(amount0Out *big.Int, amount1Out *big.Int, to common.Address, data []byte) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.Swap(&_UniswapV2Pair.TransactOpts, amount0Out, amount1Out, to, data)
}
// Swap is a paid mutator transaction binding the contract method 0x022c0d9f.
//
// Solidity: function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes data) returns()
func (_UniswapV2Pair *UniswapV2PairTransactorSession) Swap(amount0Out *big.Int, amount1Out *big.Int, to common.Address, data []byte) (*types.Transaction, error) {
return _UniswapV2Pair.Contract.Swap(&_UniswapV2Pair.TransactOpts, amount0Out, amount1Out, to, data)
}

View File

@@ -0,0 +1,681 @@
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package uniswapv3
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
)
// UniswapV3PoolMetaData contains all meta data concerning the UniswapV3Pool contract.
var UniswapV3PoolMetaData = &bind.MetaData{
ABI: "[{\"constant\":true,\"inputs\":[],\"name\":\"token0\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"token1\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"fee\",\"outputs\":[{\"name\":\"\",\"type\":\"uint24\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"tickSpacing\",\"outputs\":[{\"name\":\"\",\"type\":\"int24\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"maxLiquidityPerTick\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"slot0\",\"outputs\":[{\"name\":\"sqrtPriceX96\",\"type\":\"uint160\"},{\"name\":\"tick\",\"type\":\"int24\"},{\"name\":\"observationIndex\",\"type\":\"uint16\"},{\"name\":\"observationCardinality\",\"type\":\"uint16\"},{\"name\":\"observationCardinalityNext\",\"type\":\"uint16\"},{\"name\":\"feeProtocol\",\"type\":\"uint8\"},{\"name\":\"unlocked\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"feeGrowthGlobal0X128\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"feeGrowthGlobal1X128\",\"outputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"liquidity\",\"outputs\":[{\"name\":\"\",\"type\":\"uint128\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"int24\"}],\"name\":\"ticks\",\"outputs\":[{\"name\":\"liquidityGross\",\"type\":\"uint128\"},{\"name\":\"liquidityNet\",\"type\":\"int128\"},{\"name\":\"feeGrowthOutside0X128\",\"type\":\"uint256\"},{\"name\":\"feeGrowthOutside1X128\",\"type\":\"uint256\"},{\"name\":\"tickCumulativeOutside\",\"type\":\"int56\"},{\"name\":\"secondsPerLiquidityOutsideX128\",\"type\":\"uint160\"},{\"name\":\"secondsOutside\",\"type\":\"uint32\"},{\"name\":\"initialized\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"observations\",\"outputs\":[{\"name\":\"blockTimestamp\",\"type\":\"uint32\"},{\"name\":\"tickCumulative\",\"type\":\"int56\"},{\"name\":\"secondsPerLiquidityCumulativeX128\",\"type\":\"uint160\"},{\"name\":\"initialized\",\"type\":\"bool\"}],\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"factory\",\"outputs\":[{\"name\":\"\",\"type\":\"address\"}],\"type\":\"function\"},{\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\"},{\"name\":\"zeroForOne\",\"type\":\"bool\"},{\"name\":\"amountSpecified\",\"type\":\"int256\"},{\"name\":\"sqrtPriceLimitX96\",\"type\":\"uint160\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"swap\",\"outputs\":[{\"name\":\"amount0\",\"type\":\"int256\"},{\"name\":\"amount1\",\"type\":\"int256\"}],\"type\":\"function\"}]",
}
// UniswapV3PoolABI is the input ABI used to generate the binding from.
// Deprecated: Use UniswapV3PoolMetaData.ABI instead.
var UniswapV3PoolABI = UniswapV3PoolMetaData.ABI
// UniswapV3Pool is an auto generated Go binding around an Ethereum contract.
type UniswapV3Pool struct {
UniswapV3PoolCaller // Read-only binding to the contract
UniswapV3PoolTransactor // Write-only binding to the contract
UniswapV3PoolFilterer // Log filterer for contract events
}
// UniswapV3PoolCaller is an auto generated read-only Go binding around an Ethereum contract.
type UniswapV3PoolCaller struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV3PoolTransactor is an auto generated write-only Go binding around an Ethereum contract.
type UniswapV3PoolTransactor struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV3PoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
type UniswapV3PoolFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
// UniswapV3PoolSession is an auto generated Go binding around an Ethereum contract,
// with pre-set call and transact options.
type UniswapV3PoolSession struct {
Contract *UniswapV3Pool // 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
}
// UniswapV3PoolCallerSession is an auto generated read-only Go binding around an Ethereum contract,
// with pre-set call options.
type UniswapV3PoolCallerSession struct {
Contract *UniswapV3PoolCaller // Generic contract caller binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
}
// UniswapV3PoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
// with pre-set transact options.
type UniswapV3PoolTransactorSession struct {
Contract *UniswapV3PoolTransactor // Generic contract transactor binding to set the session for
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
// UniswapV3PoolRaw is an auto generated low-level Go binding around an Ethereum contract.
type UniswapV3PoolRaw struct {
Contract *UniswapV3Pool // Generic contract binding to access the raw methods on
}
// UniswapV3PoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
type UniswapV3PoolCallerRaw struct {
Contract *UniswapV3PoolCaller // Generic read-only contract binding to access the raw methods on
}
// UniswapV3PoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
type UniswapV3PoolTransactorRaw struct {
Contract *UniswapV3PoolTransactor // Generic write-only contract binding to access the raw methods on
}
// NewUniswapV3Pool creates a new instance of UniswapV3Pool, bound to a specific deployed contract.
func NewUniswapV3Pool(address common.Address, backend bind.ContractBackend) (*UniswapV3Pool, error) {
contract, err := bindUniswapV3Pool(address, backend, backend, backend)
if err != nil {
return nil, err
}
return &UniswapV3Pool{UniswapV3PoolCaller: UniswapV3PoolCaller{contract: contract}, UniswapV3PoolTransactor: UniswapV3PoolTransactor{contract: contract}, UniswapV3PoolFilterer: UniswapV3PoolFilterer{contract: contract}}, nil
}
// NewUniswapV3PoolCaller creates a new read-only instance of UniswapV3Pool, bound to a specific deployed contract.
func NewUniswapV3PoolCaller(address common.Address, caller bind.ContractCaller) (*UniswapV3PoolCaller, error) {
contract, err := bindUniswapV3Pool(address, caller, nil, nil)
if err != nil {
return nil, err
}
return &UniswapV3PoolCaller{contract: contract}, nil
}
// NewUniswapV3PoolTransactor creates a new write-only instance of UniswapV3Pool, bound to a specific deployed contract.
func NewUniswapV3PoolTransactor(address common.Address, transactor bind.ContractTransactor) (*UniswapV3PoolTransactor, error) {
contract, err := bindUniswapV3Pool(address, nil, transactor, nil)
if err != nil {
return nil, err
}
return &UniswapV3PoolTransactor{contract: contract}, nil
}
// NewUniswapV3PoolFilterer creates a new log filterer instance of UniswapV3Pool, bound to a specific deployed contract.
func NewUniswapV3PoolFilterer(address common.Address, filterer bind.ContractFilterer) (*UniswapV3PoolFilterer, error) {
contract, err := bindUniswapV3Pool(address, nil, nil, filterer)
if err != nil {
return nil, err
}
return &UniswapV3PoolFilterer{contract: contract}, nil
}
// bindUniswapV3Pool binds a generic wrapper to an already deployed contract.
func bindUniswapV3Pool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
parsed, err := UniswapV3PoolMetaData.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 (_UniswapV3Pool *UniswapV3PoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _UniswapV3Pool.Contract.UniswapV3PoolCaller.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 (_UniswapV3Pool *UniswapV3PoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.UniswapV3PoolTransactor.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_UniswapV3Pool *UniswapV3PoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.UniswapV3PoolTransactor.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 (_UniswapV3Pool *UniswapV3PoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
return _UniswapV3Pool.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 (_UniswapV3Pool *UniswapV3PoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.contract.Transfer(opts)
}
// Transact invokes the (paid) contract method with params as input values.
func (_UniswapV3Pool *UniswapV3PoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.contract.Transact(opts, method, params...)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCaller) Factory(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(address)
func (_UniswapV3Pool *UniswapV3PoolSession) Factory() (common.Address, error) {
return _UniswapV3Pool.Contract.Factory(&_UniswapV3Pool.CallOpts)
}
// Factory is a free data retrieval call binding the contract method 0xc45a0155.
//
// Solidity: function factory() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Factory() (common.Address, error) {
return _UniswapV3Pool.Contract.Factory(&_UniswapV3Pool.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() returns(uint24)
func (_UniswapV3Pool *UniswapV3PoolCaller) Fee(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(uint24)
func (_UniswapV3Pool *UniswapV3PoolSession) Fee() (*big.Int, error) {
return _UniswapV3Pool.Contract.Fee(&_UniswapV3Pool.CallOpts)
}
// Fee is a free data retrieval call binding the contract method 0xddca3f43.
//
// Solidity: function fee() returns(uint24)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Fee() (*big.Int, error) {
return _UniswapV3Pool.Contract.Fee(&_UniswapV3Pool.CallOpts)
}
// FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399.
//
// Solidity: function feeGrowthGlobal0X128() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolCaller) FeeGrowthGlobal0X128(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolSession) FeeGrowthGlobal0X128() (*big.Int, error) {
return _UniswapV3Pool.Contract.FeeGrowthGlobal0X128(&_UniswapV3Pool.CallOpts)
}
// FeeGrowthGlobal0X128 is a free data retrieval call binding the contract method 0xf3058399.
//
// Solidity: function feeGrowthGlobal0X128() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) FeeGrowthGlobal0X128() (*big.Int, error) {
return _UniswapV3Pool.Contract.FeeGrowthGlobal0X128(&_UniswapV3Pool.CallOpts)
}
// FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319.
//
// Solidity: function feeGrowthGlobal1X128() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolCaller) FeeGrowthGlobal1X128(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolSession) FeeGrowthGlobal1X128() (*big.Int, error) {
return _UniswapV3Pool.Contract.FeeGrowthGlobal1X128(&_UniswapV3Pool.CallOpts)
}
// FeeGrowthGlobal1X128 is a free data retrieval call binding the contract method 0x46141319.
//
// Solidity: function feeGrowthGlobal1X128() returns(uint256)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) FeeGrowthGlobal1X128() (*big.Int, error) {
return _UniswapV3Pool.Contract.FeeGrowthGlobal1X128(&_UniswapV3Pool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolCaller) Liquidity(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolSession) Liquidity() (*big.Int, error) {
return _UniswapV3Pool.Contract.Liquidity(&_UniswapV3Pool.CallOpts)
}
// Liquidity is a free data retrieval call binding the contract method 0x1a686502.
//
// Solidity: function liquidity() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Liquidity() (*big.Int, error) {
return _UniswapV3Pool.Contract.Liquidity(&_UniswapV3Pool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolCaller) MaxLiquidityPerTick(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolSession) MaxLiquidityPerTick() (*big.Int, error) {
return _UniswapV3Pool.Contract.MaxLiquidityPerTick(&_UniswapV3Pool.CallOpts)
}
// MaxLiquidityPerTick is a free data retrieval call binding the contract method 0x70cf754a.
//
// Solidity: function maxLiquidityPerTick() returns(uint128)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) MaxLiquidityPerTick() (*big.Int, error) {
return _UniswapV3Pool.Contract.MaxLiquidityPerTick(&_UniswapV3Pool.CallOpts)
}
// Observations is a free data retrieval call binding the contract method 0x252c09d7.
//
// Solidity: function observations(uint256 ) returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolCaller) Observations(opts *bind.CallOpts, arg0 *big.Int) (struct {
BlockTimestamp uint32
TickCumulative *big.Int
SecondsPerLiquidityCumulativeX128 *big.Int
Initialized bool
}, error) {
var out []interface{}
err := _UniswapV3Pool.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 ) returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolSession) Observations(arg0 *big.Int) (struct {
BlockTimestamp uint32
TickCumulative *big.Int
SecondsPerLiquidityCumulativeX128 *big.Int
Initialized bool
}, error) {
return _UniswapV3Pool.Contract.Observations(&_UniswapV3Pool.CallOpts, arg0)
}
// Observations is a free data retrieval call binding the contract method 0x252c09d7.
//
// Solidity: function observations(uint256 ) returns(uint32 blockTimestamp, int56 tickCumulative, uint160 secondsPerLiquidityCumulativeX128, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Observations(arg0 *big.Int) (struct {
BlockTimestamp uint32
TickCumulative *big.Int
SecondsPerLiquidityCumulativeX128 *big.Int
Initialized bool
}, error) {
return _UniswapV3Pool.Contract.Observations(&_UniswapV3Pool.CallOpts, arg0)
}
// Slot0 is a free data retrieval call binding the contract method 0x3850c7bd.
//
// Solidity: function slot0() returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)
func (_UniswapV3Pool *UniswapV3PoolCaller) Slot0(opts *bind.CallOpts) (struct {
SqrtPriceX96 *big.Int
Tick *big.Int
ObservationIndex uint16
ObservationCardinality uint16
ObservationCardinalityNext uint16
FeeProtocol uint8
Unlocked bool
}, error) {
var out []interface{}
err := _UniswapV3Pool.contract.Call(opts, &out, "slot0")
outstruct := new(struct {
SqrtPriceX96 *big.Int
Tick *big.Int
ObservationIndex uint16
ObservationCardinality uint16
ObservationCardinalityNext uint16
FeeProtocol uint8
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(uint8)).(*uint8)
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() returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)
func (_UniswapV3Pool *UniswapV3PoolSession) Slot0() (struct {
SqrtPriceX96 *big.Int
Tick *big.Int
ObservationIndex uint16
ObservationCardinality uint16
ObservationCardinalityNext uint16
FeeProtocol uint8
Unlocked bool
}, error) {
return _UniswapV3Pool.Contract.Slot0(&_UniswapV3Pool.CallOpts)
}
// Slot0 is a free data retrieval call binding the contract method 0x3850c7bd.
//
// Solidity: function slot0() returns(uint160 sqrtPriceX96, int24 tick, uint16 observationIndex, uint16 observationCardinality, uint16 observationCardinalityNext, uint8 feeProtocol, bool unlocked)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Slot0() (struct {
SqrtPriceX96 *big.Int
Tick *big.Int
ObservationIndex uint16
ObservationCardinality uint16
ObservationCardinalityNext uint16
FeeProtocol uint8
Unlocked bool
}, error) {
return _UniswapV3Pool.Contract.Slot0(&_UniswapV3Pool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_UniswapV3Pool *UniswapV3PoolCaller) TickSpacing(opts *bind.CallOpts) (*big.Int, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(int24)
func (_UniswapV3Pool *UniswapV3PoolSession) TickSpacing() (*big.Int, error) {
return _UniswapV3Pool.Contract.TickSpacing(&_UniswapV3Pool.CallOpts)
}
// TickSpacing is a free data retrieval call binding the contract method 0xd0c93a7c.
//
// Solidity: function tickSpacing() returns(int24)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) TickSpacing() (*big.Int, error) {
return _UniswapV3Pool.Contract.TickSpacing(&_UniswapV3Pool.CallOpts)
}
// Ticks is a free data retrieval call binding the contract method 0xf30dba93.
//
// Solidity: function ticks(int24 ) returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolCaller) 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 := _UniswapV3Pool.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 ) returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolSession) 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 _UniswapV3Pool.Contract.Ticks(&_UniswapV3Pool.CallOpts, arg0)
}
// Ticks is a free data retrieval call binding the contract method 0xf30dba93.
//
// Solidity: function ticks(int24 ) returns(uint128 liquidityGross, int128 liquidityNet, uint256 feeGrowthOutside0X128, uint256 feeGrowthOutside1X128, int56 tickCumulativeOutside, uint160 secondsPerLiquidityOutsideX128, uint32 secondsOutside, bool initialized)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) 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 _UniswapV3Pool.Contract.Ticks(&_UniswapV3Pool.CallOpts, arg0)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCaller) Token0(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(address)
func (_UniswapV3Pool *UniswapV3PoolSession) Token0() (common.Address, error) {
return _UniswapV3Pool.Contract.Token0(&_UniswapV3Pool.CallOpts)
}
// Token0 is a free data retrieval call binding the contract method 0x0dfe1681.
//
// Solidity: function token0() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Token0() (common.Address, error) {
return _UniswapV3Pool.Contract.Token0(&_UniswapV3Pool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCaller) Token1(opts *bind.CallOpts) (common.Address, error) {
var out []interface{}
err := _UniswapV3Pool.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() returns(address)
func (_UniswapV3Pool *UniswapV3PoolSession) Token1() (common.Address, error) {
return _UniswapV3Pool.Contract.Token1(&_UniswapV3Pool.CallOpts)
}
// Token1 is a free data retrieval call binding the contract method 0xd21220a7.
//
// Solidity: function token1() returns(address)
func (_UniswapV3Pool *UniswapV3PoolCallerSession) Token1() (common.Address, error) {
return _UniswapV3Pool.Contract.Token1(&_UniswapV3Pool.CallOpts)
}
// 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 (_UniswapV3Pool *UniswapV3PoolTransactor) Swap(opts *bind.TransactOpts, recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) {
return _UniswapV3Pool.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 (_UniswapV3Pool *UniswapV3PoolSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.Swap(&_UniswapV3Pool.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 (_UniswapV3Pool *UniswapV3PoolTransactorSession) Swap(recipient common.Address, zeroForOne bool, amountSpecified *big.Int, sqrtPriceLimitX96 *big.Int, data []byte) (*types.Transaction, error) {
return _UniswapV3Pool.Contract.Swap(&_UniswapV3Pool.TransactOpts, recipient, zeroForOne, amountSpecified, sqrtPriceLimitX96, data)
}