mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
354 lines
14 KiB
TypeScript
354 lines
14 KiB
TypeScript
|
/* Generated by ts-generator ver. 0.0.8 */
|
||
|
/* tslint:disable */
|
||
|
|
||
|
import { Contract, ContractFactory, Signer } from "ethers";
|
||
|
import { Provider } from "ethers/providers";
|
||
|
import { UnsignedTransaction } from "ethers/utils/transaction";
|
||
|
import { BigNumberish } from "ethers/utils";
|
||
|
|
||
|
import { TransactionOverrides } from ".";
|
||
|
import { DefaultReserveInterestRateStrategy } from "./DefaultReserveInterestRateStrategy";
|
||
|
|
||
|
export class DefaultReserveInterestRateStrategyFactory extends ContractFactory {
|
||
|
constructor(signer?: Signer) {
|
||
|
super(_abi, _bytecode, signer);
|
||
|
}
|
||
|
|
||
|
deploy(
|
||
|
_reserve: string,
|
||
|
_provider: string,
|
||
|
_baseVariableBorrowRate: BigNumberish,
|
||
|
_variableRateSlope1: BigNumberish,
|
||
|
_variableRateSlope2: BigNumberish,
|
||
|
_stableRateSlope1: BigNumberish,
|
||
|
_stableRateSlope2: BigNumberish,
|
||
|
overrides?: TransactionOverrides
|
||
|
): Promise<DefaultReserveInterestRateStrategy> {
|
||
|
return super.deploy(
|
||
|
_reserve,
|
||
|
_provider,
|
||
|
_baseVariableBorrowRate,
|
||
|
_variableRateSlope1,
|
||
|
_variableRateSlope2,
|
||
|
_stableRateSlope1,
|
||
|
_stableRateSlope2,
|
||
|
overrides
|
||
|
) as Promise<DefaultReserveInterestRateStrategy>;
|
||
|
}
|
||
|
getDeployTransaction(
|
||
|
_reserve: string,
|
||
|
_provider: string,
|
||
|
_baseVariableBorrowRate: BigNumberish,
|
||
|
_variableRateSlope1: BigNumberish,
|
||
|
_variableRateSlope2: BigNumberish,
|
||
|
_stableRateSlope1: BigNumberish,
|
||
|
_stableRateSlope2: BigNumberish,
|
||
|
overrides?: TransactionOverrides
|
||
|
): UnsignedTransaction {
|
||
|
return super.getDeployTransaction(
|
||
|
_reserve,
|
||
|
_provider,
|
||
|
_baseVariableBorrowRate,
|
||
|
_variableRateSlope1,
|
||
|
_variableRateSlope2,
|
||
|
_stableRateSlope1,
|
||
|
_stableRateSlope2,
|
||
|
overrides
|
||
|
);
|
||
|
}
|
||
|
attach(address: string): DefaultReserveInterestRateStrategy {
|
||
|
return super.attach(address) as DefaultReserveInterestRateStrategy;
|
||
|
}
|
||
|
connect(signer: Signer): DefaultReserveInterestRateStrategyFactory {
|
||
|
return super.connect(signer) as DefaultReserveInterestRateStrategyFactory;
|
||
|
}
|
||
|
static connect(
|
||
|
address: string,
|
||
|
signerOrProvider: Signer | Provider
|
||
|
): DefaultReserveInterestRateStrategy {
|
||
|
return new Contract(
|
||
|
address,
|
||
|
_abi,
|
||
|
signerOrProvider
|
||
|
) as DefaultReserveInterestRateStrategy;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
const _abi = [
|
||
|
{
|
||
|
inputs: [
|
||
|
{
|
||
|
internalType: "address",
|
||
|
name: "_reserve",
|
||
|
type: "address"
|
||
|
},
|
||
|
{
|
||
|
internalType: "contract LendingPoolAddressesProvider",
|
||
|
name: "_provider",
|
||
|
type: "address"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_baseVariableBorrowRate",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_variableRateSlope1",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_variableRateSlope2",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_stableRateSlope1",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_stableRateSlope2",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "nonpayable",
|
||
|
type: "constructor"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "EXCESS_UTILIZATION_RATE",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "OPTIMAL_UTILIZATION_RATE",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "addressesProvider",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "contract LendingPoolAddressesProvider",
|
||
|
name: "",
|
||
|
type: "address"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "baseVariableBorrowRate",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [
|
||
|
{
|
||
|
internalType: "address",
|
||
|
name: "_reserve",
|
||
|
type: "address"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_availableLiquidity",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_totalBorrowsStable",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_totalBorrowsVariable",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "_averageStableBorrowRate",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
name: "calculateInterestRates",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "currentLiquidityRate",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "currentStableBorrowRate",
|
||
|
type: "uint256"
|
||
|
},
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "currentVariableBorrowRate",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "getBaseVariableBorrowRate",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "getStableRateSlope1",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "getStableRateSlope2",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "getVariableRateSlope1",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "getVariableRateSlope2",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "reserve",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "address",
|
||
|
name: "",
|
||
|
type: "address"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "stableRateSlope1",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "stableRateSlope2",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "variableRateSlope1",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
},
|
||
|
{
|
||
|
inputs: [],
|
||
|
name: "variableRateSlope2",
|
||
|
outputs: [
|
||
|
{
|
||
|
internalType: "uint256",
|
||
|
name: "",
|
||
|
type: "uint256"
|
||
|
}
|
||
|
],
|
||
|
stateMutability: "view",
|
||
|
type: "function"
|
||
|
}
|
||
|
];
|
||
|
|
||
|
const _bytecode =
|
||
|
"0x608060405234801561001057600080fd5b50604051610dce380380610dce833981810160405260e081101561003357600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050856000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550846001819055508360028190555082600381905550816004819055508060058190555086600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050505050610c948061013a6000396000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c80637b832f5811610097578063ccab01a311610066578063ccab01a3146102e0578063cd3293de146102fe578063d5cd739114610348578063f420240914610366576100f5565b80637b832f581461023c578063a15f30ac1461025a578063b258954414610278578063c72c4d1014610296576100f5565b806317319873116100d3578063173198731461015457806334762ca51461017257806357e37af01461019057806365614f811461021e576100f5565b80630b3429a2146100fa5780630bdf953f1461011857806314e32da414610136575b600080fd5b610102610384565b6040518082815260200191505060405180910390f35b61012061038e565b6040518082815260200191505060405180910390f35b61013e610394565b6040518082815260200191505060405180910390f35b61015c61039e565b6040518082815260200191505060405180910390f35b61017a6103ad565b6040518082815260200191505060405180910390f35b6101fa600480360360a08110156101a657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506103b7565b60405180848152602001838152602001828152602001935050505060405180910390f35b610226610705565b6040518082815260200191505060405180910390f35b61024461070b565b6040518082815260200191505060405180910390f35b610262610711565b6040518082815260200191505060405180910390f35b610280610721565b6040518082815260200191505060405180910390f35b61029e610727565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102e861074c565b6040518082815260200191505060405180910390f35b610306610752565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610350610778565b6040518082815260200191505060405180910390f35b61036e610782565b6040518082815260200191505060405180910390f35b6000600254905090565b60045481565b6000600554905090565b6aa56fa5b99019a5c800000081565b6000600154905090565b6000806000806103d0868861078c90919063ffffffff16565b9050600080821480156103e35750600089145b6104115761040c6103fd838b61078c90919063ffffffff16565b8361081490919063ffffffff16565b610414565b60005b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633618abba6040518163ffffffff1660e01b815260040160206040518083038186803b15801561047d57600080fd5b505afa158015610491573d6000803e3d6000fd5b505050506040513d60208110156104a757600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663bb85c0bb8b6040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561053457600080fd5b505afa158015610548573d6000803e3d6000fd5b505050506040513d602081101561055e57600080fd5b810190808051906020019092919050505093506b0295be96e6406697200000008111156106475760006105c36aa56fa5b99019a5c80000006105b56b0295be96e6406697200000008561087090919063ffffffff16565b61081490919063ffffffff16565b90506106006105dd826005546108ba90919063ffffffff16565b6105f26004548861078c90919063ffffffff16565b61078c90919063ffffffff16565b945061063f61061a826003546108ba90919063ffffffff16565b61063160025460015461078c90919063ffffffff16565b61078c90919063ffffffff16565b9350506106d8565b61068c61067d61066c6b0295be96e6406697200000008461081490919063ffffffff16565b6004546108ba90919063ffffffff16565b8561078c90919063ffffffff16565b93506106d56106c46002546106b66b0295be96e6406697200000008561081490919063ffffffff16565b6108ba90919063ffffffff16
|