mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Updated migration scripts
This commit is contained in:
parent
3f5822f5f6
commit
d5f0e9ebf9
|
@ -11,6 +11,7 @@ import {
|
|||
} from '../lendingpool/DefaultReserveInterestRateStrategy.sol';
|
||||
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
|
||||
import {StringLib} from '../libraries/helpers/StringLib.sol';
|
||||
import "hardhat/console.sol";
|
||||
|
||||
contract ATokensAndRatesHelper is Ownable {
|
||||
address payable private pool;
|
||||
|
@ -31,9 +32,10 @@ contract ATokensAndRatesHelper is Ownable {
|
|||
function initDeployment(
|
||||
address[] calldata tokens,
|
||||
string[] calldata symbols,
|
||||
uint256[][6] calldata rates,
|
||||
uint256[6][] calldata rates,
|
||||
address incentivesController
|
||||
) external onlyOwner {
|
||||
|
||||
require(tokens.length == symbols.length, 't Arrays not same length');
|
||||
require(rates.length == symbols.length, 'r Arrays not same length');
|
||||
for (uint256 i = 0; i < tokens.length; i++) {
|
||||
|
|
|
@ -8,6 +8,7 @@ import {
|
|||
} from './contracts-getters';
|
||||
import { rawInsertContractAddressInDb } from './contracts-helpers';
|
||||
import { BigNumberish } from 'ethers';
|
||||
import BigNumber from 'bignumber.js';
|
||||
|
||||
export const initReservesByHelper = async (
|
||||
reservesParams: iMultiPoolsAssets<IReserveParams>,
|
||||
|
@ -54,6 +55,7 @@ export const initReservesByHelper = async (
|
|||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish,
|
||||
BigNumberish
|
||||
][] = [];
|
||||
const reservesDecimals: string[] = [];
|
||||
|
@ -72,6 +74,7 @@ export const initReservesByHelper = async (
|
|||
const [
|
||||
,
|
||||
{
|
||||
optimalUtilizationRate,
|
||||
baseVariableBorrowRate,
|
||||
variableRateSlope1,
|
||||
variableRateSlope2,
|
||||
|
@ -83,6 +86,7 @@ export const initReservesByHelper = async (
|
|||
tokens.push(tokenAddress);
|
||||
symbols.push(assetSymbol);
|
||||
strategyRates.push([
|
||||
optimalUtilizationRate,
|
||||
baseVariableBorrowRate,
|
||||
variableRateSlope1,
|
||||
variableRateSlope2,
|
||||
|
|
|
@ -263,6 +263,7 @@ export enum TokenContractId {
|
|||
export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {}
|
||||
|
||||
export interface IReserveBorrowParams {
|
||||
optimalUtilizationRate: string;
|
||||
baseVariableBorrowRate: string;
|
||||
variableRateSlope1: string;
|
||||
variableRateSlope2: string;
|
||||
|
|
|
@ -3,6 +3,7 @@ import {oneRay} from '../../helpers/constants';
|
|||
import {IReserveParams} from '../../helpers/types';
|
||||
|
||||
export const strategyBase: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
|
||||
|
@ -17,6 +18,7 @@ export const strategyBase: IReserveParams = {
|
|||
};
|
||||
|
||||
export const stablecoinStrategyBase: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
|
||||
|
@ -31,6 +33,7 @@ export const stablecoinStrategyBase: IReserveParams = {
|
|||
};
|
||||
|
||||
export const stablecoinStrategyCentralized: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
|
||||
|
@ -117,6 +120,7 @@ export const strategyREN: IReserveParams = {
|
|||
};
|
||||
|
||||
export const stablecoinStrategySUSD: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||
|
@ -174,6 +178,7 @@ export const stablecoinStrategyUSDT: IReserveParams = {
|
|||
};
|
||||
|
||||
export const strategyWBTC: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
|
||||
|
@ -188,6 +193,7 @@ export const strategyWBTC: IReserveParams = {
|
|||
};
|
||||
|
||||
export const strategyWETH: IReserveParams = {
|
||||
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
|
||||
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
|
||||
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
|
||||
|
|
Loading…
Reference in New Issue
Block a user