curve + aave + beefy
This commit is contained in:
parent
73bb337e4b
commit
0afb017f22
1
aave/contracts/IDataProvider.abi
Normal file
1
aave/contracts/IDataProvider.abi
Normal file
@ -0,0 +1 @@
|
||||
[{"inputs":[{"internalType":"address","name":"asset","type":"address"}],"name":"getReserveTokensAddresses","outputs":[{"internalType":"address","name":"aTokenAddress","type":"address"},{"internalType":"address","name":"stableDebtTokenAddress","type":"address"},{"internalType":"address","name":"variableDebtTokenAddress","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"user","type":"address"}],"name":"getUserReserveData","outputs":[{"internalType":"uint256","name":"currentATokenBalance","type":"uint256"},{"internalType":"uint256","name":"currentStableDebt","type":"uint256"},{"internalType":"uint256","name":"currentVariableDebt","type":"uint256"},{"internalType":"uint256","name":"principalStableDebt","type":"uint256"},{"internalType":"uint256","name":"scaledVariableDebt","type":"uint256"},{"internalType":"uint256","name":"stableBorrowRate","type":"uint256"},{"internalType":"uint256","name":"liquidityRate","type":"uint256"},{"internalType":"uint40","name":"stableRateLastUpdated","type":"uint40"},{"internalType":"bool","name":"usageAsCollateralEnabled","type":"bool"}],"stateMutability":"view","type":"function"}]
|
1
aave/contracts/IIncentivesController.abi
Normal file
1
aave/contracts/IIncentivesController.abi
Normal file
@ -0,0 +1 @@
|
||||
[{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"claimRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"address","name":"user","type":"address"}],"name":"getRewardsBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
|
1
aave/contracts/ILendingPool.abi
Normal file
1
aave/contracts/ILendingPool.abi
Normal file
@ -0,0 +1 @@
|
||||
[{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"interestRateMode","type":"uint256"},{"internalType":"uint16","name":"referralCode","type":"uint16"},{"internalType":"address","name":"onBehalfOf","type":"address"}],"name":"borrow","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"onBehalfOf","type":"address"},{"internalType":"uint16","name":"referralCode","type":"uint16"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserAccountData","outputs":[{"internalType":"uint256","name":"totalCollateralETH","type":"uint256"},{"internalType":"uint256","name":"totalDebtETH","type":"uint256"},{"internalType":"uint256","name":"availableBorrowsETH","type":"uint256"},{"internalType":"uint256","name":"currentLiquidationThreshold","type":"uint256"},{"internalType":"uint256","name":"ltv","type":"uint256"},{"internalType":"uint256","name":"healthFactor","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rateMode","type":"uint256"},{"internalType":"address","name":"onBehalfOf","type":"address"}],"name":"repay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"}]
|
310
aave/contracts/dataprovider.go
Normal file
310
aave/contracts/dataprovider.go
Normal file
@ -0,0 +1,310 @@
|
||||
// Code generated - DO NOT EDIT.
|
||||
// This file is a generated binding and any manual changes will be lost.
|
||||
|
||||
package contracts
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
// DataProviderMetaData contains all meta data concerning the DataProvider contract.
|
||||
var DataProviderMetaData = &bind.MetaData{
|
||||
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"}],\"name\":\"getReserveTokensAddresses\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"aTokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"stableDebtTokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"variableDebtTokenAddress\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getUserReserveData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"currentATokenBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentStableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentVariableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"principalStableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"scaledVariableDebt\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stableBorrowRate\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"liquidityRate\",\"type\":\"uint256\"},{\"internalType\":\"uint40\",\"name\":\"stableRateLastUpdated\",\"type\":\"uint40\"},{\"internalType\":\"bool\",\"name\":\"usageAsCollateralEnabled\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
|
||||
}
|
||||
|
||||
// DataProviderABI is the input ABI used to generate the binding from.
|
||||
// Deprecated: Use DataProviderMetaData.ABI instead.
|
||||
var DataProviderABI = DataProviderMetaData.ABI
|
||||
|
||||
// DataProvider is an auto generated Go binding around an Ethereum contract.
|
||||
type DataProvider struct {
|
||||
DataProviderCaller // Read-only binding to the contract
|
||||
DataProviderTransactor // Write-only binding to the contract
|
||||
DataProviderFilterer // Log filterer for contract events
|
||||
}
|
||||
|
||||
// DataProviderCaller is an auto generated read-only Go binding around an Ethereum contract.
|
||||
type DataProviderCaller struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// DataProviderTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
||||
type DataProviderTransactor struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// DataProviderFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
||||
type DataProviderFilterer struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// DataProviderSession is an auto generated Go binding around an Ethereum contract,
|
||||
// with pre-set call and transact options.
|
||||
type DataProviderSession struct {
|
||||
Contract *DataProvider // 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
|
||||
}
|
||||
|
||||
// DataProviderCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
||||
// with pre-set call options.
|
||||
type DataProviderCallerSession struct {
|
||||
Contract *DataProviderCaller // Generic contract caller binding to set the session for
|
||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||
}
|
||||
|
||||
// DataProviderTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
||||
// with pre-set transact options.
|
||||
type DataProviderTransactorSession struct {
|
||||
Contract *DataProviderTransactor // Generic contract transactor binding to set the session for
|
||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||
}
|
||||
|
||||
// DataProviderRaw is an auto generated low-level Go binding around an Ethereum contract.
|
||||
type DataProviderRaw struct {
|
||||
Contract *DataProvider // Generic contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// DataProviderCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
||||
type DataProviderCallerRaw struct {
|
||||
Contract *DataProviderCaller // Generic read-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// DataProviderTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
||||
type DataProviderTransactorRaw struct {
|
||||
Contract *DataProviderTransactor // Generic write-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// NewDataProvider creates a new instance of DataProvider, bound to a specific deployed contract.
|
||||
func NewDataProvider(address common.Address, backend bind.ContractBackend) (*DataProvider, error) {
|
||||
contract, err := bindDataProvider(address, backend, backend, backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DataProvider{DataProviderCaller: DataProviderCaller{contract: contract}, DataProviderTransactor: DataProviderTransactor{contract: contract}, DataProviderFilterer: DataProviderFilterer{contract: contract}}, nil
|
||||
}
|
||||
|
||||
// NewDataProviderCaller creates a new read-only instance of DataProvider, bound to a specific deployed contract.
|
||||
func NewDataProviderCaller(address common.Address, caller bind.ContractCaller) (*DataProviderCaller, error) {
|
||||
contract, err := bindDataProvider(address, caller, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DataProviderCaller{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewDataProviderTransactor creates a new write-only instance of DataProvider, bound to a specific deployed contract.
|
||||
func NewDataProviderTransactor(address common.Address, transactor bind.ContractTransactor) (*DataProviderTransactor, error) {
|
||||
contract, err := bindDataProvider(address, nil, transactor, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DataProviderTransactor{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewDataProviderFilterer creates a new log filterer instance of DataProvider, bound to a specific deployed contract.
|
||||
func NewDataProviderFilterer(address common.Address, filterer bind.ContractFilterer) (*DataProviderFilterer, error) {
|
||||
contract, err := bindDataProvider(address, nil, nil, filterer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &DataProviderFilterer{contract: contract}, nil
|
||||
}
|
||||
|
||||
// bindDataProvider binds a generic wrapper to an already deployed contract.
|
||||
func bindDataProvider(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
||||
parsed, err := abi.JSON(strings.NewReader(DataProviderABI))
|
||||
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 (_DataProvider *DataProviderRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _DataProvider.Contract.DataProviderCaller.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 (_DataProvider *DataProviderRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _DataProvider.Contract.DataProviderTransactor.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_DataProvider *DataProviderRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _DataProvider.Contract.DataProviderTransactor.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 (_DataProvider *DataProviderCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _DataProvider.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 (_DataProvider *DataProviderTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _DataProvider.Contract.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_DataProvider *DataProviderTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _DataProvider.Contract.contract.Transact(opts, method, params...)
|
||||
}
|
||||
|
||||
// GetReserveTokensAddresses is a free data retrieval call binding the contract method 0xd2493b6c.
|
||||
//
|
||||
// Solidity: function getReserveTokensAddresses(address asset) view returns(address aTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress)
|
||||
func (_DataProvider *DataProviderCaller) GetReserveTokensAddresses(opts *bind.CallOpts, asset common.Address) (struct {
|
||||
ATokenAddress common.Address
|
||||
StableDebtTokenAddress common.Address
|
||||
VariableDebtTokenAddress common.Address
|
||||
}, error) {
|
||||
var out []interface{}
|
||||
err := _DataProvider.contract.Call(opts, &out, "getReserveTokensAddresses", asset)
|
||||
|
||||
outstruct := new(struct {
|
||||
ATokenAddress common.Address
|
||||
StableDebtTokenAddress common.Address
|
||||
VariableDebtTokenAddress common.Address
|
||||
})
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
||||
outstruct.ATokenAddress = *abi.ConvertType(out[0], new(common.Address)).(*common.Address)
|
||||
outstruct.StableDebtTokenAddress = *abi.ConvertType(out[1], new(common.Address)).(*common.Address)
|
||||
outstruct.VariableDebtTokenAddress = *abi.ConvertType(out[2], new(common.Address)).(*common.Address)
|
||||
|
||||
return *outstruct, err
|
||||
|
||||
}
|
||||
|
||||
// GetReserveTokensAddresses is a free data retrieval call binding the contract method 0xd2493b6c.
|
||||
//
|
||||
// Solidity: function getReserveTokensAddresses(address asset) view returns(address aTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress)
|
||||
func (_DataProvider *DataProviderSession) GetReserveTokensAddresses(asset common.Address) (struct {
|
||||
ATokenAddress common.Address
|
||||
StableDebtTokenAddress common.Address
|
||||
VariableDebtTokenAddress common.Address
|
||||
}, error) {
|
||||
return _DataProvider.Contract.GetReserveTokensAddresses(&_DataProvider.CallOpts, asset)
|
||||
}
|
||||
|
||||
// GetReserveTokensAddresses is a free data retrieval call binding the contract method 0xd2493b6c.
|
||||
//
|
||||
// Solidity: function getReserveTokensAddresses(address asset) view returns(address aTokenAddress, address stableDebtTokenAddress, address variableDebtTokenAddress)
|
||||
func (_DataProvider *DataProviderCallerSession) GetReserveTokensAddresses(asset common.Address) (struct {
|
||||
ATokenAddress common.Address
|
||||
StableDebtTokenAddress common.Address
|
||||
VariableDebtTokenAddress common.Address
|
||||
}, error) {
|
||||
return _DataProvider.Contract.GetReserveTokensAddresses(&_DataProvider.CallOpts, asset)
|
||||
}
|
||||
|
||||
// GetUserReserveData is a free data retrieval call binding the contract method 0x28dd2d01.
|
||||
//
|
||||
// Solidity: function getUserReserveData(address asset, address user) view returns(uint256 currentATokenBalance, uint256 currentStableDebt, uint256 currentVariableDebt, uint256 principalStableDebt, uint256 scaledVariableDebt, uint256 stableBorrowRate, uint256 liquidityRate, uint40 stableRateLastUpdated, bool usageAsCollateralEnabled)
|
||||
func (_DataProvider *DataProviderCaller) GetUserReserveData(opts *bind.CallOpts, asset common.Address, user common.Address) (struct {
|
||||
CurrentATokenBalance *big.Int
|
||||
CurrentStableDebt *big.Int
|
||||
CurrentVariableDebt *big.Int
|
||||
PrincipalStableDebt *big.Int
|
||||
ScaledVariableDebt *big.Int
|
||||
StableBorrowRate *big.Int
|
||||
LiquidityRate *big.Int
|
||||
StableRateLastUpdated *big.Int
|
||||
UsageAsCollateralEnabled bool
|
||||
}, error) {
|
||||
var out []interface{}
|
||||
err := _DataProvider.contract.Call(opts, &out, "getUserReserveData", asset, user)
|
||||
|
||||
outstruct := new(struct {
|
||||
CurrentATokenBalance *big.Int
|
||||
CurrentStableDebt *big.Int
|
||||
CurrentVariableDebt *big.Int
|
||||
PrincipalStableDebt *big.Int
|
||||
ScaledVariableDebt *big.Int
|
||||
StableBorrowRate *big.Int
|
||||
LiquidityRate *big.Int
|
||||
StableRateLastUpdated *big.Int
|
||||
UsageAsCollateralEnabled bool
|
||||
})
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
||||
outstruct.CurrentATokenBalance = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
||||
outstruct.CurrentStableDebt = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
||||
outstruct.CurrentVariableDebt = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
|
||||
outstruct.PrincipalStableDebt = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int)
|
||||
outstruct.ScaledVariableDebt = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int)
|
||||
outstruct.StableBorrowRate = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int)
|
||||
outstruct.LiquidityRate = *abi.ConvertType(out[6], new(*big.Int)).(**big.Int)
|
||||
outstruct.StableRateLastUpdated = *abi.ConvertType(out[7], new(*big.Int)).(**big.Int)
|
||||
outstruct.UsageAsCollateralEnabled = *abi.ConvertType(out[8], new(bool)).(*bool)
|
||||
|
||||
return *outstruct, err
|
||||
|
||||
}
|
||||
|
||||
// GetUserReserveData is a free data retrieval call binding the contract method 0x28dd2d01.
|
||||
//
|
||||
// Solidity: function getUserReserveData(address asset, address user) view returns(uint256 currentATokenBalance, uint256 currentStableDebt, uint256 currentVariableDebt, uint256 principalStableDebt, uint256 scaledVariableDebt, uint256 stableBorrowRate, uint256 liquidityRate, uint40 stableRateLastUpdated, bool usageAsCollateralEnabled)
|
||||
func (_DataProvider *DataProviderSession) GetUserReserveData(asset common.Address, user common.Address) (struct {
|
||||
CurrentATokenBalance *big.Int
|
||||
CurrentStableDebt *big.Int
|
||||
CurrentVariableDebt *big.Int
|
||||
PrincipalStableDebt *big.Int
|
||||
ScaledVariableDebt *big.Int
|
||||
StableBorrowRate *big.Int
|
||||
LiquidityRate *big.Int
|
||||
StableRateLastUpdated *big.Int
|
||||
UsageAsCollateralEnabled bool
|
||||
}, error) {
|
||||
return _DataProvider.Contract.GetUserReserveData(&_DataProvider.CallOpts, asset, user)
|
||||
}
|
||||
|
||||
// GetUserReserveData is a free data retrieval call binding the contract method 0x28dd2d01.
|
||||
//
|
||||
// Solidity: function getUserReserveData(address asset, address user) view returns(uint256 currentATokenBalance, uint256 currentStableDebt, uint256 currentVariableDebt, uint256 principalStableDebt, uint256 scaledVariableDebt, uint256 stableBorrowRate, uint256 liquidityRate, uint40 stableRateLastUpdated, bool usageAsCollateralEnabled)
|
||||
func (_DataProvider *DataProviderCallerSession) GetUserReserveData(asset common.Address, user common.Address) (struct {
|
||||
CurrentATokenBalance *big.Int
|
||||
CurrentStableDebt *big.Int
|
||||
CurrentVariableDebt *big.Int
|
||||
PrincipalStableDebt *big.Int
|
||||
ScaledVariableDebt *big.Int
|
||||
StableBorrowRate *big.Int
|
||||
LiquidityRate *big.Int
|
||||
StableRateLastUpdated *big.Int
|
||||
UsageAsCollateralEnabled bool
|
||||
}, error) {
|
||||
return _DataProvider.Contract.GetUserReserveData(&_DataProvider.CallOpts, asset, user)
|
||||
}
|
232
aave/contracts/incentivescontroller.go
Normal file
232
aave/contracts/incentivescontroller.go
Normal file
@ -0,0 +1,232 @@
|
||||
// Code generated - DO NOT EDIT.
|
||||
// This file is a generated binding and any manual changes will be lost.
|
||||
|
||||
package contracts
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
// IncentivesControllerMetaData contains all meta data concerning the IncentivesController contract.
|
||||
var IncentivesControllerMetaData = &bind.MetaData{
|
||||
ABI: "[{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"claimRewards\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"assets\",\"type\":\"address[]\"},{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getRewardsBalance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]",
|
||||
}
|
||||
|
||||
// IncentivesControllerABI is the input ABI used to generate the binding from.
|
||||
// Deprecated: Use IncentivesControllerMetaData.ABI instead.
|
||||
var IncentivesControllerABI = IncentivesControllerMetaData.ABI
|
||||
|
||||
// IncentivesController is an auto generated Go binding around an Ethereum contract.
|
||||
type IncentivesController struct {
|
||||
IncentivesControllerCaller // Read-only binding to the contract
|
||||
IncentivesControllerTransactor // Write-only binding to the contract
|
||||
IncentivesControllerFilterer // Log filterer for contract events
|
||||
}
|
||||
|
||||
// IncentivesControllerCaller is an auto generated read-only Go binding around an Ethereum contract.
|
||||
type IncentivesControllerCaller struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// IncentivesControllerTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
||||
type IncentivesControllerTransactor struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// IncentivesControllerFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
||||
type IncentivesControllerFilterer struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// IncentivesControllerSession is an auto generated Go binding around an Ethereum contract,
|
||||
// with pre-set call and transact options.
|
||||
type IncentivesControllerSession struct {
|
||||
Contract *IncentivesController // 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
|
||||
}
|
||||
|
||||
// IncentivesControllerCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
||||
// with pre-set call options.
|
||||
type IncentivesControllerCallerSession struct {
|
||||
Contract *IncentivesControllerCaller // Generic contract caller binding to set the session for
|
||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||
}
|
||||
|
||||
// IncentivesControllerTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
||||
// with pre-set transact options.
|
||||
type IncentivesControllerTransactorSession struct {
|
||||
Contract *IncentivesControllerTransactor // Generic contract transactor binding to set the session for
|
||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||
}
|
||||
|
||||
// IncentivesControllerRaw is an auto generated low-level Go binding around an Ethereum contract.
|
||||
type IncentivesControllerRaw struct {
|
||||
Contract *IncentivesController // Generic contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// IncentivesControllerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
||||
type IncentivesControllerCallerRaw struct {
|
||||
Contract *IncentivesControllerCaller // Generic read-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// IncentivesControllerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
||||
type IncentivesControllerTransactorRaw struct {
|
||||
Contract *IncentivesControllerTransactor // Generic write-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// NewIncentivesController creates a new instance of IncentivesController, bound to a specific deployed contract.
|
||||
func NewIncentivesController(address common.Address, backend bind.ContractBackend) (*IncentivesController, error) {
|
||||
contract, err := bindIncentivesController(address, backend, backend, backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IncentivesController{IncentivesControllerCaller: IncentivesControllerCaller{contract: contract}, IncentivesControllerTransactor: IncentivesControllerTransactor{contract: contract}, IncentivesControllerFilterer: IncentivesControllerFilterer{contract: contract}}, nil
|
||||
}
|
||||
|
||||
// NewIncentivesControllerCaller creates a new read-only instance of IncentivesController, bound to a specific deployed contract.
|
||||
func NewIncentivesControllerCaller(address common.Address, caller bind.ContractCaller) (*IncentivesControllerCaller, error) {
|
||||
contract, err := bindIncentivesController(address, caller, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IncentivesControllerCaller{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewIncentivesControllerTransactor creates a new write-only instance of IncentivesController, bound to a specific deployed contract.
|
||||
func NewIncentivesControllerTransactor(address common.Address, transactor bind.ContractTransactor) (*IncentivesControllerTransactor, error) {
|
||||
contract, err := bindIncentivesController(address, nil, transactor, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IncentivesControllerTransactor{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewIncentivesControllerFilterer creates a new log filterer instance of IncentivesController, bound to a specific deployed contract.
|
||||
func NewIncentivesControllerFilterer(address common.Address, filterer bind.ContractFilterer) (*IncentivesControllerFilterer, error) {
|
||||
contract, err := bindIncentivesController(address, nil, nil, filterer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &IncentivesControllerFilterer{contract: contract}, nil
|
||||
}
|
||||
|
||||
// bindIncentivesController binds a generic wrapper to an already deployed contract.
|
||||
func bindIncentivesController(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
||||
parsed, err := abi.JSON(strings.NewReader(IncentivesControllerABI))
|
||||
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 (_IncentivesController *IncentivesControllerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _IncentivesController.Contract.IncentivesControllerCaller.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 (_IncentivesController *IncentivesControllerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.IncentivesControllerTransactor.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_IncentivesController *IncentivesControllerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.IncentivesControllerTransactor.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 (_IncentivesController *IncentivesControllerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _IncentivesController.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 (_IncentivesController *IncentivesControllerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_IncentivesController *IncentivesControllerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.contract.Transact(opts, method, params...)
|
||||
}
|
||||
|
||||
// GetRewardsBalance is a free data retrieval call binding the contract method 0x8b599f26.
|
||||
//
|
||||
// Solidity: function getRewardsBalance(address[] assets, address user) view returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerCaller) GetRewardsBalance(opts *bind.CallOpts, assets []common.Address, user common.Address) (*big.Int, error) {
|
||||
var out []interface{}
|
||||
err := _IncentivesController.contract.Call(opts, &out, "getRewardsBalance", assets, user)
|
||||
|
||||
if err != nil {
|
||||
return *new(*big.Int), err
|
||||
}
|
||||
|
||||
out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
||||
|
||||
return out0, err
|
||||
|
||||
}
|
||||
|
||||
// GetRewardsBalance is a free data retrieval call binding the contract method 0x8b599f26.
|
||||
//
|
||||
// Solidity: function getRewardsBalance(address[] assets, address user) view returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerSession) GetRewardsBalance(assets []common.Address, user common.Address) (*big.Int, error) {
|
||||
return _IncentivesController.Contract.GetRewardsBalance(&_IncentivesController.CallOpts, assets, user)
|
||||
}
|
||||
|
||||
// GetRewardsBalance is a free data retrieval call binding the contract method 0x8b599f26.
|
||||
//
|
||||
// Solidity: function getRewardsBalance(address[] assets, address user) view returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerCallerSession) GetRewardsBalance(assets []common.Address, user common.Address) (*big.Int, error) {
|
||||
return _IncentivesController.Contract.GetRewardsBalance(&_IncentivesController.CallOpts, assets, user)
|
||||
}
|
||||
|
||||
// ClaimRewards is a paid mutator transaction binding the contract method 0x3111e7b3.
|
||||
//
|
||||
// Solidity: function claimRewards(address[] assets, uint256 amount, address to) returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerTransactor) ClaimRewards(opts *bind.TransactOpts, assets []common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _IncentivesController.contract.Transact(opts, "claimRewards", assets, amount, to)
|
||||
}
|
||||
|
||||
// ClaimRewards is a paid mutator transaction binding the contract method 0x3111e7b3.
|
||||
//
|
||||
// Solidity: function claimRewards(address[] assets, uint256 amount, address to) returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerSession) ClaimRewards(assets []common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.ClaimRewards(&_IncentivesController.TransactOpts, assets, amount, to)
|
||||
}
|
||||
|
||||
// ClaimRewards is a paid mutator transaction binding the contract method 0x3111e7b3.
|
||||
//
|
||||
// Solidity: function claimRewards(address[] assets, uint256 amount, address to) returns(uint256)
|
||||
func (_IncentivesController *IncentivesControllerTransactorSession) ClaimRewards(assets []common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _IncentivesController.Contract.ClaimRewards(&_IncentivesController.TransactOpts, assets, amount, to)
|
||||
}
|
329
aave/contracts/lendingpool.go
Normal file
329
aave/contracts/lendingpool.go
Normal file
@ -0,0 +1,329 @@
|
||||
// Code generated - DO NOT EDIT.
|
||||
// This file is a generated binding and any manual changes will be lost.
|
||||
|
||||
package contracts
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
// LendingPoolMetaData contains all meta data concerning the LendingPool contract.
|
||||
var LendingPoolMetaData = &bind.MetaData{
|
||||
ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"interestRateMode\",\"type\":\"uint256\"},{\"internalType\":\"uint16\",\"name\":\"referralCode\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"onBehalfOf\",\"type\":\"address\"}],\"name\":\"borrow\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"onBehalfOf\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"referralCode\",\"type\":\"uint16\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"user\",\"type\":\"address\"}],\"name\":\"getUserAccountData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"totalCollateralETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"totalDebtETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"availableBorrowsETH\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"currentLiquidationThreshold\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ltv\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"healthFactor\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rateMode\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"onBehalfOf\",\"type\":\"address\"}],\"name\":\"repay\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"}],\"name\":\"withdraw\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]",
|
||||
}
|
||||
|
||||
// LendingPoolABI is the input ABI used to generate the binding from.
|
||||
// Deprecated: Use LendingPoolMetaData.ABI instead.
|
||||
var LendingPoolABI = LendingPoolMetaData.ABI
|
||||
|
||||
// LendingPool is an auto generated Go binding around an Ethereum contract.
|
||||
type LendingPool struct {
|
||||
LendingPoolCaller // Read-only binding to the contract
|
||||
LendingPoolTransactor // Write-only binding to the contract
|
||||
LendingPoolFilterer // Log filterer for contract events
|
||||
}
|
||||
|
||||
// LendingPoolCaller is an auto generated read-only Go binding around an Ethereum contract.
|
||||
type LendingPoolCaller struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// LendingPoolTransactor is an auto generated write-only Go binding around an Ethereum contract.
|
||||
type LendingPoolTransactor struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// LendingPoolFilterer is an auto generated log filtering Go binding around an Ethereum contract events.
|
||||
type LendingPoolFilterer struct {
|
||||
contract *bind.BoundContract // Generic contract wrapper for the low level calls
|
||||
}
|
||||
|
||||
// LendingPoolSession is an auto generated Go binding around an Ethereum contract,
|
||||
// with pre-set call and transact options.
|
||||
type LendingPoolSession struct {
|
||||
Contract *LendingPool // 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
|
||||
}
|
||||
|
||||
// LendingPoolCallerSession is an auto generated read-only Go binding around an Ethereum contract,
|
||||
// with pre-set call options.
|
||||
type LendingPoolCallerSession struct {
|
||||
Contract *LendingPoolCaller // Generic contract caller binding to set the session for
|
||||
CallOpts bind.CallOpts // Call options to use throughout this session
|
||||
}
|
||||
|
||||
// LendingPoolTransactorSession is an auto generated write-only Go binding around an Ethereum contract,
|
||||
// with pre-set transact options.
|
||||
type LendingPoolTransactorSession struct {
|
||||
Contract *LendingPoolTransactor // Generic contract transactor binding to set the session for
|
||||
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
|
||||
}
|
||||
|
||||
// LendingPoolRaw is an auto generated low-level Go binding around an Ethereum contract.
|
||||
type LendingPoolRaw struct {
|
||||
Contract *LendingPool // Generic contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// LendingPoolCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract.
|
||||
type LendingPoolCallerRaw struct {
|
||||
Contract *LendingPoolCaller // Generic read-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// LendingPoolTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract.
|
||||
type LendingPoolTransactorRaw struct {
|
||||
Contract *LendingPoolTransactor // Generic write-only contract binding to access the raw methods on
|
||||
}
|
||||
|
||||
// NewLendingPool creates a new instance of LendingPool, bound to a specific deployed contract.
|
||||
func NewLendingPool(address common.Address, backend bind.ContractBackend) (*LendingPool, error) {
|
||||
contract, err := bindLendingPool(address, backend, backend, backend)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &LendingPool{LendingPoolCaller: LendingPoolCaller{contract: contract}, LendingPoolTransactor: LendingPoolTransactor{contract: contract}, LendingPoolFilterer: LendingPoolFilterer{contract: contract}}, nil
|
||||
}
|
||||
|
||||
// NewLendingPoolCaller creates a new read-only instance of LendingPool, bound to a specific deployed contract.
|
||||
func NewLendingPoolCaller(address common.Address, caller bind.ContractCaller) (*LendingPoolCaller, error) {
|
||||
contract, err := bindLendingPool(address, caller, nil, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &LendingPoolCaller{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewLendingPoolTransactor creates a new write-only instance of LendingPool, bound to a specific deployed contract.
|
||||
func NewLendingPoolTransactor(address common.Address, transactor bind.ContractTransactor) (*LendingPoolTransactor, error) {
|
||||
contract, err := bindLendingPool(address, nil, transactor, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &LendingPoolTransactor{contract: contract}, nil
|
||||
}
|
||||
|
||||
// NewLendingPoolFilterer creates a new log filterer instance of LendingPool, bound to a specific deployed contract.
|
||||
func NewLendingPoolFilterer(address common.Address, filterer bind.ContractFilterer) (*LendingPoolFilterer, error) {
|
||||
contract, err := bindLendingPool(address, nil, nil, filterer)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &LendingPoolFilterer{contract: contract}, nil
|
||||
}
|
||||
|
||||
// bindLendingPool binds a generic wrapper to an already deployed contract.
|
||||
func bindLendingPool(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) {
|
||||
parsed, err := abi.JSON(strings.NewReader(LendingPoolABI))
|
||||
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 (_LendingPool *LendingPoolRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _LendingPool.Contract.LendingPoolCaller.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 (_LendingPool *LendingPoolRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.LendingPoolTransactor.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_LendingPool *LendingPoolRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.LendingPoolTransactor.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 (_LendingPool *LendingPoolCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error {
|
||||
return _LendingPool.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 (_LendingPool *LendingPoolTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.contract.Transfer(opts)
|
||||
}
|
||||
|
||||
// Transact invokes the (paid) contract method with params as input values.
|
||||
func (_LendingPool *LendingPoolTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.contract.Transact(opts, method, params...)
|
||||
}
|
||||
|
||||
// GetUserAccountData is a free data retrieval call binding the contract method 0xbf92857c.
|
||||
//
|
||||
// Solidity: function getUserAccountData(address user) view returns(uint256 totalCollateralETH, uint256 totalDebtETH, uint256 availableBorrowsETH, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)
|
||||
func (_LendingPool *LendingPoolCaller) GetUserAccountData(opts *bind.CallOpts, user common.Address) (struct {
|
||||
TotalCollateralETH *big.Int
|
||||
TotalDebtETH *big.Int
|
||||
AvailableBorrowsETH *big.Int
|
||||
CurrentLiquidationThreshold *big.Int
|
||||
Ltv *big.Int
|
||||
HealthFactor *big.Int
|
||||
}, error) {
|
||||
var out []interface{}
|
||||
err := _LendingPool.contract.Call(opts, &out, "getUserAccountData", user)
|
||||
|
||||
outstruct := new(struct {
|
||||
TotalCollateralETH *big.Int
|
||||
TotalDebtETH *big.Int
|
||||
AvailableBorrowsETH *big.Int
|
||||
CurrentLiquidationThreshold *big.Int
|
||||
Ltv *big.Int
|
||||
HealthFactor *big.Int
|
||||
})
|
||||
if err != nil {
|
||||
return *outstruct, err
|
||||
}
|
||||
|
||||
outstruct.TotalCollateralETH = *abi.ConvertType(out[0], new(*big.Int)).(**big.Int)
|
||||
outstruct.TotalDebtETH = *abi.ConvertType(out[1], new(*big.Int)).(**big.Int)
|
||||
outstruct.AvailableBorrowsETH = *abi.ConvertType(out[2], new(*big.Int)).(**big.Int)
|
||||
outstruct.CurrentLiquidationThreshold = *abi.ConvertType(out[3], new(*big.Int)).(**big.Int)
|
||||
outstruct.Ltv = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int)
|
||||
outstruct.HealthFactor = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int)
|
||||
|
||||
return *outstruct, err
|
||||
|
||||
}
|
||||
|
||||
// GetUserAccountData is a free data retrieval call binding the contract method 0xbf92857c.
|
||||
//
|
||||
// Solidity: function getUserAccountData(address user) view returns(uint256 totalCollateralETH, uint256 totalDebtETH, uint256 availableBorrowsETH, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)
|
||||
func (_LendingPool *LendingPoolSession) GetUserAccountData(user common.Address) (struct {
|
||||
TotalCollateralETH *big.Int
|
||||
TotalDebtETH *big.Int
|
||||
AvailableBorrowsETH *big.Int
|
||||
CurrentLiquidationThreshold *big.Int
|
||||
Ltv *big.Int
|
||||
HealthFactor *big.Int
|
||||
}, error) {
|
||||
return _LendingPool.Contract.GetUserAccountData(&_LendingPool.CallOpts, user)
|
||||
}
|
||||
|
||||
// GetUserAccountData is a free data retrieval call binding the contract method 0xbf92857c.
|
||||
//
|
||||
// Solidity: function getUserAccountData(address user) view returns(uint256 totalCollateralETH, uint256 totalDebtETH, uint256 availableBorrowsETH, uint256 currentLiquidationThreshold, uint256 ltv, uint256 healthFactor)
|
||||
func (_LendingPool *LendingPoolCallerSession) GetUserAccountData(user common.Address) (struct {
|
||||
TotalCollateralETH *big.Int
|
||||
TotalDebtETH *big.Int
|
||||
AvailableBorrowsETH *big.Int
|
||||
CurrentLiquidationThreshold *big.Int
|
||||
Ltv *big.Int
|
||||
HealthFactor *big.Int
|
||||
}, error) {
|
||||
return _LendingPool.Contract.GetUserAccountData(&_LendingPool.CallOpts, user)
|
||||
}
|
||||
|
||||
// Borrow is a paid mutator transaction binding the contract method 0xa415bcad.
|
||||
//
|
||||
// Solidity: function borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf) returns()
|
||||
func (_LendingPool *LendingPoolTransactor) Borrow(opts *bind.TransactOpts, asset common.Address, amount *big.Int, interestRateMode *big.Int, referralCode uint16, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.contract.Transact(opts, "borrow", asset, amount, interestRateMode, referralCode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Borrow is a paid mutator transaction binding the contract method 0xa415bcad.
|
||||
//
|
||||
// Solidity: function borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf) returns()
|
||||
func (_LendingPool *LendingPoolSession) Borrow(asset common.Address, amount *big.Int, interestRateMode *big.Int, referralCode uint16, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Borrow(&_LendingPool.TransactOpts, asset, amount, interestRateMode, referralCode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Borrow is a paid mutator transaction binding the contract method 0xa415bcad.
|
||||
//
|
||||
// Solidity: function borrow(address asset, uint256 amount, uint256 interestRateMode, uint16 referralCode, address onBehalfOf) returns()
|
||||
func (_LendingPool *LendingPoolTransactorSession) Borrow(asset common.Address, amount *big.Int, interestRateMode *big.Int, referralCode uint16, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Borrow(&_LendingPool.TransactOpts, asset, amount, interestRateMode, referralCode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Deposit is a paid mutator transaction binding the contract method 0xe8eda9df.
|
||||
//
|
||||
// Solidity: function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) returns()
|
||||
func (_LendingPool *LendingPoolTransactor) Deposit(opts *bind.TransactOpts, asset common.Address, amount *big.Int, onBehalfOf common.Address, referralCode uint16) (*types.Transaction, error) {
|
||||
return _LendingPool.contract.Transact(opts, "deposit", asset, amount, onBehalfOf, referralCode)
|
||||
}
|
||||
|
||||
// Deposit is a paid mutator transaction binding the contract method 0xe8eda9df.
|
||||
//
|
||||
// Solidity: function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) returns()
|
||||
func (_LendingPool *LendingPoolSession) Deposit(asset common.Address, amount *big.Int, onBehalfOf common.Address, referralCode uint16) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Deposit(&_LendingPool.TransactOpts, asset, amount, onBehalfOf, referralCode)
|
||||
}
|
||||
|
||||
// Deposit is a paid mutator transaction binding the contract method 0xe8eda9df.
|
||||
//
|
||||
// Solidity: function deposit(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) returns()
|
||||
func (_LendingPool *LendingPoolTransactorSession) Deposit(asset common.Address, amount *big.Int, onBehalfOf common.Address, referralCode uint16) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Deposit(&_LendingPool.TransactOpts, asset, amount, onBehalfOf, referralCode)
|
||||
}
|
||||
|
||||
// Repay is a paid mutator transaction binding the contract method 0x573ade81.
|
||||
//
|
||||
// Solidity: function repay(address asset, uint256 amount, uint256 rateMode, address onBehalfOf) returns(uint256)
|
||||
func (_LendingPool *LendingPoolTransactor) Repay(opts *bind.TransactOpts, asset common.Address, amount *big.Int, rateMode *big.Int, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.contract.Transact(opts, "repay", asset, amount, rateMode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Repay is a paid mutator transaction binding the contract method 0x573ade81.
|
||||
//
|
||||
// Solidity: function repay(address asset, uint256 amount, uint256 rateMode, address onBehalfOf) returns(uint256)
|
||||
func (_LendingPool *LendingPoolSession) Repay(asset common.Address, amount *big.Int, rateMode *big.Int, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Repay(&_LendingPool.TransactOpts, asset, amount, rateMode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Repay is a paid mutator transaction binding the contract method 0x573ade81.
|
||||
//
|
||||
// Solidity: function repay(address asset, uint256 amount, uint256 rateMode, address onBehalfOf) returns(uint256)
|
||||
func (_LendingPool *LendingPoolTransactorSession) Repay(asset common.Address, amount *big.Int, rateMode *big.Int, onBehalfOf common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Repay(&_LendingPool.TransactOpts, asset, amount, rateMode, onBehalfOf)
|
||||
}
|
||||
|
||||
// Withdraw is a paid mutator transaction binding the contract method 0x69328dec.
|
||||
//
|
||||
// Solidity: function withdraw(address asset, uint256 amount, address to) returns(uint256)
|
||||
func (_LendingPool *LendingPoolTransactor) Withdraw(opts *bind.TransactOpts, asset common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.contract.Transact(opts, "withdraw", asset, amount, to)
|
||||
}
|
||||
|
||||
// Withdraw is a paid mutator transaction binding the contract method 0x69328dec.
|
||||
//
|
||||
// Solidity: function withdraw(address asset, uint256 amount, address to) returns(uint256)
|
||||
func (_LendingPool *LendingPoolSession) Withdraw(asset common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Withdraw(&_LendingPool.TransactOpts, asset, amount, to)
|
||||
}
|
||||
|
||||
// Withdraw is a paid mutator transaction binding the contract method 0x69328dec.
|
||||
//
|
||||
// Solidity: function withdraw(address asset, uint256 amount, address to) returns(uint256)
|
||||
func (_LendingPool *LendingPoolTransactorSession) Withdraw(asset common.Address, amount *big.Int, to common.Address) (*types.Transaction, error) {
|
||||
return _LendingPool.Contract.Withdraw(&_LendingPool.TransactOpts, asset, amount, to)
|
||||
}
|
3341
curve/contracts/pool.go
Normal file
3341
curve/contracts/pool.go
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user