mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'master' into feat/uniswap-adapter-flashloan
This commit is contained in:
commit
37a2f14fca
|
@ -25,7 +25,7 @@ import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol';
|
|||
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol';
|
||||
import {ILendingPool} from '../interfaces/ILendingPool.sol';
|
||||
import {LendingPoolStorage} from './LendingPoolStorage.sol';
|
||||
import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol';
|
||||
import {Address} from '../dependencies/openzeppelin/contracts/Address.sol';
|
||||
|
||||
/**
|
||||
* @title LendingPool contract
|
||||
|
@ -39,13 +39,27 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
using SafeERC20 for IERC20;
|
||||
|
||||
//main configuration parameters
|
||||
uint256 public constant REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD = 4000;
|
||||
uint256 public constant REBALANCE_UP_USAGE_RATIO_THRESHOLD = 0.95 * 1e27; //usage ratio of 95%
|
||||
uint256 public constant MAX_STABLE_RATE_BORROW_SIZE_PERCENT = 2500;
|
||||
uint256 public constant FLASHLOAN_PREMIUM_TOTAL = 9;
|
||||
uint256 public constant MAX_NUMBER_RESERVES = 128;
|
||||
uint256 public constant LENDINGPOOL_REVISION = 0x2;
|
||||
|
||||
/**
|
||||
* @dev functions marked by this modifier can only be called when the protocol is not paused
|
||||
**/
|
||||
modifier whenNotPaused() {
|
||||
_whenNotPaused();
|
||||
_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev functions marked by this modifier can only be called by the LendingPoolConfigurator
|
||||
**/
|
||||
modifier onlyLendingPoolConfigurator() {
|
||||
_onlyLendingPoolConfigurator();
|
||||
_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev only lending pools configurator can use functions affected by this modifier
|
||||
**/
|
||||
|
@ -92,8 +106,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
uint256 amount,
|
||||
address onBehalfOf,
|
||||
uint16 referralCode
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
ValidationLogic.validateDeposit(reserve, amount);
|
||||
|
@ -126,8 +139,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
address asset,
|
||||
uint256 amount,
|
||||
address to
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
address aToken = reserve.aTokenAddress;
|
||||
|
@ -181,8 +193,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
uint256 interestRateMode,
|
||||
uint16 referralCode,
|
||||
address onBehalfOf
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
_executeBorrow(
|
||||
|
@ -212,9 +223,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
uint256 amount,
|
||||
uint256 rateMode,
|
||||
address onBehalfOf
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
|
||||
) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
(uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebt(onBehalfOf, reserve);
|
||||
|
@ -269,8 +278,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
* @param asset the address of the reserve on which the user borrowed
|
||||
* @param rateMode the rate mode that the user wants to swap
|
||||
**/
|
||||
function swapBorrowRateMode(address asset, uint256 rateMode) external override {
|
||||
_whenNotPaused();
|
||||
function swapBorrowRateMode(address asset, uint256 rateMode) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
(uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebt(msg.sender, reserve);
|
||||
|
@ -324,51 +332,30 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
* @param asset the address of the reserve
|
||||
* @param user the address of the user to be rebalanced
|
||||
**/
|
||||
function rebalanceStableBorrowRate(address asset, address user) external override {
|
||||
_whenNotPaused();
|
||||
|
||||
function rebalanceStableBorrowRate(address asset, address user) external override whenNotPaused {
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
IERC20 stableDebtToken = IERC20(reserve.stableDebtTokenAddress);
|
||||
IERC20 variableDebtToken = IERC20(reserve.variableDebtTokenAddress);
|
||||
address aTokenAddress = reserve.aTokenAddress;
|
||||
|
||||
uint256 stableBorrowBalance = IERC20(stableDebtToken).balanceOf(user);
|
||||
uint256 stableDebt = IERC20(stableDebtToken).balanceOf(user);
|
||||
|
||||
//if the usage ratio is below 95%, no rebalances are needed
|
||||
uint256 totalBorrows = stableDebtToken
|
||||
.totalSupply()
|
||||
.add(variableDebtToken.totalSupply())
|
||||
.wadToRay();
|
||||
uint256 availableLiquidity = IERC20(asset).balanceOf(aTokenAddress).wadToRay();
|
||||
uint256 usageRatio = totalBorrows == 0
|
||||
? 0
|
||||
: totalBorrows.rayDiv(availableLiquidity.add(totalBorrows));
|
||||
|
||||
//if the liquidity rate is below REBALANCE_UP_THRESHOLD of the max variable APR at 95% usage,
|
||||
//then we allow rebalancing of the stable rate positions.
|
||||
|
||||
uint256 currentLiquidityRate = reserve.currentLiquidityRate;
|
||||
uint256 maxVariableBorrowRate = IReserveInterestRateStrategy(
|
||||
reserve
|
||||
.interestRateStrategyAddress
|
||||
)
|
||||
.getMaxVariableBorrowRate();
|
||||
|
||||
require(
|
||||
usageRatio >= REBALANCE_UP_USAGE_RATIO_THRESHOLD &&
|
||||
currentLiquidityRate <=
|
||||
maxVariableBorrowRate.percentMul(REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD),
|
||||
Errors.LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET
|
||||
ValidationLogic.validateRebalanceStableBorrowRate(
|
||||
reserve,
|
||||
asset,
|
||||
stableDebtToken,
|
||||
variableDebtToken,
|
||||
aTokenAddress
|
||||
);
|
||||
|
||||
reserve.updateState();
|
||||
|
||||
IStableDebtToken(address(stableDebtToken)).burn(user, stableBorrowBalance);
|
||||
IStableDebtToken(address(stableDebtToken)).burn(user, stableDebt);
|
||||
IStableDebtToken(address(stableDebtToken)).mint(
|
||||
user,
|
||||
user,
|
||||
stableBorrowBalance,
|
||||
stableDebt,
|
||||
reserve.currentStableBorrowRate
|
||||
);
|
||||
|
||||
|
@ -382,8 +369,11 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
* @param asset the address of the reserve
|
||||
* @param useAsCollateral true if the user wants to use the deposit as collateral, false otherwise.
|
||||
**/
|
||||
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external override {
|
||||
_whenNotPaused();
|
||||
function setUserUseReserveAsCollateral(address asset, bool useAsCollateral)
|
||||
external
|
||||
override
|
||||
whenNotPaused
|
||||
{
|
||||
ReserveLogic.ReserveData storage reserve = _reserves[asset];
|
||||
|
||||
ValidationLogic.validateSetUseReserveAsCollateral(
|
||||
|
@ -421,8 +411,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
address user,
|
||||
uint256 purchaseAmount,
|
||||
bool receiveAToken
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
) external override whenNotPaused {
|
||||
address collateralManager = _addressesProvider.getLendingPoolCollateralManager();
|
||||
|
||||
//solium-disable-next-line
|
||||
|
@ -478,9 +467,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
address onBehalfOf,
|
||||
bytes calldata params,
|
||||
uint16 referralCode
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
|
||||
) external override whenNotPaused {
|
||||
FlashLoanLocalVars memory vars;
|
||||
|
||||
ValidationLogic.validateFlashloan(assets, amounts);
|
||||
|
@ -715,9 +702,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
uint256 amount,
|
||||
uint256 balanceFromBefore,
|
||||
uint256 balanceToBefore
|
||||
) external override {
|
||||
_whenNotPaused();
|
||||
|
||||
) external override whenNotPaused {
|
||||
require(msg.sender == _reserves[asset].aTokenAddress, Errors.LP_CALLER_MUST_BE_AN_ATOKEN);
|
||||
|
||||
ValidationLogic.validateTransfer(
|
||||
|
@ -765,8 +750,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
address stableDebtAddress,
|
||||
address variableDebtAddress,
|
||||
address interestRateStrategyAddress
|
||||
) external override {
|
||||
_onlyLendingPoolConfigurator();
|
||||
) external override onlyLendingPoolConfigurator {
|
||||
require(Address.isContract(asset), Errors.LP_NOT_CONTRACT);
|
||||
_reserves[asset].init(
|
||||
aTokenAddress,
|
||||
stableDebtAddress,
|
||||
|
@ -784,8 +769,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
_onlyLendingPoolConfigurator();
|
||||
_reserves[asset].interestRateStrategyAddress = rateStrategyAddress;
|
||||
}
|
||||
|
||||
|
@ -794,8 +779,11 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
* @param asset the address of the reserve
|
||||
* @param configuration the configuration map
|
||||
**/
|
||||
function setConfiguration(address asset, uint256 configuration) external override {
|
||||
_onlyLendingPoolConfigurator();
|
||||
function setConfiguration(address asset, uint256 configuration)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
_reserves[asset].configuration.data = configuration;
|
||||
}
|
||||
|
||||
|
@ -803,9 +791,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
* @dev Set the _pause state
|
||||
* @param val the boolean value to set the current pause state of LendingPool
|
||||
*/
|
||||
function setPause(bool val) external override {
|
||||
_onlyLendingPoolConfigurator();
|
||||
|
||||
function setPause(bool val) external override onlyLendingPoolConfigurator {
|
||||
_paused = val;
|
||||
if (_paused) {
|
||||
emit Paused();
|
||||
|
@ -923,7 +909,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
|
|||
_reserves[asset].id = uint8(reservesCount);
|
||||
_reservesList[reservesCount] = asset;
|
||||
|
||||
_reservesCount++;
|
||||
_reservesCount = reservesCount + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,6 +57,13 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
|
|||
bool receiveAToken
|
||||
);
|
||||
|
||||
/**
|
||||
* @dev emitted when a user disables a reserve as collateral
|
||||
* @param reserve the address of the reserve
|
||||
* @param user the address of the user
|
||||
**/
|
||||
event ReserveUsedAsCollateralDisabled(address indexed reserve, address indexed user);
|
||||
|
||||
struct LiquidationCallLocalVars {
|
||||
uint256 userCollateralBalance;
|
||||
uint256 userStableDebt;
|
||||
|
@ -120,7 +127,7 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
|
|||
(, , , , vars.healthFactor) = GenericLogic.calculateUserAccountData(
|
||||
user,
|
||||
_reserves,
|
||||
_usersConfig[user],
|
||||
userConfig,
|
||||
_reservesList,
|
||||
_reservesCount,
|
||||
_addressesProvider.getPriceOracle()
|
||||
|
@ -246,6 +253,14 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
|
|||
);
|
||||
}
|
||||
|
||||
//if the collateral being liquidated is equal to the user balance,
|
||||
//we set the currency as not being used as collateral anymore
|
||||
|
||||
if (vars.maxCollateralToLiquidate == vars.userCollateralBalance) {
|
||||
userConfig.setUsingAsCollateral(collateralReserve.id, false);
|
||||
emit ReserveUsedAsCollateralDisabled(collateral, user);
|
||||
}
|
||||
|
||||
//transfers the principal currency to the aToken
|
||||
IERC20(principal).safeTransferFrom(
|
||||
msg.sender,
|
||||
|
|
|
@ -365,11 +365,13 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev configures the reserve collateralization parameters
|
||||
* @dev configures the reserve collateralization parameters.
|
||||
* all the values are expressed in percentages with two decimals of precision. A valid value is 10000, which means 100.00%
|
||||
* @param asset the address of the reserve
|
||||
* @param ltv the loan to value of the asset when used as collateral
|
||||
* @param liquidationThreshold the threshold at which loans using this asset as collateral will be considered undercollateralized
|
||||
* @param liquidationBonus the bonus liquidators receive to liquidate this asset
|
||||
* @param liquidationBonus the bonus liquidators receive to liquidate this asset. The values is always above 100%. A value of 105%
|
||||
* means the liquidator will receive a 5% bonus
|
||||
**/
|
||||
function configureReserveAsCollateral(
|
||||
address asset,
|
||||
|
@ -386,11 +388,14 @@ contract LendingPoolConfigurator is VersionedInitializable {
|
|||
|
||||
if (liquidationThreshold != 0) {
|
||||
//liquidation bonus must be bigger than 100.00%, otherwise the liquidator would receive less
|
||||
//collateral than needed to cover the debt
|
||||
require(
|
||||
liquidationBonus > PercentageMath.PERCENTAGE_FACTOR,
|
||||
Errors.LPC_INVALID_CONFIGURATION
|
||||
);
|
||||
//collateral than needed to cover the debt.
|
||||
uint256 absoluteBonus = liquidationBonus.sub(PercentageMath.PERCENTAGE_FACTOR, Errors.LPC_INVALID_CONFIGURATION);
|
||||
require(absoluteBonus > 0, Errors.LPC_INVALID_CONFIGURATION);
|
||||
|
||||
//we also need to require that the liq threshold is lower or equal than the liquidation bonus, to ensure that
|
||||
//there is always enough margin for liquidators to receive the bonus.
|
||||
require(liquidationThreshold.add(absoluteBonus) <= PercentageMath.PERCENTAGE_FACTOR, Errors.LPC_INVALID_CONFIGURATION);
|
||||
|
||||
} else {
|
||||
require(liquidationBonus == 0, Errors.LPC_INVALID_CONFIGURATION);
|
||||
//if the liquidation threshold is being set to 0,
|
||||
|
|
|
@ -86,7 +86,7 @@ library ReserveConfiguration {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev gets the Loan to Value of the reserve
|
||||
* @dev gets the liquidation threshold of the reserve
|
||||
* @param self the reserve configuration
|
||||
* @return the liquidation threshold
|
||||
**/
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: agpl-3.0
|
||||
pragma solidity ^0.6.8;
|
||||
|
||||
import {Errors} from '../helpers/Errors.sol';
|
||||
/**
|
||||
* @title UserConfiguration library
|
||||
* @author Aave
|
||||
|
@ -24,6 +25,7 @@ library UserConfiguration {
|
|||
uint256 reserveIndex,
|
||||
bool borrowing
|
||||
) internal {
|
||||
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
|
||||
self.data =
|
||||
(self.data & ~(1 << (reserveIndex * 2))) |
|
||||
(uint256(borrowing ? 1 : 0) << (reserveIndex * 2));
|
||||
|
@ -40,6 +42,7 @@ library UserConfiguration {
|
|||
uint256 reserveIndex,
|
||||
bool _usingAsCollateral
|
||||
) internal {
|
||||
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
|
||||
self.data =
|
||||
(self.data & ~(1 << (reserveIndex * 2 + 1))) |
|
||||
(uint256(_usingAsCollateral ? 1 : 0) << (reserveIndex * 2 + 1));
|
||||
|
@ -56,6 +59,7 @@ library UserConfiguration {
|
|||
pure
|
||||
returns (bool)
|
||||
{
|
||||
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
|
||||
return (self.data >> (reserveIndex * 2)) & 3 != 0;
|
||||
}
|
||||
|
||||
|
@ -70,6 +74,7 @@ library UserConfiguration {
|
|||
pure
|
||||
returns (bool)
|
||||
{
|
||||
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
|
||||
return (self.data >> (reserveIndex * 2)) & 1 != 0;
|
||||
}
|
||||
|
||||
|
@ -84,6 +89,7 @@ library UserConfiguration {
|
|||
pure
|
||||
returns (bool)
|
||||
{
|
||||
require(reserveIndex < 128, Errors.UL_INVALID_INDEX);
|
||||
return (self.data >> (reserveIndex * 2 + 1)) & 1 != 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,6 +96,8 @@ library Errors {
|
|||
string public constant LPAPR_INVALID_ADDRESSES_PROVIDER_ID = '72';
|
||||
string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = '73';
|
||||
string public constant LP_INCONSISTENT_PARAMS_LENGTH = '74';
|
||||
string public constant UL_INVALID_INDEX = '77';
|
||||
string public constant LP_NOT_CONTRACT = '78';
|
||||
|
||||
enum CollateralManagerErrors {
|
||||
NO_ERROR,
|
||||
|
|
|
@ -76,7 +76,7 @@ library ReserveLogic {
|
|||
/**
|
||||
* @dev returns the ongoing normalized income for the reserve.
|
||||
* a value of 1e27 means there is no income. As time passes, the income is accrued.
|
||||
* A value of 2*1e27 means for each unit of assset two units of income have been accrued.
|
||||
* A value of 2*1e27 means for each unit of asset one unit of income has been accrued.
|
||||
* @param reserve the reserve object
|
||||
* @return the normalized income. expressed in ray
|
||||
**/
|
||||
|
@ -185,15 +185,9 @@ library ReserveLogic {
|
|||
address interestRateStrategyAddress
|
||||
) external {
|
||||
require(reserve.aTokenAddress == address(0), Errors.RL_RESERVE_ALREADY_INITIALIZED);
|
||||
if (reserve.liquidityIndex == 0) {
|
||||
//if the reserve has not been initialized yet
|
||||
reserve.liquidityIndex = uint128(WadRayMath.ray());
|
||||
}
|
||||
|
||||
if (reserve.variableBorrowIndex == 0) {
|
||||
reserve.variableBorrowIndex = uint128(WadRayMath.ray());
|
||||
}
|
||||
|
||||
|
||||
reserve.liquidityIndex = uint128(WadRayMath.ray());
|
||||
reserve.variableBorrowIndex = uint128(WadRayMath.ray());
|
||||
reserve.aTokenAddress = aTokenAddress;
|
||||
reserve.stableDebtTokenAddress = stableDebtTokenAddress;
|
||||
reserve.variableDebtTokenAddress = variableDebtTokenAddress;
|
||||
|
|
|
@ -13,6 +13,7 @@ import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol';
|
|||
import {UserConfiguration} from '../configuration/UserConfiguration.sol';
|
||||
import {Errors} from '../helpers/Errors.sol';
|
||||
import {Helpers} from '../helpers/Helpers.sol';
|
||||
import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol';
|
||||
|
||||
/**
|
||||
* @title ReserveLogic library
|
||||
|
@ -28,6 +29,9 @@ library ValidationLogic {
|
|||
using ReserveConfiguration for ReserveConfiguration.Map;
|
||||
using UserConfiguration for UserConfiguration.Map;
|
||||
|
||||
uint256 public constant REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD = 4000;
|
||||
uint256 public constant REBALANCE_UP_USAGE_RATIO_THRESHOLD = 0.95 * 1e27; //usage ratio of 95%
|
||||
|
||||
/**
|
||||
* @dev validates a deposit.
|
||||
* @param reserve the reserve state on which the user is depositing
|
||||
|
@ -62,10 +66,13 @@ library ValidationLogic {
|
|||
uint256 reservesCount,
|
||||
address oracle
|
||||
) external view {
|
||||
require(amount != 0, Errors.VL_INVALID_AMOUNT);
|
||||
|
||||
require(amount != 0, Errors.VL_INVALID_AMOUNT);
|
||||
require(amount <= userBalance, Errors.VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE);
|
||||
|
||||
(bool isActive,, , ) = reservesData[reserveAddress].configuration.getFlags();
|
||||
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
|
||||
|
||||
require(
|
||||
GenericLogic.balanceDecreaseAllowed(
|
||||
reserveAddress,
|
||||
|
@ -293,6 +300,54 @@ library ValidationLogic {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev validates a stable borrow rate rebalance
|
||||
* @param reserve the reserve state on which the user is getting rebalanced
|
||||
* @param reserveAddress the address of the reserve
|
||||
* @param stableDebtToken the stable debt token instance
|
||||
* @param variableDebtToken the variable debt token instance
|
||||
* @param aTokenAddress the address of the aToken contract
|
||||
*/
|
||||
function validateRebalanceStableBorrowRate(
|
||||
ReserveLogic.ReserveData storage reserve,
|
||||
address reserveAddress,
|
||||
IERC20 stableDebtToken,
|
||||
IERC20 variableDebtToken,
|
||||
address aTokenAddress) external view {
|
||||
|
||||
(bool isActive,,, ) = reserve.configuration.getFlags();
|
||||
|
||||
require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
|
||||
|
||||
//if the usage ratio is below 95%, no rebalances are needed
|
||||
uint256 totalDebt = stableDebtToken
|
||||
.totalSupply()
|
||||
.add(variableDebtToken.totalSupply())
|
||||
.wadToRay();
|
||||
uint256 availableLiquidity = IERC20(reserveAddress).balanceOf(aTokenAddress).wadToRay();
|
||||
uint256 usageRatio = totalDebt == 0
|
||||
? 0
|
||||
: totalDebt.rayDiv(availableLiquidity.add(totalDebt));
|
||||
|
||||
//if the liquidity rate is below REBALANCE_UP_THRESHOLD of the max variable APR at 95% usage,
|
||||
//then we allow rebalancing of the stable rate positions.
|
||||
|
||||
uint256 currentLiquidityRate = reserve.currentLiquidityRate;
|
||||
uint256 maxVariableBorrowRate = IReserveInterestRateStrategy(
|
||||
reserve
|
||||
.interestRateStrategyAddress
|
||||
)
|
||||
.getMaxVariableBorrowRate();
|
||||
|
||||
require(
|
||||
usageRatio >= REBALANCE_UP_USAGE_RATIO_THRESHOLD &&
|
||||
currentLiquidityRate <=
|
||||
maxVariableBorrowRate.percentMul(REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD),
|
||||
Errors.LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev validates the choice of a user of setting (or not) an asset as collateral
|
||||
* @param reserve the state of the reserve that the user is enabling or disabling as collateral
|
||||
|
|
|
@ -175,6 +175,8 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
|||
//being a normal transfer, the Transfer() and BalanceTransfer() are emitted
|
||||
//so no need to emit a specific event here
|
||||
_transfer(from, to, value, false);
|
||||
|
||||
emit Transfer(from, to, value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1285,4 +1285,4 @@
|
|||
"address": "0xaDF23b1cAa6a7B3b077c432794FfF80A4b935cdF"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
174
package-lock.json
generated
174
package-lock.json
generated
|
@ -5293,13 +5293,13 @@
|
|||
"dependencies": {
|
||||
"ansi-regex": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==",
|
||||
"dev": true
|
||||
},
|
||||
"ansi-styles": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5308,7 +5308,7 @@
|
|||
},
|
||||
"bindings": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5317,7 +5317,7 @@
|
|||
},
|
||||
"bip66": {
|
||||
"version": "1.1.5",
|
||||
"resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5326,19 +5326,19 @@
|
|||
},
|
||||
"bn.js": {
|
||||
"version": "4.11.8",
|
||||
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==",
|
||||
"dev": true
|
||||
},
|
||||
"brorand": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=",
|
||||
"dev": true
|
||||
},
|
||||
"browserify-aes": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5352,25 +5352,25 @@
|
|||
},
|
||||
"buffer-from": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==",
|
||||
"dev": true
|
||||
},
|
||||
"buffer-xor": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
|
||||
"dev": true
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"dev": true
|
||||
},
|
||||
"cipher-base": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5380,7 +5380,7 @@
|
|||
},
|
||||
"cliui": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5391,7 +5391,7 @@
|
|||
},
|
||||
"color-convert": {
|
||||
"version": "1.9.3",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5400,13 +5400,13 @@
|
|||
},
|
||||
"color-name": {
|
||||
"version": "1.1.3",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
|
||||
"dev": true
|
||||
},
|
||||
"create-hash": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5419,7 +5419,7 @@
|
|||
},
|
||||
"create-hmac": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5433,7 +5433,7 @@
|
|||
},
|
||||
"cross-spawn": {
|
||||
"version": "6.0.5",
|
||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5446,13 +5446,13 @@
|
|||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
|
||||
"dev": true
|
||||
},
|
||||
"drbg.js": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5463,7 +5463,7 @@
|
|||
},
|
||||
"elliptic": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5478,13 +5478,13 @@
|
|||
},
|
||||
"emoji-regex": {
|
||||
"version": "7.0.3",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
|
||||
"dev": true
|
||||
},
|
||||
"end-of-stream": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5493,7 +5493,7 @@
|
|||
},
|
||||
"ethereumjs-util": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5508,7 +5508,7 @@
|
|||
},
|
||||
"ethjs-util": {
|
||||
"version": "0.1.6",
|
||||
"resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5518,7 +5518,7 @@
|
|||
},
|
||||
"evp_bytestokey": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5528,7 +5528,7 @@
|
|||
},
|
||||
"execa": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5543,13 +5543,13 @@
|
|||
},
|
||||
"file-uri-to-path": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
|
||||
"dev": true
|
||||
},
|
||||
"find-up": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5558,13 +5558,13 @@
|
|||
},
|
||||
"get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true
|
||||
},
|
||||
"get-stream": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5573,7 +5573,7 @@
|
|||
},
|
||||
"hash-base": {
|
||||
"version": "3.0.4",
|
||||
"resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5583,7 +5583,7 @@
|
|||
},
|
||||
"hash.js": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5593,7 +5593,7 @@
|
|||
},
|
||||
"hmac-drbg": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5604,43 +5604,43 @@
|
|||
},
|
||||
"inherits": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||
"dev": true
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==",
|
||||
"dev": true
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
|
||||
"dev": true
|
||||
},
|
||||
"is-hex-prefixed": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=",
|
||||
"dev": true
|
||||
},
|
||||
"is-stream": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=",
|
||||
"dev": true
|
||||
},
|
||||
"isexe": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
||||
"dev": true
|
||||
},
|
||||
"keccak": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5652,7 +5652,7 @@
|
|||
},
|
||||
"lcid": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5661,7 +5661,7 @@
|
|||
},
|
||||
"locate-path": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5671,7 +5671,7 @@
|
|||
},
|
||||
"map-age-cleaner": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5680,7 +5680,7 @@
|
|||
},
|
||||
"md5.js": {
|
||||
"version": "1.3.5",
|
||||
"resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5691,7 +5691,7 @@
|
|||
},
|
||||
"mem": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5702,37 +5702,37 @@
|
|||
},
|
||||
"mimic-fn": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
|
||||
"dev": true
|
||||
},
|
||||
"minimalistic-assert": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
|
||||
"dev": true
|
||||
},
|
||||
"minimalistic-crypto-utils": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=",
|
||||
"dev": true
|
||||
},
|
||||
"nan": {
|
||||
"version": "2.14.0",
|
||||
"resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==",
|
||||
"dev": true
|
||||
},
|
||||
"nice-try": {
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
|
||||
"dev": true
|
||||
},
|
||||
"npm-run-path": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5741,7 +5741,7 @@
|
|||
},
|
||||
"once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5750,7 +5750,7 @@
|
|||
},
|
||||
"os-locale": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5761,25 +5761,25 @@
|
|||
},
|
||||
"p-defer": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=",
|
||||
"dev": true
|
||||
},
|
||||
"p-finally": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=",
|
||||
"dev": true
|
||||
},
|
||||
"p-is-promise": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==",
|
||||
"dev": true
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5788,7 +5788,7 @@
|
|||
},
|
||||
"p-locate": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5797,25 +5797,25 @@
|
|||
},
|
||||
"p-try": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||
"dev": true
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"dev": true
|
||||
},
|
||||
"path-key": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
|
||||
"dev": true
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5825,19 +5825,19 @@
|
|||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
|
||||
"dev": true
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||
"dev": true
|
||||
},
|
||||
"ripemd160": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5847,7 +5847,7 @@
|
|||
},
|
||||
"rlp": {
|
||||
"version": "2.2.3",
|
||||
"resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5857,13 +5857,13 @@
|
|||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==",
|
||||
"dev": true
|
||||
},
|
||||
"secp256k1": {
|
||||
"version": "3.7.1",
|
||||
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5879,19 +5879,19 @@
|
|||
},
|
||||
"semver": {
|
||||
"version": "5.7.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
|
||||
"dev": true
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
|
||||
"dev": true
|
||||
},
|
||||
"sha.js": {
|
||||
"version": "2.4.11",
|
||||
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5901,7 +5901,7 @@
|
|||
},
|
||||
"shebang-command": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5910,25 +5910,25 @@
|
|||
},
|
||||
"shebang-regex": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
|
||||
"dev": true
|
||||
},
|
||||
"signal-exit": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
|
||||
"dev": true
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
},
|
||||
"source-map-support": {
|
||||
"version": "0.5.12",
|
||||
"resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5938,7 +5938,7 @@
|
|||
},
|
||||
"string-width": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5949,7 +5949,7 @@
|
|||
},
|
||||
"strip-ansi": {
|
||||
"version": "5.2.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5958,13 +5958,13 @@
|
|||
},
|
||||
"strip-eof": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
|
||||
"dev": true
|
||||
},
|
||||
"strip-hex-prefix": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5973,7 +5973,7 @@
|
|||
},
|
||||
"which": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5982,13 +5982,13 @@
|
|||
},
|
||||
"which-module": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
|
||||
"dev": true
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -5999,19 +5999,19 @@
|
|||
},
|
||||
"wrappy": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
|
||||
"dev": true
|
||||
},
|
||||
"y18n": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
|
||||
"dev": true
|
||||
},
|
||||
"yargs": {
|
||||
"version": "13.2.4",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
@ -6030,7 +6030,7 @@
|
|||
},
|
||||
"yargs-parser": {
|
||||
"version": "13.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz",
|
||||
"resolved": false,
|
||||
"integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user