Updated LendingPool to add a method to retrieve debt tokens

This commit is contained in:
emilio 2020-07-09 16:27:19 +02:00
parent 77be1963d1
commit a3326fc86d
27 changed files with 261 additions and 174 deletions

View File

@ -734,7 +734,6 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable {
uint256 liquidationThreshold,
uint256 liquidationBonus,
address interestRateStrategyAddress,
address aTokenAddress,
bool usageAsCollateralEnabled,
bool borrowingEnabled,
bool stableBorrowRateEnabled,
@ -750,7 +749,6 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable {
reserve.liquidationThreshold,
reserve.liquidationBonus,
reserve.interestRateStrategyAddress,
reserve.aTokenAddress,
reserve.usageAsCollateralEnabled,
reserve.borrowingEnabled,
reserve.isStableBorrowRateEnabled,
@ -759,6 +757,22 @@ contract LendingPool is ReentrancyGuard, VersionedInitializable {
);
}
function getReserveTokensAddresses(address _reserve)
external
view
returns(
address aTokenAddress,
address stableDebtTokenAddress,
address variableDebtTokenAddress
){
ReserveLogic.ReserveData storage reserve = reserves[_reserve];
return (
reserve.aTokenAddress,
reserve.stableDebtTokenAddress,
reserve.variableDebtTokenAddress);
}
function getReserveData(address _reserve)
external
view

View File

@ -36,7 +36,7 @@ contract AaveProtocolTestHelpers {
address[] memory reserves = pool.getReserves();
TokenData[] memory aTokens = new TokenData[](reserves.length);
for (uint256 i = 0; i < reserves.length; i++) {
(,,,,,address aTokenAddress,,,,,) = pool.getReserveConfigurationData(reserves[i]);
(address aTokenAddress,,) = pool.getReserveTokensAddresses(reserves[i]);
aTokens[i] = TokenData({
symbol: AToken(aTokenAddress).symbol(),
tokenAddress: aTokenAddress

View File

@ -92,7 +92,7 @@ contract WalletBalanceProvider {
uint256[] memory balances = new uint256[](reserves.length);
for (uint256 j = 0; j < reserves.length; j++) {
(, , , , , , , , , bool isActive,) = pool.getReserveConfigurationData(reserves[j]);
(, , , , , , , , bool isActive,) = pool.getReserveConfigurationData(reserves[j]);
if (!isActive) {
balances[j] = 0;

View File

@ -102,7 +102,7 @@ const deployContract = async <ContractType extends Contract>(
return contract;
};
const getContract = async <ContractType extends Contract>(
export const getContract = async <ContractType extends Contract>(
contractName: string,
address: string
): Promise<ContractType> =>

View File

@ -262,7 +262,7 @@ const initReserves = async (
)
const variableDebtToken = await deployVariableDebtToken([
`Aave stable debt bearing ${assetSymbol}`,
`Aave variable debt bearing ${assetSymbol}`,
`stableDebt${assetSymbol}`,
reserveDecimals,
tokenAddress,

View File

@ -17,6 +17,7 @@ export const getReserveData = async (
): Promise<ReserveData> => {
const data: any = await pool.getReserveData(reserve);
const configuration: any = await pool.getReserveConfigurationData(reserve);
const tokenAddresses: any = await pool.getReserveTokensAddresses(reserve);
const rateOracle = await getLendingRateOracle();
const rate = (await rateOracle.getMarketBorrowRate(reserve)).toString();
@ -48,7 +49,7 @@ export const getReserveData = async (
variableBorrowIndex: new BigNumber(data.variableBorrowIndex),
lastUpdateTimestamp: new BigNumber(data.lastUpdateTimestamp),
address: reserve,
aTokenAddress: configuration.aTokenAddress,
aTokenAddress: tokenAddresses.aTokenAddress,
symbol,
decimals,
marketStableRate: new BigNumber(rate),
@ -126,7 +127,7 @@ const getATokenUserData = async (
user: string,
pool: LendingPool
) => {
const aTokenAddress: string = (await pool.getReserveConfigurationData(reserve)).aTokenAddress;
const aTokenAddress: string = (await pool.getReserveTokensAddresses(reserve)).aTokenAddress;
const aToken = await getAToken(aTokenAddress);
const [

28
test/stable-token.spec.ts Normal file
View File

@ -0,0 +1,28 @@
import {expect} from "chai";
import {makeSuite, TestEnv} from "./helpers/make-suite";
import {ProtocolErrors} from "../helpers/types";
makeSuite("AToken: Modifiers", (testEnv: TestEnv) => {
const {INVALID_POOL_CALLER_MSG_1} = ProtocolErrors;
it("Tries to invoke mintOnDeposit not being the LendingPool", async () => {
const {deployer, aDai} = testEnv;
await expect(aDai.mintOnDeposit(deployer.address, "1")).to.be.revertedWith(
INVALID_POOL_CALLER_MSG_1
);
});
it("Tries to invoke burnOnLiquidation not being the LendingPool", async () => {
const {deployer, aDai} = testEnv;
await expect(
aDai.burnOnLiquidation(deployer.address, "1")
).to.be.revertedWith(INVALID_POOL_CALLER_MSG_1);
});
it("Tries to invoke transferOnLiquidation not being the LendingPool", async () => {
const {deployer, users, aDai} = testEnv;
await expect(
aDai.transferOnLiquidation(deployer.address, users[0].address, "1")
).to.be.revertedWith(INVALID_POOL_CALLER_MSG_1);
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,12 +17,10 @@ interface DebtTokenBaseInterface extends Interface {
}>;
approve: TypedFunctionDescription<{
encode([spender, amount]: [string, BigNumberish]): string;
encode([spender, _amount]: [string, BigNumberish]): string;
}>;
balanceOf: TypedFunctionDescription<{
encode([account]: [string]): string;
}>;
balanceOf: TypedFunctionDescription<{ encode([_user]: [string]): string }>;
decimals: TypedFunctionDescription<{ encode([]: []): string }>;
@ -47,7 +45,7 @@ interface DebtTokenBaseInterface extends Interface {
name: TypedFunctionDescription<{ encode([]: []): string }>;
principalBalanceOf: TypedFunctionDescription<{
encode([account]: [string]): string;
encode([_user]: [string]): string;
}>;
symbol: TypedFunctionDescription<{ encode([]: []): string }>;
@ -55,11 +53,11 @@ interface DebtTokenBaseInterface extends Interface {
totalSupply: TypedFunctionDescription<{ encode([]: []): string }>;
transfer: TypedFunctionDescription<{
encode([recipient, amount]: [string, BigNumberish]): string;
encode([recipient, _amount]: [string, BigNumberish]): string;
}>;
transferFrom: TypedFunctionDescription<{
encode([sender, recipient, amount]: [
encode([sender, recipient, _amount]: [
string,
string,
BigNumberish
@ -111,11 +109,11 @@ export class DebtTokenBase extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
decimals(): Promise<number>;
@ -142,7 +140,7 @@ export class DebtTokenBase extends Contract {
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -150,14 +148,14 @@ export class DebtTokenBase extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -168,11 +166,11 @@ export class DebtTokenBase extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
decimals(): Promise<number>;
@ -199,7 +197,7 @@ export class DebtTokenBase extends Contract {
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -207,14 +205,14 @@ export class DebtTokenBase extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -233,9 +231,9 @@ export class DebtTokenBase extends Contract {
estimate: {
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(spender: string, amount: BigNumberish): Promise<BigNumber>;
approve(spender: string, _amount: BigNumberish): Promise<BigNumber>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
decimals(): Promise<BigNumber>;
@ -259,18 +257,18 @@ export class DebtTokenBase extends Contract {
name(): Promise<BigNumber>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<BigNumber>;
totalSupply(): Promise<BigNumber>;
transfer(recipient: string, amount: BigNumberish): Promise<BigNumber>;
transfer(recipient: string, _amount: BigNumberish): Promise<BigNumber>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish
_amount: BigNumberish
): Promise<BigNumber>;
underlyingAssetAddress(): Promise<BigNumber>;

View File

@ -99,7 +99,7 @@ const _abi = [
},
{
internalType: "uint256",
name: "amount",
name: "_amount",
type: "uint256"
}
],
@ -118,7 +118,7 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "account",
name: "_user",
type: "address"
}
],
@ -244,7 +244,7 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "account",
name: "_user",
type: "address"
}
],
@ -294,7 +294,7 @@ const _abi = [
},
{
internalType: "uint256",
name: "amount",
name: "_amount",
type: "uint256"
}
],
@ -323,7 +323,7 @@ const _abi = [
},
{
internalType: "uint256",
name: "amount",
name: "_amount",
type: "uint256"
}
],

File diff suppressed because one or more lines are too long

View File

@ -13,7 +13,7 @@ import {
interface IStableDebtTokenInterface extends Interface {
functions: {
burn: TypedFunctionDescription<{
encode([_account, _amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
getAverageStableRate: TypedFunctionDescription<{ encode([]: []): string }>;
@ -27,7 +27,7 @@ interface IStableDebtTokenInterface extends Interface {
}>;
mint: TypedFunctionDescription<{
encode([account, amount, rate]: [
encode([_user, _amount, _rate]: [
string,
BigNumberish,
BigNumberish
@ -56,7 +56,7 @@ export class IStableDebtToken extends Contract {
functions: {
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -68,15 +68,15 @@ export class IStableDebtToken extends Contract {
getUserStableRate(_user: string): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish,
_user: string,
_amount: BigNumberish,
_rate: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
};
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -88,16 +88,16 @@ export class IStableDebtToken extends Contract {
getUserStableRate(_user: string): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish,
_user: string,
_amount: BigNumberish,
_rate: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
filters: {};
estimate: {
burn(_account: string, _amount: BigNumberish): Promise<BigNumber>;
burn(_user: string, _amount: BigNumberish): Promise<BigNumber>;
getAverageStableRate(): Promise<BigNumber>;
@ -106,9 +106,9 @@ export class IStableDebtToken extends Contract {
getUserStableRate(_user: string): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish
_user: string,
_amount: BigNumberish,
_rate: BigNumberish
): Promise<BigNumber>;
};
}

View File

@ -20,7 +20,7 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "_account",
name: "_user",
type: "address"
},
{
@ -89,17 +89,17 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "account",
name: "_user",
type: "address"
},
{
internalType: "uint256",
name: "amount",
name: "_amount",
type: "uint256"
},
{
internalType: "uint256",
name: "rate",
name: "_rate",
type: "uint256"
}
],

View File

@ -13,15 +13,15 @@ import {
interface IVariableDebtTokenInterface extends Interface {
functions: {
burn: TypedFunctionDescription<{
encode([_account, _amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
getUserIndex: TypedFunctionDescription<{
encode([_account]: [string]): string;
encode([_user]: [string]): string;
}>;
mint: TypedFunctionDescription<{
encode([account, amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
};
@ -46,41 +46,41 @@ export class IVariableDebtToken extends Contract {
functions: {
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
getUserIndex(_account: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
};
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
getUserIndex(_account: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
filters: {};
estimate: {
burn(_account: string, _amount: BigNumberish): Promise<BigNumber>;
burn(_user: string, _amount: BigNumberish): Promise<BigNumber>;
getUserIndex(_account: string): Promise<BigNumber>;
getUserIndex(_user: string): Promise<BigNumber>;
mint(account: string, amount: BigNumberish): Promise<BigNumber>;
mint(_user: string, _amount: BigNumberish): Promise<BigNumber>;
};
}

View File

@ -20,7 +20,7 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "_account",
name: "_user",
type: "address"
},
{
@ -38,7 +38,7 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "_account",
name: "_user",
type: "address"
}
],
@ -57,12 +57,12 @@ const _abi = [
inputs: [
{
internalType: "address",
name: "account",
name: "_user",
type: "address"
},
{
internalType: "uint256",
name: "amount",
name: "_amount",
type: "uint256"
}
],

View File

@ -81,6 +81,10 @@ interface LendingPoolInterface extends Interface {
encode([_reserve]: [string]): string;
}>;
getReserveTokensAddresses: TypedFunctionDescription<{
encode([_reserve]: [string]): string;
}>;
getReserves: TypedFunctionDescription<{ encode([]: []): string }>;
getUserAccountData: TypedFunctionDescription<{
@ -390,7 +394,6 @@ export class LendingPool extends Contract {
liquidationThreshold: BigNumber;
liquidationBonus: BigNumber;
interestRateStrategyAddress: string;
aTokenAddress: string;
usageAsCollateralEnabled: boolean;
borrowingEnabled: boolean;
stableBorrowRateEnabled: boolean;
@ -401,12 +404,11 @@ export class LendingPool extends Contract {
2: BigNumber;
3: BigNumber;
4: string;
5: string;
5: boolean;
6: boolean;
7: boolean;
8: boolean;
9: boolean;
10: boolean;
}>;
getReserveData(
@ -438,6 +440,17 @@ export class LendingPool extends Contract {
getReserveNormalizedVariableDebt(_reserve: string): Promise<BigNumber>;
getReserveTokensAddresses(
_reserve: string
): Promise<{
aTokenAddress: string;
stableDebtTokenAddress: string;
variableDebtTokenAddress: string;
0: string;
1: string;
2: string;
}>;
getReserves(): Promise<string[]>;
getUserAccountData(
@ -657,7 +670,6 @@ export class LendingPool extends Contract {
liquidationThreshold: BigNumber;
liquidationBonus: BigNumber;
interestRateStrategyAddress: string;
aTokenAddress: string;
usageAsCollateralEnabled: boolean;
borrowingEnabled: boolean;
stableBorrowRateEnabled: boolean;
@ -668,12 +680,11 @@ export class LendingPool extends Contract {
2: BigNumber;
3: BigNumber;
4: string;
5: string;
5: boolean;
6: boolean;
7: boolean;
8: boolean;
9: boolean;
10: boolean;
}>;
getReserveData(
@ -705,6 +716,17 @@ export class LendingPool extends Contract {
getReserveNormalizedVariableDebt(_reserve: string): Promise<BigNumber>;
getReserveTokensAddresses(
_reserve: string
): Promise<{
aTokenAddress: string;
stableDebtTokenAddress: string;
variableDebtTokenAddress: string;
0: string;
1: string;
2: string;
}>;
getReserves(): Promise<string[]>;
getUserAccountData(
@ -1004,6 +1026,8 @@ export class LendingPool extends Contract {
getReserveNormalizedVariableDebt(_reserve: string): Promise<BigNumber>;
getReserveTokensAddresses(_reserve: string): Promise<BigNumber>;
getReserves(): Promise<BigNumber>;
getUserAccountData(_user: string): Promise<BigNumber>;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,7 +17,7 @@ interface StableDebtTokenInterface extends Interface {
}>;
approve: TypedFunctionDescription<{
encode([spender, amount]: [string, BigNumberish]): string;
encode([spender, _amount]: [string, BigNumberish]): string;
}>;
balanceOf: TypedFunctionDescription<{
@ -25,7 +25,7 @@ interface StableDebtTokenInterface extends Interface {
}>;
burn: TypedFunctionDescription<{
encode([_account, _amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
decimals: TypedFunctionDescription<{ encode([]: []): string }>;
@ -59,7 +59,7 @@ interface StableDebtTokenInterface extends Interface {
}>;
mint: TypedFunctionDescription<{
encode([account, amount, rate]: [
encode([_user, _amount, _rate]: [
string,
BigNumberish,
BigNumberish
@ -69,7 +69,7 @@ interface StableDebtTokenInterface extends Interface {
name: TypedFunctionDescription<{ encode([]: []): string }>;
principalBalanceOf: TypedFunctionDescription<{
encode([account]: [string]): string;
encode([_user]: [string]): string;
}>;
symbol: TypedFunctionDescription<{ encode([]: []): string }>;
@ -77,11 +77,11 @@ interface StableDebtTokenInterface extends Interface {
totalSupply: TypedFunctionDescription<{ encode([]: []): string }>;
transfer: TypedFunctionDescription<{
encode([recipient, amount]: [string, BigNumberish]): string;
encode([recipient, _amount]: [string, BigNumberish]): string;
}>;
transferFrom: TypedFunctionDescription<{
encode([sender, recipient, amount]: [
encode([sender, recipient, _amount]: [
string,
string,
BigNumberish
@ -154,14 +154,14 @@ export class StableDebtToken extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -196,15 +196,15 @@ export class StableDebtToken extends Contract {
): Promise<ContractTransaction>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish,
_user: string,
_amount: BigNumberish,
_rate: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -212,14 +212,14 @@ export class StableDebtToken extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -230,14 +230,14 @@ export class StableDebtToken extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
burn(
_account: string,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -272,15 +272,15 @@ export class StableDebtToken extends Contract {
): Promise<ContractTransaction>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish,
_user: string,
_amount: BigNumberish,
_rate: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -288,14 +288,14 @@ export class StableDebtToken extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -331,11 +331,11 @@ export class StableDebtToken extends Contract {
estimate: {
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(spender: string, amount: BigNumberish): Promise<BigNumber>;
approve(spender: string, _amount: BigNumberish): Promise<BigNumber>;
balanceOf(account: string): Promise<BigNumber>;
burn(_account: string, _amount: BigNumberish): Promise<BigNumber>;
burn(_user: string, _amount: BigNumberish): Promise<BigNumber>;
decimals(): Promise<BigNumber>;
@ -364,25 +364,25 @@ export class StableDebtToken extends Contract {
): Promise<BigNumber>;
mint(
account: string,
amount: BigNumberish,
rate: BigNumberish
_user: string,
_amount: BigNumberish,
_rate: BigNumberish
): Promise<BigNumber>;
name(): Promise<BigNumber>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<BigNumber>;
totalSupply(): Promise<BigNumber>;
transfer(recipient: string, amount: BigNumberish): Promise<BigNumber>;
transfer(recipient: string, _amount: BigNumberish): Promise<BigNumber>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish
_amount: BigNumberish
): Promise<BigNumber>;
underlyingAssetAddress(): Promise<BigNumber>;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,15 +17,13 @@ interface VariableDebtTokenInterface extends Interface {
}>;
approve: TypedFunctionDescription<{
encode([spender, amount]: [string, BigNumberish]): string;
encode([spender, _amount]: [string, BigNumberish]): string;
}>;
balanceOf: TypedFunctionDescription<{
encode([account]: [string]): string;
}>;
balanceOf: TypedFunctionDescription<{ encode([_user]: [string]): string }>;
burn: TypedFunctionDescription<{
encode([account, amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
decimals: TypedFunctionDescription<{ encode([]: []): string }>;
@ -53,13 +51,13 @@ interface VariableDebtTokenInterface extends Interface {
}>;
mint: TypedFunctionDescription<{
encode([account, amount]: [string, BigNumberish]): string;
encode([_user, _amount]: [string, BigNumberish]): string;
}>;
name: TypedFunctionDescription<{ encode([]: []): string }>;
principalBalanceOf: TypedFunctionDescription<{
encode([account]: [string]): string;
encode([_user]: [string]): string;
}>;
symbol: TypedFunctionDescription<{ encode([]: []): string }>;
@ -67,11 +65,11 @@ interface VariableDebtTokenInterface extends Interface {
totalSupply: TypedFunctionDescription<{ encode([]: []): string }>;
transfer: TypedFunctionDescription<{
encode([recipient, amount]: [string, BigNumberish]): string;
encode([recipient, _amount]: [string, BigNumberish]): string;
}>;
transferFrom: TypedFunctionDescription<{
encode([sender, recipient, amount]: [
encode([sender, recipient, _amount]: [
string,
string,
BigNumberish
@ -145,15 +143,15 @@ export class VariableDebtToken extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
burn(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -183,14 +181,14 @@ export class VariableDebtToken extends Contract {
): Promise<ContractTransaction>;
mint(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -198,14 +196,14 @@ export class VariableDebtToken extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -216,15 +214,15 @@ export class VariableDebtToken extends Contract {
approve(
spender: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
burn(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -254,14 +252,14 @@ export class VariableDebtToken extends Contract {
): Promise<ContractTransaction>;
mint(
account: string,
amount: BigNumberish,
_user: string,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
name(): Promise<string>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<string>;
@ -269,14 +267,14 @@ export class VariableDebtToken extends Contract {
transfer(
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish,
_amount: BigNumberish,
overrides?: TransactionOverrides
): Promise<ContractTransaction>;
@ -313,11 +311,11 @@ export class VariableDebtToken extends Contract {
estimate: {
allowance(owner: string, spender: string): Promise<BigNumber>;
approve(spender: string, amount: BigNumberish): Promise<BigNumber>;
approve(spender: string, _amount: BigNumberish): Promise<BigNumber>;
balanceOf(account: string): Promise<BigNumber>;
balanceOf(_user: string): Promise<BigNumber>;
burn(account: string, amount: BigNumberish): Promise<BigNumber>;
burn(_user: string, _amount: BigNumberish): Promise<BigNumber>;
decimals(): Promise<BigNumber>;
@ -341,22 +339,22 @@ export class VariableDebtToken extends Contract {
_addressesProvider: string
): Promise<BigNumber>;
mint(account: string, amount: BigNumberish): Promise<BigNumber>;
mint(_user: string, _amount: BigNumberish): Promise<BigNumber>;
name(): Promise<BigNumber>;
principalBalanceOf(account: string): Promise<BigNumber>;
principalBalanceOf(_user: string): Promise<BigNumber>;
symbol(): Promise<BigNumber>;
totalSupply(): Promise<BigNumber>;
transfer(recipient: string, amount: BigNumberish): Promise<BigNumber>;
transfer(recipient: string, _amount: BigNumberish): Promise<BigNumber>;
transferFrom(
sender: string,
recipient: string,
amount: BigNumberish
_amount: BigNumberish
): Promise<BigNumber>;
underlyingAssetAddress(): Promise<BigNumber>;

File diff suppressed because one or more lines are too long

View File

@ -134,4 +134,4 @@ const _abi = [
];
const _bytecode =
"0x608060405234801561001057600080fd5b5060405161099e38038061099e8339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610939806100656000396000f3fe6080604052600436106100385760003560e01c80639e3c930914610083578063b59b28ef1461014f578063f7888aec146102d35761007e565b3661007e5761004633610320565b61007c576040805162461bcd60e51b8152602060048201526002602482015261191960f11b604482015290519081900360640190fd5b005b600080fd5b34801561008f57600080fd5b506100b6600480360360208110156100a657600080fd5b50356001600160a01b031661035c565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100fa5781810151838201526020016100e2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610139578181015183820152602001610121565b5050505090500194505050505060405180910390f35b34801561015b57600080fd5b506102836004803603604081101561017257600080fd5b81019060208101813564010000000081111561018d57600080fd5b82018360208201111561019f57600080fd5b803590602001918460208302840111640100000000831117156101c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561021157600080fd5b82018360208201111561022357600080fd5b8035906020019184602083028401116401000000008311171561024557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106a9945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102bf5781810151838201526020016102a7565b505050509050019250505060405180910390f35b3480156102df57600080fd5b5061030e600480360360408110156102f657600080fd5b506001600160a01b0381358116916020013516610841565b60408051918252519081900360200190f35b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061035457508115155b949350505050565b60608060008060009054906101000a90046001600160a01b03166001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505160408051630240bc6b60e21b815290519192506060916001600160a01b03841691630902f1ac916004808301926000929190829003018186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561045d57600080fd5b810190808051604051939291908464010000000082111561047d57600080fd5b90830190602082018581111561049257600080fd5b82518660208202830111640100000000821117156104af57600080fd5b82525081516020918201928201910280838360005b838110156104dc5781810151838201526020016104c4565b5050505090500160405250505090506060815167ffffffffffffffff8111801561050557600080fd5b5060405190808252806020026020018201604052801561052f578160200160208202803683370190505b50905060005b825181101561069d576000846001600160a01b0316633e15014185848151811061055b57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b031681526020019150506101606040518083038186803b1580156105aa57600080fd5b505afa1580156105be573d6000803e3d6000fd5b505050506040513d6101608110156105d557600080fd5b5061012001519050806106025760008383815181106105f057fe5b60200260200101818152505050610695565b61060a6108eb565b6001600160a01b031684838151811061061f57fe5b60200260200101516001600160a01b03161461066f576106528885848151811061064557fe5b6020026020010151610841565b83838151811061065e57fe5b602002602001018181525050610693565b876001600160a01b03163183838151811061068657fe5b6020026020010181815250505b505b600101610535565b50909350915050915091565b606080825184510267ffffffffffffffff811180156106c757600080fd5b506040519080825280602002602001820160405280156106f1578160200160208202803683370190505b50905060005b84518110156108375760005b845181101561082e57845182026107186108eb565b6001600160a01b031686838151811061072d57fe5b60200260200101516001600160a01b031614156107815786838151811061075057fe5b60200260200101516001600160a01b031631848383018151811061077057fe5b602002602001018181525050610825565b6107a686838151811061079057fe5b60200260200101516001600160a01b0316610320565b6107e7576040805162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015290519081900360640190fd5b61080a8784815181106107f657fe5b602002602001015187848151811061064557fe5b848383018151811061081857fe5b6020026020010181815250505b50600101610703565b506001016106f7565b5090505b92915050565b6000610855826001600160a01b0316610320565b156108e357816001600160a01b03166370a08231846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d60208110156108da57600080fd5b5051905061083b565b50600061083b565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9056fea264697066735822122041746cd82168b52e9577569d6952ddaf28c3e9846edb4c6a8de831b0c507125764736f6c63430006080033";
"0x608060405234801561001057600080fd5b5060405161099e38038061099e8339818101604052602081101561003357600080fd5b5051600080546001600160a01b039092166001600160a01b0319909216919091179055610939806100656000396000f3fe6080604052600436106100385760003560e01c80639e3c930914610083578063b59b28ef1461014f578063f7888aec146102d35761007e565b3661007e5761004633610320565b61007c576040805162461bcd60e51b8152602060048201526002602482015261191960f11b604482015290519081900360640190fd5b005b600080fd5b34801561008f57600080fd5b506100b6600480360360208110156100a657600080fd5b50356001600160a01b031661035c565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156100fa5781810151838201526020016100e2565b50505050905001838103825284818151815260200191508051906020019060200280838360005b83811015610139578181015183820152602001610121565b5050505090500194505050505060405180910390f35b34801561015b57600080fd5b506102836004803603604081101561017257600080fd5b81019060208101813564010000000081111561018d57600080fd5b82018360208201111561019f57600080fd5b803590602001918460208302840111640100000000831117156101c157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561021157600080fd5b82018360208201111561022357600080fd5b8035906020019184602083028401116401000000008311171561024557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506106a9945050505050565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156102bf5781810151838201526020016102a7565b505050509050019250505060405180910390f35b3480156102df57600080fd5b5061030e600480360360408110156102f657600080fd5b506001600160a01b0381358116916020013516610841565b60408051918252519081900360200190f35b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061035457508115155b949350505050565b60608060008060009054906101000a90046001600160a01b03166001600160a01b0316630261bf8b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156103ae57600080fd5b505afa1580156103c2573d6000803e3d6000fd5b505050506040513d60208110156103d857600080fd5b505160408051630240bc6b60e21b815290519192506060916001600160a01b03841691630902f1ac916004808301926000929190829003018186803b15801561042057600080fd5b505afa158015610434573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561045d57600080fd5b810190808051604051939291908464010000000082111561047d57600080fd5b90830190602082018581111561049257600080fd5b82518660208202830111640100000000821117156104af57600080fd5b82525081516020918201928201910280838360005b838110156104dc5781810151838201526020016104c4565b5050505090500160405250505090506060815167ffffffffffffffff8111801561050557600080fd5b5060405190808252806020026020018201604052801561052f578160200160208202803683370190505b50905060005b825181101561069d576000846001600160a01b0316633e15014185848151811061055b57fe5b60200260200101516040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b031681526020019150506101406040518083038186803b1580156105aa57600080fd5b505afa1580156105be573d6000803e3d6000fd5b505050506040513d6101408110156105d557600080fd5b5061010001519050806106025760008383815181106105f057fe5b60200260200101818152505050610695565b61060a6108eb565b6001600160a01b031684838151811061061f57fe5b60200260200101516001600160a01b03161461066f576106528885848151811061064557fe5b6020026020010151610841565b83838151811061065e57fe5b602002602001018181525050610693565b876001600160a01b03163183838151811061068657fe5b6020026020010181815250505b505b600101610535565b50909350915050915091565b606080825184510267ffffffffffffffff811180156106c757600080fd5b506040519080825280602002602001820160405280156106f1578160200160208202803683370190505b50905060005b84518110156108375760005b845181101561082e57845182026107186108eb565b6001600160a01b031686838151811061072d57fe5b60200260200101516001600160a01b031614156107815786838151811061075057fe5b60200260200101516001600160a01b031631848383018151811061077057fe5b602002602001018181525050610825565b6107a686838151811061079057fe5b60200260200101516001600160a01b0316610320565b6107e7576040805162461bcd60e51b815260206004820152600d60248201526c24a72b20a624a22faa27a5a2a760991b604482015290519081900360640190fd5b61080a8784815181106107f657fe5b602002602001015187848151811061064557fe5b848383018151811061081857fe5b6020026020010181815250505b50600101610703565b506001016106f7565b5090505b92915050565b6000610855826001600160a01b0316610320565b156108e357816001600160a01b03166370a08231846040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156108b057600080fd5b505afa1580156108c4573d6000803e3d6000fd5b505050506040513d60208110156108da57600080fd5b5051905061083b565b50600061083b565b73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee9056fea2646970667358221220359beeff423b5bae02734ae0c074b86cb4607e9ccd1c6eba6a543a90099d912264736f6c63430006080033";