github.com/cwntr/go-defi@v0.0.0-20210629134751-07f9ec2f7e66/binding/honeinch/honeinch.go (about)

     1  // Code generated - DO NOT EDIT.
     2  // This file is a generated binding and any manual changes will be lost.
     3  
     4  package honeinch
     5  
     6  import (
     7  	"math/big"
     8  	"strings"
     9  
    10  	ethereum "github.com/ethereum/go-ethereum"
    11  	"github.com/ethereum/go-ethereum/accounts/abi"
    12  	"github.com/ethereum/go-ethereum/accounts/abi/bind"
    13  	"github.com/ethereum/go-ethereum/common"
    14  	"github.com/ethereum/go-ethereum/core/types"
    15  	"github.com/ethereum/go-ethereum/event"
    16  )
    17  
    18  // Reference imports to suppress errors if they are not otherwise used.
    19  var (
    20  	_ = big.NewInt
    21  	_ = strings.NewReader
    22  	_ = ethereum.NotFound
    23  	_ = bind.Bind
    24  	_ = common.Big1
    25  	_ = types.BloomLookup
    26  	_ = event.NewSubscription
    27  )
    28  
    29  // HoneinchABI is the input ABI used to generate the binding from.
    30  const HoneinchABI = "[{\"constant\":true,\"inputs\":[],\"name\":\"ETH_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"ONEINCH_PROXY\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"REFERRER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[],\"name\":\"TOKEN_SPENDER\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"postProcess\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"fromToken\",\"type\":\"address\"},{\"internalType\":\"contractIERC20\",\"name\":\"toToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"fromTokenAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minReturnAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"guaranteedAmount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"referrer\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"callAddresses\",\"type\":\"address[]\"},{\"internalType\":\"bytes\",\"name\":\"callDataConcat\",\"type\":\"bytes\"},{\"internalType\":\"uint256[]\",\"name\":\"starts\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"gasLimitsAndValues\",\"type\":\"uint256[]\"}],\"name\":\"swap\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"returnAmount\",\"type\":\"uint256\"}],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"}]"
    31  
    32  // Honeinch is an auto generated Go binding around an Ethereum contract.
    33  type Honeinch struct {
    34  	HoneinchCaller     // Read-only binding to the contract
    35  	HoneinchTransactor // Write-only binding to the contract
    36  	HoneinchFilterer   // Log filterer for contract events
    37  }
    38  
    39  // HoneinchCaller is an auto generated read-only Go binding around an Ethereum contract.
    40  type HoneinchCaller struct {
    41  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    42  }
    43  
    44  // HoneinchTransactor is an auto generated write-only Go binding around an Ethereum contract.
    45  type HoneinchTransactor struct {
    46  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    47  }
    48  
    49  // HoneinchFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
    50  type HoneinchFilterer struct {
    51  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    52  }
    53  
    54  // HoneinchSession is an auto generated Go binding around an Ethereum contract,
    55  // with pre-set call and transact options.
    56  type HoneinchSession struct {
    57  	Contract     *Honeinch         // Generic contract binding to set the session for
    58  	CallOpts     bind.CallOpts     // Call options to use throughout this session
    59  	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    60  }
    61  
    62  // HoneinchCallerSession is an auto generated read-only Go binding around an Ethereum contract,
    63  // with pre-set call options.
    64  type HoneinchCallerSession struct {
    65  	Contract *HoneinchCaller // Generic contract caller binding to set the session for
    66  	CallOpts bind.CallOpts   // Call options to use throughout this session
    67  }
    68  
    69  // HoneinchTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
    70  // with pre-set transact options.
    71  type HoneinchTransactorSession struct {
    72  	Contract     *HoneinchTransactor // Generic contract transactor binding to set the session for
    73  	TransactOpts bind.TransactOpts   // Transaction auth options to use throughout this session
    74  }
    75  
    76  // HoneinchRaw is an auto generated low-level Go binding around an Ethereum contract.
    77  type HoneinchRaw struct {
    78  	Contract *Honeinch // Generic contract binding to access the raw methods on
    79  }
    80  
    81  // HoneinchCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
    82  type HoneinchCallerRaw struct {
    83  	Contract *HoneinchCaller // Generic read-only contract binding to access the raw methods on
    84  }
    85  
    86  // HoneinchTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
    87  type HoneinchTransactorRaw struct {
    88  	Contract *HoneinchTransactor // Generic write-only contract binding to access the raw methods on
    89  }
    90  
    91  // NewHoneinch creates a new instance of Honeinch, bound to a specific deployed contract.
    92  func NewHoneinch(address common.Address, backend bind.ContractBackend) (*Honeinch, error) {
    93  	contract, err := bindHoneinch(address, backend, backend, backend)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &Honeinch{HoneinchCaller: HoneinchCaller{contract: contract}, HoneinchTransactor: HoneinchTransactor{contract: contract}, HoneinchFilterer: HoneinchFilterer{contract: contract}}, nil
    98  }
    99  
   100  // NewHoneinchCaller creates a new read-only instance of Honeinch, bound to a specific deployed contract.
   101  func NewHoneinchCaller(address common.Address, caller bind.ContractCaller) (*HoneinchCaller, error) {
   102  	contract, err := bindHoneinch(address, caller, nil, nil)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &HoneinchCaller{contract: contract}, nil
   107  }
   108  
   109  // NewHoneinchTransactor creates a new write-only instance of Honeinch, bound to a specific deployed contract.
   110  func NewHoneinchTransactor(address common.Address, transactor bind.ContractTransactor) (*HoneinchTransactor, error) {
   111  	contract, err := bindHoneinch(address, nil, transactor, nil)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return &HoneinchTransactor{contract: contract}, nil
   116  }
   117  
   118  // NewHoneinchFilterer creates a new log filterer instance of Honeinch, bound to a specific deployed contract.
   119  func NewHoneinchFilterer(address common.Address, filterer bind.ContractFilterer) (*HoneinchFilterer, error) {
   120  	contract, err := bindHoneinch(address, nil, nil, filterer)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &HoneinchFilterer{contract: contract}, nil
   125  }
   126  
   127  // bindHoneinch binds a generic wrapper to an already deployed contract.
   128  func bindHoneinch(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
   129  	parsed, err := abi.JSON(strings.NewReader(HoneinchABI))
   130  	if err != nil {
   131  		return nil, err
   132  	}
   133  	return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil
   134  }
   135  
   136  // Call invokes the (constant) contract method with params as input values and
   137  // sets the output to result. The result type might be a single field for simple
   138  // returns, a slice of interfaces for anonymous returns and a struct for named
   139  // returns.
   140  func (_Honeinch *HoneinchRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   141  	return _Honeinch.Contract.HoneinchCaller.contract.Call(opts, result, method, params...)
   142  }
   143  
   144  // Transfer initiates a plain transaction to move funds to the contract, calling
   145  // its default method if one is available.
   146  func (_Honeinch *HoneinchRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   147  	return _Honeinch.Contract.HoneinchTransactor.contract.Transfer(opts)
   148  }
   149  
   150  // Transact invokes the (paid) contract method with params as input values.
   151  func (_Honeinch *HoneinchRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   152  	return _Honeinch.Contract.HoneinchTransactor.contract.Transact(opts, method, params...)
   153  }
   154  
   155  // Call invokes the (constant) contract method with params as input values and
   156  // sets the output to result. The result type might be a single field for simple
   157  // returns, a slice of interfaces for anonymous returns and a struct for named
   158  // returns.
   159  func (_Honeinch *HoneinchCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   160  	return _Honeinch.Contract.contract.Call(opts, result, method, params...)
   161  }
   162  
   163  // Transfer initiates a plain transaction to move funds to the contract, calling
   164  // its default method if one is available.
   165  func (_Honeinch *HoneinchTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   166  	return _Honeinch.Contract.contract.Transfer(opts)
   167  }
   168  
   169  // Transact invokes the (paid) contract method with params as input values.
   170  func (_Honeinch *HoneinchTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   171  	return _Honeinch.Contract.contract.Transact(opts, method, params...)
   172  }
   173  
   174  // ETHADDRESS is a free data retrieval call binding the contract method 0xa734f06e.
   175  //
   176  // Solidity: function ETH_ADDRESS() view returns(address)
   177  func (_Honeinch *HoneinchCaller) ETHADDRESS(opts *bind.CallOpts) (common.Address, error) {
   178  	var out []interface{}
   179  	err := _Honeinch.contract.Call(opts, &out, "ETH_ADDRESS")
   180  
   181  	if err != nil {
   182  		return *new(common.Address), err
   183  	}
   184  
   185  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   186  
   187  	return out0, err
   188  
   189  }
   190  
   191  // ETHADDRESS is a free data retrieval call binding the contract method 0xa734f06e.
   192  //
   193  // Solidity: function ETH_ADDRESS() view returns(address)
   194  func (_Honeinch *HoneinchSession) ETHADDRESS() (common.Address, error) {
   195  	return _Honeinch.Contract.ETHADDRESS(&_Honeinch.CallOpts)
   196  }
   197  
   198  // ETHADDRESS is a free data retrieval call binding the contract method 0xa734f06e.
   199  //
   200  // Solidity: function ETH_ADDRESS() view returns(address)
   201  func (_Honeinch *HoneinchCallerSession) ETHADDRESS() (common.Address, error) {
   202  	return _Honeinch.Contract.ETHADDRESS(&_Honeinch.CallOpts)
   203  }
   204  
   205  // ONEINCHPROXY is a free data retrieval call binding the contract method 0x4add32fb.
   206  //
   207  // Solidity: function ONEINCH_PROXY() view returns(address)
   208  func (_Honeinch *HoneinchCaller) ONEINCHPROXY(opts *bind.CallOpts) (common.Address, error) {
   209  	var out []interface{}
   210  	err := _Honeinch.contract.Call(opts, &out, "ONEINCH_PROXY")
   211  
   212  	if err != nil {
   213  		return *new(common.Address), err
   214  	}
   215  
   216  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   217  
   218  	return out0, err
   219  
   220  }
   221  
   222  // ONEINCHPROXY is a free data retrieval call binding the contract method 0x4add32fb.
   223  //
   224  // Solidity: function ONEINCH_PROXY() view returns(address)
   225  func (_Honeinch *HoneinchSession) ONEINCHPROXY() (common.Address, error) {
   226  	return _Honeinch.Contract.ONEINCHPROXY(&_Honeinch.CallOpts)
   227  }
   228  
   229  // ONEINCHPROXY is a free data retrieval call binding the contract method 0x4add32fb.
   230  //
   231  // Solidity: function ONEINCH_PROXY() view returns(address)
   232  func (_Honeinch *HoneinchCallerSession) ONEINCHPROXY() (common.Address, error) {
   233  	return _Honeinch.Contract.ONEINCHPROXY(&_Honeinch.CallOpts)
   234  }
   235  
   236  // REFERRER is a free data retrieval call binding the contract method 0xc0560374.
   237  //
   238  // Solidity: function REFERRER() view returns(address)
   239  func (_Honeinch *HoneinchCaller) REFERRER(opts *bind.CallOpts) (common.Address, error) {
   240  	var out []interface{}
   241  	err := _Honeinch.contract.Call(opts, &out, "REFERRER")
   242  
   243  	if err != nil {
   244  		return *new(common.Address), err
   245  	}
   246  
   247  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   248  
   249  	return out0, err
   250  
   251  }
   252  
   253  // REFERRER is a free data retrieval call binding the contract method 0xc0560374.
   254  //
   255  // Solidity: function REFERRER() view returns(address)
   256  func (_Honeinch *HoneinchSession) REFERRER() (common.Address, error) {
   257  	return _Honeinch.Contract.REFERRER(&_Honeinch.CallOpts)
   258  }
   259  
   260  // REFERRER is a free data retrieval call binding the contract method 0xc0560374.
   261  //
   262  // Solidity: function REFERRER() view returns(address)
   263  func (_Honeinch *HoneinchCallerSession) REFERRER() (common.Address, error) {
   264  	return _Honeinch.Contract.REFERRER(&_Honeinch.CallOpts)
   265  }
   266  
   267  // TOKENSPENDER is a free data retrieval call binding the contract method 0x1e485f11.
   268  //
   269  // Solidity: function TOKEN_SPENDER() view returns(address)
   270  func (_Honeinch *HoneinchCaller) TOKENSPENDER(opts *bind.CallOpts) (common.Address, error) {
   271  	var out []interface{}
   272  	err := _Honeinch.contract.Call(opts, &out, "TOKEN_SPENDER")
   273  
   274  	if err != nil {
   275  		return *new(common.Address), err
   276  	}
   277  
   278  	out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
   279  
   280  	return out0, err
   281  
   282  }
   283  
   284  // TOKENSPENDER is a free data retrieval call binding the contract method 0x1e485f11.
   285  //
   286  // Solidity: function TOKEN_SPENDER() view returns(address)
   287  func (_Honeinch *HoneinchSession) TOKENSPENDER() (common.Address, error) {
   288  	return _Honeinch.Contract.TOKENSPENDER(&_Honeinch.CallOpts)
   289  }
   290  
   291  // TOKENSPENDER is a free data retrieval call binding the contract method 0x1e485f11.
   292  //
   293  // Solidity: function TOKEN_SPENDER() view returns(address)
   294  func (_Honeinch *HoneinchCallerSession) TOKENSPENDER() (common.Address, error) {
   295  	return _Honeinch.Contract.TOKENSPENDER(&_Honeinch.CallOpts)
   296  }
   297  
   298  // PostProcess is a paid mutator transaction binding the contract method 0xc2722916.
   299  //
   300  // Solidity: function postProcess() payable returns()
   301  func (_Honeinch *HoneinchTransactor) PostProcess(opts *bind.TransactOpts) (*types.Transaction, error) {
   302  	return _Honeinch.contract.Transact(opts, "postProcess")
   303  }
   304  
   305  // PostProcess is a paid mutator transaction binding the contract method 0xc2722916.
   306  //
   307  // Solidity: function postProcess() payable returns()
   308  func (_Honeinch *HoneinchSession) PostProcess() (*types.Transaction, error) {
   309  	return _Honeinch.Contract.PostProcess(&_Honeinch.TransactOpts)
   310  }
   311  
   312  // PostProcess is a paid mutator transaction binding the contract method 0xc2722916.
   313  //
   314  // Solidity: function postProcess() payable returns()
   315  func (_Honeinch *HoneinchTransactorSession) PostProcess() (*types.Transaction, error) {
   316  	return _Honeinch.Contract.PostProcess(&_Honeinch.TransactOpts)
   317  }
   318  
   319  // Swap is a paid mutator transaction binding the contract method 0xf88309d7.
   320  //
   321  // Solidity: function swap(address fromToken, address toToken, uint256 fromTokenAmount, uint256 minReturnAmount, uint256 guaranteedAmount, address referrer, address[] callAddresses, bytes callDataConcat, uint256[] starts, uint256[] gasLimitsAndValues) payable returns(uint256 returnAmount)
   322  func (_Honeinch *HoneinchTransactor) Swap(opts *bind.TransactOpts, fromToken common.Address, toToken common.Address, fromTokenAmount *big.Int, minReturnAmount *big.Int, guaranteedAmount *big.Int, referrer common.Address, callAddresses []common.Address, callDataConcat []byte, starts []*big.Int, gasLimitsAndValues []*big.Int) (*types.Transaction, error) {
   323  	return _Honeinch.contract.Transact(opts, "swap", fromToken, toToken, fromTokenAmount, minReturnAmount, guaranteedAmount, referrer, callAddresses, callDataConcat, starts, gasLimitsAndValues)
   324  }
   325  
   326  // Swap is a paid mutator transaction binding the contract method 0xf88309d7.
   327  //
   328  // Solidity: function swap(address fromToken, address toToken, uint256 fromTokenAmount, uint256 minReturnAmount, uint256 guaranteedAmount, address referrer, address[] callAddresses, bytes callDataConcat, uint256[] starts, uint256[] gasLimitsAndValues) payable returns(uint256 returnAmount)
   329  func (_Honeinch *HoneinchSession) Swap(fromToken common.Address, toToken common.Address, fromTokenAmount *big.Int, minReturnAmount *big.Int, guaranteedAmount *big.Int, referrer common.Address, callAddresses []common.Address, callDataConcat []byte, starts []*big.Int, gasLimitsAndValues []*big.Int) (*types.Transaction, error) {
   330  	return _Honeinch.Contract.Swap(&_Honeinch.TransactOpts, fromToken, toToken, fromTokenAmount, minReturnAmount, guaranteedAmount, referrer, callAddresses, callDataConcat, starts, gasLimitsAndValues)
   331  }
   332  
   333  // Swap is a paid mutator transaction binding the contract method 0xf88309d7.
   334  //
   335  // Solidity: function swap(address fromToken, address toToken, uint256 fromTokenAmount, uint256 minReturnAmount, uint256 guaranteedAmount, address referrer, address[] callAddresses, bytes callDataConcat, uint256[] starts, uint256[] gasLimitsAndValues) payable returns(uint256 returnAmount)
   336  func (_Honeinch *HoneinchTransactorSession) Swap(fromToken common.Address, toToken common.Address, fromTokenAmount *big.Int, minReturnAmount *big.Int, guaranteedAmount *big.Int, referrer common.Address, callAddresses []common.Address, callDataConcat []byte, starts []*big.Int, gasLimitsAndValues []*big.Int) (*types.Transaction, error) {
   337  	return _Honeinch.Contract.Swap(&_Honeinch.TransactOpts, fromToken, toToken, fromTokenAmount, minReturnAmount, guaranteedAmount, referrer, callAddresses, callDataConcat, starts, gasLimitsAndValues)
   338  }