622 lines
30 KiB
Go
622 lines
30 KiB
Go
// Code generated - DO NOT EDIT.
|
|
// This file is a generated binding and any manual changes will be lost.
|
|
|
|
package interfaces
|
|
|
|
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
|
|
)
|
|
|
|
// IArbitrageArbitrageParams is an auto generated low-level Go binding around an user-defined struct.
|
|
type IArbitrageArbitrageParams struct {
|
|
Tokens []common.Address
|
|
Pools []common.Address
|
|
Amounts []*big.Int
|
|
SwapData [][]byte
|
|
MinProfit *big.Int
|
|
}
|
|
|
|
// IArbitrageTriangularArbitrageParams is an auto generated low-level Go binding around an user-defined struct.
|
|
type IArbitrageTriangularArbitrageParams struct {
|
|
TokenA common.Address
|
|
TokenB common.Address
|
|
TokenC common.Address
|
|
PoolAB common.Address
|
|
PoolBC common.Address
|
|
PoolCA common.Address
|
|
AmountIn *big.Int
|
|
MinProfit *big.Int
|
|
SwapDataAB []byte
|
|
SwapDataBC []byte
|
|
SwapDataCA []byte
|
|
}
|
|
|
|
// IArbitrageMetaData contains all meta data concerning the IArbitrage contract.
|
|
var IArbitrageMetaData = &bind.MetaData{
|
|
ABI: "[{\"type\":\"function\",\"name\":\"calculateArbitrageProfit\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIArbitrage.ArbitrageParams\",\"components\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"amounts\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"swapData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"minProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"expectedProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"calculateTriangularArbitrageProfit\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIArbitrage.TriangularArbitrageParams\",\"components\":[{\"name\":\"tokenA\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenB\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenC\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolAB\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolBC\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolCA\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountIn\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"swapDataAB\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"swapDataBC\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"swapDataCA\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"expectedProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"executeArbitrage\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIArbitrage.ArbitrageParams\",\"components\":[{\"name\":\"tokens\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"pools\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"amounts\",\"type\":\"uint256[]\",\"internalType\":\"uint256[]\"},{\"name\":\"swapData\",\"type\":\"bytes[]\",\"internalType\":\"bytes[]\"},{\"name\":\"minProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"executeTriangularArbitrage\",\"inputs\":[{\"name\":\"params\",\"type\":\"tuple\",\"internalType\":\"structIArbitrage.TriangularArbitrageParams\",\"components\":[{\"name\":\"tokenA\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenB\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenC\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolAB\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolBC\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"poolCA\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountIn\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"minProfit\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"swapDataAB\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"swapDataBC\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"swapDataCA\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"event\",\"name\":\"ArbitrageExecuted\",\"inputs\":[{\"name\":\"initiator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokens\",\"type\":\"address[]\",\"indexed\":false,\"internalType\":\"address[]\"},{\"name\":\"amounts\",\"type\":\"uint256[]\",\"indexed\":false,\"internalType\":\"uint256[]\"},{\"name\":\"profit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"TriangularArbitrageExecuted\",\"inputs\":[{\"name\":\"initiator\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenA\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenB\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"tokenC\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"},{\"name\":\"amountIn\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"},{\"name\":\"profit\",\"type\":\"uint256\",\"indexed\":false,\"internalType\":\"uint256\"}],\"anonymous\":false}]",
|
|
}
|
|
|
|
// IArbitrageABI is the input ABI used to generate the binding from.
|
|
// Deprecated: Use IArbitrageMetaData.ABI instead.
|
|
var IArbitrageABI = IArbitrageMetaData.ABI
|
|
|
|
// IArbitrage is an auto generated Go binding around an Ethereum contract.
|
|
type IArbitrage struct {
|
|
IArbitrageCaller // Read-only binding to the contract
|
|
IArbitrageTransactor // Write-only binding to the contract
|
|
IArbitrageFilterer // Log filterer for contract events
|
|
}
|
|
|
|
// IArbitrageCaller is an auto generated read-only Go binding around an Ethereum contract.
|
|
type IArbitrageCaller struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// IArbitrageTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
|
type IArbitrageTransactor struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// IArbitrageFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
|
type IArbitrageFilterer struct {
|
|
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
|
}
|
|
|
|
// IArbitrageSession is an auto generated Go binding around an Ethereum contract,
|
|
// with pre-set call and transact options.
|
|
type IArbitrageSession struct {
|
|
Contract *IArbitrage // 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
|
|
}
|
|
|
|
// IArbitrageCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
|
// with pre-set call options.
|
|
type IArbitrageCallerSession struct {
|
|
Contract *IArbitrageCaller // Generic contract caller binding to set the session for
|
|
CallOpts bind.CallOpts // Call options to use throughout this session
|
|
}
|
|
|
|
// IArbitrageTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
|
// with pre-set transact options.
|
|
type IArbitrageTransactorSession struct {
|
|
Contract *IArbitrageTransactor // Generic contract transactor binding to set the session for
|
|
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
|
}
|
|
|
|
// IArbitrageRaw is an auto generated low-level Go binding around an Ethereum contract.
|
|
type IArbitrageRaw struct {
|
|
Contract *IArbitrage // Generic contract binding to access the raw methods on
|
|
}
|
|
|
|
// IArbitrageCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
|
type IArbitrageCallerRaw struct {
|
|
Contract *IArbitrageCaller // Generic read-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// IArbitrageTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
|
type IArbitrageTransactorRaw struct {
|
|
Contract *IArbitrageTransactor // Generic write-only contract binding to access the raw methods on
|
|
}
|
|
|
|
// NewIArbitrage creates a new instance of IArbitrage, bound to a specific deployed contract.
|
|
func NewIArbitrage(address common.Address, backend bind.ContractBackend) (*IArbitrage, error) {
|
|
contract, err := bindIArbitrage(address, backend, backend, backend)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrage{IArbitrageCaller: IArbitrageCaller{contract: contract}, IArbitrageTransactor: IArbitrageTransactor{contract: contract}, IArbitrageFilterer: IArbitrageFilterer{contract: contract}}, nil
|
|
}
|
|
|
|
// NewIArbitrageCaller creates a new read-only instance of IArbitrage, bound to a specific deployed contract.
|
|
func NewIArbitrageCaller(address common.Address, caller bind.ContractCaller) (*IArbitrageCaller, error) {
|
|
contract, err := bindIArbitrage(address, caller, nil, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrageCaller{contract: contract}, nil
|
|
}
|
|
|
|
// NewIArbitrageTransactor creates a new write-only instance of IArbitrage, bound to a specific deployed contract.
|
|
func NewIArbitrageTransactor(address common.Address, transactor bind.ContractTransactor) (*IArbitrageTransactor, error) {
|
|
contract, err := bindIArbitrage(address, nil, transactor, nil)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrageTransactor{contract: contract}, nil
|
|
}
|
|
|
|
// NewIArbitrageFilterer creates a new log filterer instance of IArbitrage, bound to a specific deployed contract.
|
|
func NewIArbitrageFilterer(address common.Address, filterer bind.ContractFilterer) (*IArbitrageFilterer, error) {
|
|
contract, err := bindIArbitrage(address, nil, nil, filterer)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrageFilterer{contract: contract}, nil
|
|
}
|
|
|
|
// bindIArbitrage binds a generic wrapper to an already deployed contract.
|
|
func bindIArbitrage(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
|
parsed, err := IArbitrageMetaData.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 (_IArbitrage *IArbitrageRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _IArbitrage.Contract.IArbitrageCaller.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 (_IArbitrage *IArbitrageRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.IArbitrageTransactor.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_IArbitrage *IArbitrageRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.IArbitrageTransactor.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 (_IArbitrage *IArbitrageCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
|
return _IArbitrage.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 (_IArbitrage *IArbitrageTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.contract.Transfer(opts)
|
|
}
|
|
|
|
// Transact invokes the (paid) contract method with params as input values.
|
|
func (_IArbitrage *IArbitrageTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.contract.Transact(opts, method, params...)
|
|
}
|
|
|
|
// CalculateArbitrageProfit is a free data retrieval call binding the contract method 0x8f5268a8.
|
|
//
|
|
// Solidity: function calculateArbitrageProfit((address[],address[],uint256[],bytes[],uint256) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageCaller) CalculateArbitrageProfit(opts *bind.CallOpts, params IArbitrageArbitrageParams) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _IArbitrage.contract.Call(opts, &out, "calculateArbitrageProfit", params)
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// CalculateArbitrageProfit is a free data retrieval call binding the contract method 0x8f5268a8.
|
|
//
|
|
// Solidity: function calculateArbitrageProfit((address[],address[],uint256[],bytes[],uint256) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageSession) CalculateArbitrageProfit(params IArbitrageArbitrageParams) (*big.Int, error) {
|
|
return _IArbitrage.Contract.CalculateArbitrageProfit(&_IArbitrage.CallOpts, params)
|
|
}
|
|
|
|
// CalculateArbitrageProfit is a free data retrieval call binding the contract method 0x8f5268a8.
|
|
//
|
|
// Solidity: function calculateArbitrageProfit((address[],address[],uint256[],bytes[],uint256) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageCallerSession) CalculateArbitrageProfit(params IArbitrageArbitrageParams) (*big.Int, error) {
|
|
return _IArbitrage.Contract.CalculateArbitrageProfit(&_IArbitrage.CallOpts, params)
|
|
}
|
|
|
|
// CalculateTriangularArbitrageProfit is a free data retrieval call binding the contract method 0x9f1bfb6a.
|
|
//
|
|
// Solidity: function calculateTriangularArbitrageProfit((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageCaller) CalculateTriangularArbitrageProfit(opts *bind.CallOpts, params IArbitrageTriangularArbitrageParams) (*big.Int, error) {
|
|
var out []interface{}
|
|
err := _IArbitrage.contract.Call(opts, &out, "calculateTriangularArbitrageProfit", params)
|
|
|
|
if err != nil {
|
|
return *new(*big.Int), err
|
|
}
|
|
|
|
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
|
|
|
return out0, err
|
|
|
|
}
|
|
|
|
// CalculateTriangularArbitrageProfit is a free data retrieval call binding the contract method 0x9f1bfb6a.
|
|
//
|
|
// Solidity: function calculateTriangularArbitrageProfit((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageSession) CalculateTriangularArbitrageProfit(params IArbitrageTriangularArbitrageParams) (*big.Int, error) {
|
|
return _IArbitrage.Contract.CalculateTriangularArbitrageProfit(&_IArbitrage.CallOpts, params)
|
|
}
|
|
|
|
// CalculateTriangularArbitrageProfit is a free data retrieval call binding the contract method 0x9f1bfb6a.
|
|
//
|
|
// Solidity: function calculateTriangularArbitrageProfit((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) view returns(uint256 expectedProfit)
|
|
func (_IArbitrage *IArbitrageCallerSession) CalculateTriangularArbitrageProfit(params IArbitrageTriangularArbitrageParams) (*big.Int, error) {
|
|
return _IArbitrage.Contract.CalculateTriangularArbitrageProfit(&_IArbitrage.CallOpts, params)
|
|
}
|
|
|
|
// ExecuteArbitrage is a paid mutator transaction binding the contract method 0x0c6111f7.
|
|
//
|
|
// Solidity: function executeArbitrage((address[],address[],uint256[],bytes[],uint256) params) returns()
|
|
func (_IArbitrage *IArbitrageTransactor) ExecuteArbitrage(opts *bind.TransactOpts, params IArbitrageArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.contract.Transact(opts, "executeArbitrage", params)
|
|
}
|
|
|
|
// ExecuteArbitrage is a paid mutator transaction binding the contract method 0x0c6111f7.
|
|
//
|
|
// Solidity: function executeArbitrage((address[],address[],uint256[],bytes[],uint256) params) returns()
|
|
func (_IArbitrage *IArbitrageSession) ExecuteArbitrage(params IArbitrageArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.ExecuteArbitrage(&_IArbitrage.TransactOpts, params)
|
|
}
|
|
|
|
// ExecuteArbitrage is a paid mutator transaction binding the contract method 0x0c6111f7.
|
|
//
|
|
// Solidity: function executeArbitrage((address[],address[],uint256[],bytes[],uint256) params) returns()
|
|
func (_IArbitrage *IArbitrageTransactorSession) ExecuteArbitrage(params IArbitrageArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.ExecuteArbitrage(&_IArbitrage.TransactOpts, params)
|
|
}
|
|
|
|
// ExecuteTriangularArbitrage is a paid mutator transaction binding the contract method 0x1e9ece24.
|
|
//
|
|
// Solidity: function executeTriangularArbitrage((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) returns()
|
|
func (_IArbitrage *IArbitrageTransactor) ExecuteTriangularArbitrage(opts *bind.TransactOpts, params IArbitrageTriangularArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.contract.Transact(opts, "executeTriangularArbitrage", params)
|
|
}
|
|
|
|
// ExecuteTriangularArbitrage is a paid mutator transaction binding the contract method 0x1e9ece24.
|
|
//
|
|
// Solidity: function executeTriangularArbitrage((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) returns()
|
|
func (_IArbitrage *IArbitrageSession) ExecuteTriangularArbitrage(params IArbitrageTriangularArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.ExecuteTriangularArbitrage(&_IArbitrage.TransactOpts, params)
|
|
}
|
|
|
|
// ExecuteTriangularArbitrage is a paid mutator transaction binding the contract method 0x1e9ece24.
|
|
//
|
|
// Solidity: function executeTriangularArbitrage((address,address,address,address,address,address,uint256,uint256,bytes,bytes,bytes) params) returns()
|
|
func (_IArbitrage *IArbitrageTransactorSession) ExecuteTriangularArbitrage(params IArbitrageTriangularArbitrageParams) (*types.Transaction, error) {
|
|
return _IArbitrage.Contract.ExecuteTriangularArbitrage(&_IArbitrage.TransactOpts, params)
|
|
}
|
|
|
|
// IArbitrageArbitrageExecutedIterator is returned from FilterArbitrageExecuted and is used to iterate over the raw logs and unpacked data for ArbitrageExecuted events raised by the IArbitrage contract.
|
|
type IArbitrageArbitrageExecutedIterator struct {
|
|
Event *IArbitrageArbitrageExecuted // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *IArbitrageArbitrageExecutedIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(IArbitrageArbitrageExecuted)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(IArbitrageArbitrageExecuted)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *IArbitrageArbitrageExecutedIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *IArbitrageArbitrageExecutedIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// IArbitrageArbitrageExecuted represents a ArbitrageExecuted event raised by the IArbitrage contract.
|
|
type IArbitrageArbitrageExecuted struct {
|
|
Initiator common.Address
|
|
Tokens []common.Address
|
|
Amounts []*big.Int
|
|
Profit *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterArbitrageExecuted is a free log retrieval operation binding the contract event 0xb62e177becf771830567708f66852c0f4ec00da57b10012a413f9a55884691b4.
|
|
//
|
|
// Solidity: event ArbitrageExecuted(address indexed initiator, address[] tokens, uint256[] amounts, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) FilterArbitrageExecuted(opts *bind.FilterOpts, initiator []common.Address) (*IArbitrageArbitrageExecutedIterator, error) {
|
|
|
|
var initiatorRule []interface{}
|
|
for _, initiatorItem := range initiator {
|
|
initiatorRule = append(initiatorRule, initiatorItem)
|
|
}
|
|
|
|
logs, sub, err := _IArbitrage.contract.FilterLogs(opts, "ArbitrageExecuted", initiatorRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrageArbitrageExecutedIterator{contract: _IArbitrage.contract, event: "ArbitrageExecuted", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchArbitrageExecuted is a free log subscription operation binding the contract event 0xb62e177becf771830567708f66852c0f4ec00da57b10012a413f9a55884691b4.
|
|
//
|
|
// Solidity: event ArbitrageExecuted(address indexed initiator, address[] tokens, uint256[] amounts, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) WatchArbitrageExecuted(opts *bind.WatchOpts, sink chan<- *IArbitrageArbitrageExecuted, initiator []common.Address) (event.Subscription, error) {
|
|
|
|
var initiatorRule []interface{}
|
|
for _, initiatorItem := range initiator {
|
|
initiatorRule = append(initiatorRule, initiatorItem)
|
|
}
|
|
|
|
logs, sub, err := _IArbitrage.contract.WatchLogs(opts, "ArbitrageExecuted", initiatorRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(IArbitrageArbitrageExecuted)
|
|
if err := _IArbitrage.contract.UnpackLog(event, "ArbitrageExecuted", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseArbitrageExecuted is a log parse operation binding the contract event 0xb62e177becf771830567708f66852c0f4ec00da57b10012a413f9a55884691b4.
|
|
//
|
|
// Solidity: event ArbitrageExecuted(address indexed initiator, address[] tokens, uint256[] amounts, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) ParseArbitrageExecuted(log types.Log) (*IArbitrageArbitrageExecuted, error) {
|
|
event := new(IArbitrageArbitrageExecuted)
|
|
if err := _IArbitrage.contract.UnpackLog(event, "ArbitrageExecuted", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|
|
|
|
// IArbitrageTriangularArbitrageExecutedIterator is returned from FilterTriangularArbitrageExecuted and is used to iterate over the raw logs and unpacked data for TriangularArbitrageExecuted events raised by the IArbitrage contract.
|
|
type IArbitrageTriangularArbitrageExecutedIterator struct {
|
|
Event *IArbitrageTriangularArbitrageExecuted // Event containing the contract specifics and raw log
|
|
|
|
contract *bind.BoundContract // Generic contract to use for unpacking event data
|
|
event string // Event name to use for unpacking event data
|
|
|
|
logs chan types.Log // Log channel receiving the found contract events
|
|
sub ethereum.Subscription // Subscription for errors, completion and termination
|
|
done bool // Whether the subscription completed delivering logs
|
|
fail error // Occurred error to stop iteration
|
|
}
|
|
|
|
// Next advances the iterator to the subsequent event, returning whether there
|
|
// are any more events found. In case of a retrieval or parsing error, false is
|
|
// returned and Error() can be queried for the exact failure.
|
|
func (it *IArbitrageTriangularArbitrageExecutedIterator) Next() bool {
|
|
// If the iterator failed, stop iterating
|
|
if it.fail != nil {
|
|
return false
|
|
}
|
|
// If the iterator completed, deliver directly whatever's available
|
|
if it.done {
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(IArbitrageTriangularArbitrageExecuted)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
// Iterator still in progress, wait for either a data or an error event
|
|
select {
|
|
case log := <-it.logs:
|
|
it.Event = new(IArbitrageTriangularArbitrageExecuted)
|
|
if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil {
|
|
it.fail = err
|
|
return false
|
|
}
|
|
it.Event.Raw = log
|
|
return true
|
|
|
|
case err := <-it.sub.Err():
|
|
it.done = true
|
|
it.fail = err
|
|
return it.Next()
|
|
}
|
|
}
|
|
|
|
// Error returns any retrieval or parsing error occurred during filtering.
|
|
func (it *IArbitrageTriangularArbitrageExecutedIterator) Error() error {
|
|
return it.fail
|
|
}
|
|
|
|
// Close terminates the iteration process, releasing any pending underlying
|
|
// resources.
|
|
func (it *IArbitrageTriangularArbitrageExecutedIterator) Close() error {
|
|
it.sub.Unsubscribe()
|
|
return nil
|
|
}
|
|
|
|
// IArbitrageTriangularArbitrageExecuted represents a TriangularArbitrageExecuted event raised by the IArbitrage contract.
|
|
type IArbitrageTriangularArbitrageExecuted struct {
|
|
Initiator common.Address
|
|
TokenA common.Address
|
|
TokenB common.Address
|
|
TokenC common.Address
|
|
AmountIn *big.Int
|
|
Profit *big.Int
|
|
Raw types.Log // Blockchain specific contextual infos
|
|
}
|
|
|
|
// FilterTriangularArbitrageExecuted is a free log retrieval operation binding the contract event 0x566f2a7de0030e240b63401c2bd70e65a04ef37802556c7a02ff8aee8c89ea82.
|
|
//
|
|
// Solidity: event TriangularArbitrageExecuted(address indexed initiator, address indexed tokenA, address indexed tokenB, address tokenC, uint256 amountIn, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) FilterTriangularArbitrageExecuted(opts *bind.FilterOpts, initiator []common.Address, tokenA []common.Address, tokenB []common.Address) (*IArbitrageTriangularArbitrageExecutedIterator, error) {
|
|
|
|
var initiatorRule []interface{}
|
|
for _, initiatorItem := range initiator {
|
|
initiatorRule = append(initiatorRule, initiatorItem)
|
|
}
|
|
var tokenARule []interface{}
|
|
for _, tokenAItem := range tokenA {
|
|
tokenARule = append(tokenARule, tokenAItem)
|
|
}
|
|
var tokenBRule []interface{}
|
|
for _, tokenBItem := range tokenB {
|
|
tokenBRule = append(tokenBRule, tokenBItem)
|
|
}
|
|
|
|
logs, sub, err := _IArbitrage.contract.FilterLogs(opts, "TriangularArbitrageExecuted", initiatorRule, tokenARule, tokenBRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return &IArbitrageTriangularArbitrageExecutedIterator{contract: _IArbitrage.contract, event: "TriangularArbitrageExecuted", logs: logs, sub: sub}, nil
|
|
}
|
|
|
|
// WatchTriangularArbitrageExecuted is a free log subscription operation binding the contract event 0x566f2a7de0030e240b63401c2bd70e65a04ef37802556c7a02ff8aee8c89ea82.
|
|
//
|
|
// Solidity: event TriangularArbitrageExecuted(address indexed initiator, address indexed tokenA, address indexed tokenB, address tokenC, uint256 amountIn, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) WatchTriangularArbitrageExecuted(opts *bind.WatchOpts, sink chan<- *IArbitrageTriangularArbitrageExecuted, initiator []common.Address, tokenA []common.Address, tokenB []common.Address) (event.Subscription, error) {
|
|
|
|
var initiatorRule []interface{}
|
|
for _, initiatorItem := range initiator {
|
|
initiatorRule = append(initiatorRule, initiatorItem)
|
|
}
|
|
var tokenARule []interface{}
|
|
for _, tokenAItem := range tokenA {
|
|
tokenARule = append(tokenARule, tokenAItem)
|
|
}
|
|
var tokenBRule []interface{}
|
|
for _, tokenBItem := range tokenB {
|
|
tokenBRule = append(tokenBRule, tokenBItem)
|
|
}
|
|
|
|
logs, sub, err := _IArbitrage.contract.WatchLogs(opts, "TriangularArbitrageExecuted", initiatorRule, tokenARule, tokenBRule)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return event.NewSubscription(func(quit <-chan struct{}) error {
|
|
defer sub.Unsubscribe()
|
|
for {
|
|
select {
|
|
case log := <-logs:
|
|
// New log arrived, parse the event and forward to the user
|
|
event := new(IArbitrageTriangularArbitrageExecuted)
|
|
if err := _IArbitrage.contract.UnpackLog(event, "TriangularArbitrageExecuted", log); err != nil {
|
|
return err
|
|
}
|
|
event.Raw = log
|
|
|
|
select {
|
|
case sink <- event:
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
case err := <-sub.Err():
|
|
return err
|
|
case <-quit:
|
|
return nil
|
|
}
|
|
}
|
|
}), nil
|
|
}
|
|
|
|
// ParseTriangularArbitrageExecuted is a log parse operation binding the contract event 0x566f2a7de0030e240b63401c2bd70e65a04ef37802556c7a02ff8aee8c89ea82.
|
|
//
|
|
// Solidity: event TriangularArbitrageExecuted(address indexed initiator, address indexed tokenA, address indexed tokenB, address tokenC, uint256 amountIn, uint256 profit)
|
|
func (_IArbitrage *IArbitrageFilterer) ParseTriangularArbitrageExecuted(log types.Log) (*IArbitrageTriangularArbitrageExecuted, error) {
|
|
event := new(IArbitrageTriangularArbitrageExecuted)
|
|
if err := _IArbitrage.contract.UnpackLog(event, "TriangularArbitrageExecuted", log); err != nil {
|
|
return nil, err
|
|
}
|
|
event.Raw = log
|
|
return event, nil
|
|
}
|