evm/aave/contracts/dataprovider.go

311 lines
16 KiB
Go
Raw Normal View History

2021-11-14 19:08:53 +00:00
// 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)
}