github.com/cwntr/go-defi@v0.0.0-20210629134751-07f9ec2f7e66/binding/haave/haave.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 haave
     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  // HaaveABI is the input ABI used to generate the binding from.
    30  const HaaveABI = "[{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserve\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"deposit\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserve\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"_fee\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_params\",\"type\":\"bytes\"}],\"name\":\"executeOperation\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_reserve\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_params\",\"type\":\"bytes\"}],\"name\":\"flashLoan\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_aToken\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"name\":\"redeem\",\"outputs\":[],\"payable\":true,\"stateMutability\":\"payable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"tokens\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"}]"
    31  
    32  // Haave is an auto generated Go binding around an Ethereum contract.
    33  type Haave struct {
    34  	HaaveCaller     // Read-only binding to the contract
    35  	HaaveTransactor // Write-only binding to the contract
    36  	HaaveFilterer   // Log filterer for contract events
    37  }
    38  
    39  // HaaveCaller is an auto generated read-only Go binding around an Ethereum contract.
    40  type HaaveCaller struct {
    41  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    42  }
    43  
    44  // HaaveTransactor is an auto generated write-only Go binding around an Ethereum contract.
    45  type HaaveTransactor struct {
    46  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    47  }
    48  
    49  // HaaveFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
    50  type HaaveFilterer struct {
    51  	contract *bind.BoundContract // Generic contract wrapper for the low level calls
    52  }
    53  
    54  // HaaveSession is an auto generated Go binding around an Ethereum contract,
    55  // with pre-set call and transact options.
    56  type HaaveSession struct {
    57  	Contract     *Haave            // 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  // HaaveCallerSession is an auto generated read-only Go binding around an Ethereum contract,
    63  // with pre-set call options.
    64  type HaaveCallerSession struct {
    65  	Contract *HaaveCaller  // Generic contract caller binding to set the session for
    66  	CallOpts bind.CallOpts // Call options to use throughout this session
    67  }
    68  
    69  // HaaveTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
    70  // with pre-set transact options.
    71  type HaaveTransactorSession struct {
    72  	Contract     *HaaveTransactor  // Generic contract transactor binding to set the session for
    73  	TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
    74  }
    75  
    76  // HaaveRaw is an auto generated low-level Go binding around an Ethereum contract.
    77  type HaaveRaw struct {
    78  	Contract *Haave // Generic contract binding to access the raw methods on
    79  }
    80  
    81  // HaaveCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
    82  type HaaveCallerRaw struct {
    83  	Contract *HaaveCaller // Generic read-only contract binding to access the raw methods on
    84  }
    85  
    86  // HaaveTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
    87  type HaaveTransactorRaw struct {
    88  	Contract *HaaveTransactor // Generic write-only contract binding to access the raw methods on
    89  }
    90  
    91  // NewHaave creates a new instance of Haave, bound to a specific deployed contract.
    92  func NewHaave(address common.Address, backend bind.ContractBackend) (*Haave, error) {
    93  	contract, err := bindHaave(address, backend, backend, backend)
    94  	if err != nil {
    95  		return nil, err
    96  	}
    97  	return &Haave{HaaveCaller: HaaveCaller{contract: contract}, HaaveTransactor: HaaveTransactor{contract: contract}, HaaveFilterer: HaaveFilterer{contract: contract}}, nil
    98  }
    99  
   100  // NewHaaveCaller creates a new read-only instance of Haave, bound to a specific deployed contract.
   101  func NewHaaveCaller(address common.Address, caller bind.ContractCaller) (*HaaveCaller, error) {
   102  	contract, err := bindHaave(address, caller, nil, nil)
   103  	if err != nil {
   104  		return nil, err
   105  	}
   106  	return &HaaveCaller{contract: contract}, nil
   107  }
   108  
   109  // NewHaaveTransactor creates a new write-only instance of Haave, bound to a specific deployed contract.
   110  func NewHaaveTransactor(address common.Address, transactor bind.ContractTransactor) (*HaaveTransactor, error) {
   111  	contract, err := bindHaave(address, nil, transactor, nil)
   112  	if err != nil {
   113  		return nil, err
   114  	}
   115  	return &HaaveTransactor{contract: contract}, nil
   116  }
   117  
   118  // NewHaaveFilterer creates a new log filterer instance of Haave, bound to a specific deployed contract.
   119  func NewHaaveFilterer(address common.Address, filterer bind.ContractFilterer) (*HaaveFilterer, error) {
   120  	contract, err := bindHaave(address, nil, nil, filterer)
   121  	if err != nil {
   122  		return nil, err
   123  	}
   124  	return &HaaveFilterer{contract: contract}, nil
   125  }
   126  
   127  // bindHaave binds a generic wrapper to an already deployed contract.
   128  func bindHaave(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
   129  	parsed, err := abi.JSON(strings.NewReader(HaaveABI))
   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 (_Haave *HaaveRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   141  	return _Haave.Contract.HaaveCaller.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 (_Haave *HaaveRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   147  	return _Haave.Contract.HaaveTransactor.contract.Transfer(opts)
   148  }
   149  
   150  // Transact invokes the (paid) contract method with params as input values.
   151  func (_Haave *HaaveRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   152  	return _Haave.Contract.HaaveTransactor.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 (_Haave *HaaveCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
   160  	return _Haave.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 (_Haave *HaaveTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
   166  	return _Haave.Contract.contract.Transfer(opts)
   167  }
   168  
   169  // Transact invokes the (paid) contract method with params as input values.
   170  func (_Haave *HaaveTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
   171  	return _Haave.Contract.contract.Transact(opts, method, params...)
   172  }
   173  
   174  // Tokens is a free data retrieval call binding the contract method 0x4f64b2be.
   175  //
   176  // Solidity: function tokens(uint256 ) view returns(address)
   177  func (_Haave *HaaveCaller) Tokens(opts *bind.CallOpts, arg0 *big.Int) (common.Address, error) {
   178  	var out []interface{}
   179  	err := _Haave.contract.Call(opts, &out, "tokens", arg0)
   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  // Tokens is a free data retrieval call binding the contract method 0x4f64b2be.
   192  //
   193  // Solidity: function tokens(uint256 ) view returns(address)
   194  func (_Haave *HaaveSession) Tokens(arg0 *big.Int) (common.Address, error) {
   195  	return _Haave.Contract.Tokens(&_Haave.CallOpts, arg0)
   196  }
   197  
   198  // Tokens is a free data retrieval call binding the contract method 0x4f64b2be.
   199  //
   200  // Solidity: function tokens(uint256 ) view returns(address)
   201  func (_Haave *HaaveCallerSession) Tokens(arg0 *big.Int) (common.Address, error) {
   202  	return _Haave.Contract.Tokens(&_Haave.CallOpts, arg0)
   203  }
   204  
   205  // Deposit is a paid mutator transaction binding the contract method 0x47e7ef24.
   206  //
   207  // Solidity: function deposit(address _reserve, uint256 _amount) payable returns()
   208  func (_Haave *HaaveTransactor) Deposit(opts *bind.TransactOpts, _reserve common.Address, _amount *big.Int) (*types.Transaction, error) {
   209  	return _Haave.contract.Transact(opts, "deposit", _reserve, _amount)
   210  }
   211  
   212  // Deposit is a paid mutator transaction binding the contract method 0x47e7ef24.
   213  //
   214  // Solidity: function deposit(address _reserve, uint256 _amount) payable returns()
   215  func (_Haave *HaaveSession) Deposit(_reserve common.Address, _amount *big.Int) (*types.Transaction, error) {
   216  	return _Haave.Contract.Deposit(&_Haave.TransactOpts, _reserve, _amount)
   217  }
   218  
   219  // Deposit is a paid mutator transaction binding the contract method 0x47e7ef24.
   220  //
   221  // Solidity: function deposit(address _reserve, uint256 _amount) payable returns()
   222  func (_Haave *HaaveTransactorSession) Deposit(_reserve common.Address, _amount *big.Int) (*types.Transaction, error) {
   223  	return _Haave.Contract.Deposit(&_Haave.TransactOpts, _reserve, _amount)
   224  }
   225  
   226  // ExecuteOperation is a paid mutator transaction binding the contract method 0xee872558.
   227  //
   228  // Solidity: function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes _params) payable returns()
   229  func (_Haave *HaaveTransactor) ExecuteOperation(opts *bind.TransactOpts, _reserve common.Address, _amount *big.Int, _fee *big.Int, _params []byte) (*types.Transaction, error) {
   230  	return _Haave.contract.Transact(opts, "executeOperation", _reserve, _amount, _fee, _params)
   231  }
   232  
   233  // ExecuteOperation is a paid mutator transaction binding the contract method 0xee872558.
   234  //
   235  // Solidity: function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes _params) payable returns()
   236  func (_Haave *HaaveSession) ExecuteOperation(_reserve common.Address, _amount *big.Int, _fee *big.Int, _params []byte) (*types.Transaction, error) {
   237  	return _Haave.Contract.ExecuteOperation(&_Haave.TransactOpts, _reserve, _amount, _fee, _params)
   238  }
   239  
   240  // ExecuteOperation is a paid mutator transaction binding the contract method 0xee872558.
   241  //
   242  // Solidity: function executeOperation(address _reserve, uint256 _amount, uint256 _fee, bytes _params) payable returns()
   243  func (_Haave *HaaveTransactorSession) ExecuteOperation(_reserve common.Address, _amount *big.Int, _fee *big.Int, _params []byte) (*types.Transaction, error) {
   244  	return _Haave.Contract.ExecuteOperation(&_Haave.TransactOpts, _reserve, _amount, _fee, _params)
   245  }
   246  
   247  // FlashLoan is a paid mutator transaction binding the contract method 0xe0232b42.
   248  //
   249  // Solidity: function flashLoan(address _reserve, uint256 _amount, bytes _params) payable returns()
   250  func (_Haave *HaaveTransactor) FlashLoan(opts *bind.TransactOpts, _reserve common.Address, _amount *big.Int, _params []byte) (*types.Transaction, error) {
   251  	return _Haave.contract.Transact(opts, "flashLoan", _reserve, _amount, _params)
   252  }
   253  
   254  // FlashLoan is a paid mutator transaction binding the contract method 0xe0232b42.
   255  //
   256  // Solidity: function flashLoan(address _reserve, uint256 _amount, bytes _params) payable returns()
   257  func (_Haave *HaaveSession) FlashLoan(_reserve common.Address, _amount *big.Int, _params []byte) (*types.Transaction, error) {
   258  	return _Haave.Contract.FlashLoan(&_Haave.TransactOpts, _reserve, _amount, _params)
   259  }
   260  
   261  // FlashLoan is a paid mutator transaction binding the contract method 0xe0232b42.
   262  //
   263  // Solidity: function flashLoan(address _reserve, uint256 _amount, bytes _params) payable returns()
   264  func (_Haave *HaaveTransactorSession) FlashLoan(_reserve common.Address, _amount *big.Int, _params []byte) (*types.Transaction, error) {
   265  	return _Haave.Contract.FlashLoan(&_Haave.TransactOpts, _reserve, _amount, _params)
   266  }
   267  
   268  // Redeem is a paid mutator transaction binding the contract method 0x1e9a6950.
   269  //
   270  // Solidity: function redeem(address _aToken, uint256 _amount) payable returns()
   271  func (_Haave *HaaveTransactor) Redeem(opts *bind.TransactOpts, _aToken common.Address, _amount *big.Int) (*types.Transaction, error) {
   272  	return _Haave.contract.Transact(opts, "redeem", _aToken, _amount)
   273  }
   274  
   275  // Redeem is a paid mutator transaction binding the contract method 0x1e9a6950.
   276  //
   277  // Solidity: function redeem(address _aToken, uint256 _amount) payable returns()
   278  func (_Haave *HaaveSession) Redeem(_aToken common.Address, _amount *big.Int) (*types.Transaction, error) {
   279  	return _Haave.Contract.Redeem(&_Haave.TransactOpts, _aToken, _amount)
   280  }
   281  
   282  // Redeem is a paid mutator transaction binding the contract method 0x1e9a6950.
   283  //
   284  // Solidity: function redeem(address _aToken, uint256 _amount) payable returns()
   285  func (_Haave *HaaveTransactorSession) Redeem(_aToken common.Address, _amount *big.Int) (*types.Transaction, error) {
   286  	return _Haave.Contract.Redeem(&_Haave.TransactOpts, _aToken, _amount)
   287  }