From e0f5c5fb7f5a4e6a5a592ba008b5a263f684d316 Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 15:29:42 +0200 Subject: [PATCH 01/38] Fixes PVE002 --- contracts/libraries/math/WadRayMath.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index 7da5fc81..4d6d02f5 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -54,7 +54,7 @@ library WadRayMath { * @return the result of a*b, in wad **/ function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { - if (a == 0) { + if (a == 0 || b == 0) { return 0; } From b57a59ea6d1e8c24e14adc3eecdf45c86be9d0f0 Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 15:40:19 +0200 Subject: [PATCH 02/38] Fixes PVE002 --- contracts/libraries/math/WadRayMath.sol | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index 4d6d02f5..c4001a71 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -78,6 +78,10 @@ library WadRayMath { function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.DIVISION_BY_ZERO); + if (a == 0) { + return 0; + } + uint256 halfB = b / 2; uint256 result = a * WAD; @@ -98,7 +102,7 @@ library WadRayMath { * @return the result of a*b, in ray **/ function rayMul(uint256 a, uint256 b) internal pure returns (uint256) { - if (a == 0) { + if (a == 0 || b == 0) { return 0; } @@ -122,6 +126,10 @@ library WadRayMath { function rayDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.DIVISION_BY_ZERO); + if (a == 0) { + return 0; + } + uint256 halfB = b / 2; uint256 result = a * RAY; From bdac7b0d41549c43c314e5c0fe84594d35894904 Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 15:45:35 +0200 Subject: [PATCH 03/38] Fixes PVE004 --- contracts/lendingpool/LendingPool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index ac052e33..9bbc8d30 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -267,7 +267,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage ? stableDebt : variableDebt; - if (amount != type(uint256).max && amount < paybackAmount) { + if (amount < paybackAmount) { paybackAmount = amount; } From 1dd92aed6712ce9f1e3673b2b69882ee7ac5488c Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 15:52:56 +0200 Subject: [PATCH 04/38] fixes PVE006 --- contracts/lendingpool/DefaultReserveInterestRateStrategy.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol b/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol index 4f17a7c9..7ed6aa42 100644 --- a/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol +++ b/contracts/lendingpool/DefaultReserveInterestRateStrategy.sol @@ -162,7 +162,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy { _stableRateSlope1.rayMul(utilizationRate.rayDiv(OPTIMAL_UTILIZATION_RATE)) ); vars.currentVariableBorrowRate = _baseVariableBorrowRate.add( - utilizationRate.rayDiv(OPTIMAL_UTILIZATION_RATE).rayMul(_variableRateSlope1) + utilizationRate.rayMul(_variableRateSlope1).rayDiv(OPTIMAL_UTILIZATION_RATE) ); } From 3575d58ff43ffa751b026681bd3d4ebbcbc0aea8 Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 16:24:49 +0200 Subject: [PATCH 05/38] unified interface of stable, variable debt tokens and aTokens --- contracts/tokenization/AToken.sol | 6 +++--- contracts/tokenization/VariableDebtToken.sol | 5 +++-- contracts/tokenization/base/DebtTokenBase.sol | 10 +++------- deployed-contracts.json | 8 ++++---- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/contracts/tokenization/AToken.sol b/contracts/tokenization/AToken.sol index 13aa905c..bee1184d 100644 --- a/contracts/tokenization/AToken.sol +++ b/contracts/tokenization/AToken.sol @@ -2,7 +2,7 @@ pragma solidity ^0.6.8; import {IncentivizedERC20} from './IncentivizedERC20.sol'; -import {LendingPool} from '../lendingpool/LendingPool.sol'; +import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; @@ -32,7 +32,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { uint256 public constant ATOKEN_REVISION = 0x1; address public immutable UNDERLYING_ASSET_ADDRESS; address public immutable RESERVE_TREASURY_ADDRESS; - LendingPool public immutable POOL; + ILendingPool public immutable POOL; /// @dev owner => next valid nonce to submit with permit() mapping(address => uint256) public _nonces; @@ -45,7 +45,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken { } constructor( - LendingPool pool, + ILendingPool pool, address underlyingAssetAddress, address reserveTreasuryAddress, string memory tokenName, diff --git a/contracts/tokenization/VariableDebtToken.sol b/contracts/tokenization/VariableDebtToken.sol index 814ad8e7..2a5d903c 100644 --- a/contracts/tokenization/VariableDebtToken.sol +++ b/contracts/tokenization/VariableDebtToken.sol @@ -43,7 +43,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { return 0; } - return scaledBalance.rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET)); + return scaledBalance.rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS)); } /** @@ -102,7 +102,8 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken { * @return the total supply **/ function totalSupply() public virtual override view returns (uint256) { - return super.totalSupply().rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET)); + return + super.totalSupply().rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS)); } /** diff --git a/contracts/tokenization/base/DebtTokenBase.sol b/contracts/tokenization/base/DebtTokenBase.sol index a2744017..fc43e770 100644 --- a/contracts/tokenization/base/DebtTokenBase.sol +++ b/contracts/tokenization/base/DebtTokenBase.sol @@ -15,8 +15,8 @@ import {Errors} from '../../libraries/helpers/Errors.sol'; */ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable { - address internal immutable UNDERLYING_ASSET; - ILendingPool internal immutable POOL; + address public immutable UNDERLYING_ASSET_ADDRESS; + ILendingPool public immutable POOL; mapping(address => uint256) internal _usersData; /** @@ -39,7 +39,7 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable { address incentivesController ) public IncentivizedERC20(name, symbol, 18, incentivesController) { POOL = ILendingPool(pool); - UNDERLYING_ASSET = underlyingAssetAddress; + UNDERLYING_ASSET_ADDRESS = underlyingAssetAddress; } /** @@ -58,10 +58,6 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable { _setDecimals(decimals); } - function underlyingAssetAddress() public view returns (address) { - return UNDERLYING_ASSET; - } - /** * @dev Being non transferrable, the debt token does not implement any of the * standard ERC20 functions for transfer and allowance. diff --git a/deployed-contracts.json b/deployed-contracts.json index f0208be5..46423910 100644 --- a/deployed-contracts.json +++ b/deployed-contracts.json @@ -231,7 +231,7 @@ }, "WalletBalanceProvider": { "buidlerevm": { - "address": "0xC6bA6049F86d528698B5924B8fC2FE7289D38578", + "address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -620,7 +620,7 @@ }, "MockAToken": { "buidlerevm": { - "address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460", + "address": "0x392E5355a0e88Bd394F717227c752670fb3a8020", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -648,7 +648,7 @@ }, "MockStableDebtToken": { "buidlerevm": { - "address": "0xEBAB67ee3ef604D5c250A53b4b8fcbBC6ec3007C", + "address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -662,7 +662,7 @@ }, "MockVariableDebtToken": { "buidlerevm": { - "address": "0xBE36BE5680244Ae1A6F983E4A6f6E1c142cdAbe3", + "address": "0xEBAB67ee3ef604D5c250A53b4b8fcbBC6ec3007C", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { From 19756cdbe8507d888b698d48c2f6d670725fd7db Mon Sep 17 00:00:00 2001 From: emilio Date: Mon, 19 Oct 2020 18:29:32 +0200 Subject: [PATCH 06/38] fixed PVE001, PVE009(1) --- .../LendingPoolAddressesProviderRegistry.sol | 2 ++ .../lendingpool/LendingPoolConfigurator.sol | 26 +++++++++++++++++-- contracts/libraries/helpers/Errors.sol | 10 +++++-- .../interfaces/ITokenConfiguration.sol | 13 ++++++++++ helpers/contracts-helpers.ts | 1 - helpers/types.ts | 1 + test/addresses-provider-registry.spec.ts | 9 +++++++ 7 files changed, 57 insertions(+), 5 deletions(-) create mode 100644 contracts/tokenization/interfaces/ITokenConfiguration.sol diff --git a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol index f8dfb629..77c260bf 100644 --- a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol +++ b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol @@ -54,6 +54,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP * @param provider the pool address to be registered **/ function registerAddressesProvider(address provider, uint256 id) external override onlyOwner { + require(id != 0, Errors.INVALID_ADDRESSES_PROVIDER_ID); + _addressesProviders[provider] = id; _addToAddressesProvidersList(provider); emit AddressesProviderRegistered(provider); diff --git a/contracts/lendingpool/LendingPoolConfigurator.sol b/contracts/lendingpool/LendingPoolConfigurator.sol index 8f154e23..c3da634c 100644 --- a/contracts/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/lendingpool/LendingPoolConfigurator.sol @@ -10,6 +10,7 @@ import { import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol'; +import {ITokenConfiguration} from '../tokenization/interfaces/ITokenConfiguration.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; @@ -200,7 +201,6 @@ contract LendingPoolConfigurator is VersionedInitializable { /** * @dev initializes a reserve - * @param asset the address of the reserve to be initialized * @param aTokenImpl the address of the aToken contract implementation * @param stableDebtTokenImpl the address of the stable debt token contract * @param variableDebtTokenImpl the address of the variable debt token contract @@ -208,13 +208,35 @@ contract LendingPoolConfigurator is VersionedInitializable { * @param interestRateStrategyAddress the address of the interest rate strategy contract for this reserve **/ function initReserve( - address asset, address aTokenImpl, address stableDebtTokenImpl, address variableDebtTokenImpl, uint8 underlyingAssetDecimals, address interestRateStrategyAddress ) public onlyAaveAdmin { + address asset = ITokenConfiguration(aTokenImpl).UNDERLYING_ASSET_ADDRESS(); + + require( + address(pool) == ITokenConfiguration(aTokenImpl).POOL(), + Errors.INVALID_ATOKEN_POOL_ADDRESS + ); + require( + address(pool) == ITokenConfiguration(stableDebtTokenImpl).POOL(), + Errors.INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS + ); + require( + address(pool) == ITokenConfiguration(variableDebtTokenImpl).POOL(), + Errors.INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS + ); + require( + asset == ITokenConfiguration(stableDebtTokenImpl).UNDERLYING_ASSET_ADDRESS(), + Errors.INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS + ); + require( + asset == ITokenConfiguration(variableDebtTokenImpl).UNDERLYING_ASSET_ADDRESS(), + Errors.INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS + ); + address aTokenProxyAddress = _initTokenWithProxy(aTokenImpl, underlyingAssetDecimals); address stableDebtTokenProxyAddress = _initTokenWithProxy( diff --git a/contracts/libraries/helpers/Errors.sol b/contracts/libraries/helpers/Errors.sol index ee71efaa..985a2bc3 100644 --- a/contracts/libraries/helpers/Errors.sol +++ b/contracts/libraries/helpers/Errors.sol @@ -50,8 +50,8 @@ library Errors { string public constant CALLER_MUST_BE_LENDING_POOL = '28'; // 'The caller of this function must be a lending pool' string public constant CANNOT_GIVE_ALLOWANCE_TO_HIMSELF = '30'; // 'User cannot give allowance to himself' string public constant TRANSFER_AMOUNT_NOT_GT_0 = '31'; // 'Transferred amount needs to be greater than zero' - string public constant INVALID_MINT_AMOUNT = '53'; //invalid amount to mint - string public constant INVALID_BURN_AMOUNT = '54'; //invalid amount to burn + string public constant INVALID_MINT_AMOUNT = '61'; //invalid amount to mint + string public constant INVALID_BURN_AMOUNT = '62'; //invalid amount to burn // require error messages - ReserveLogic string public constant RESERVE_ALREADY_INITIALIZED = '34'; // 'Reserve has already been initialized' @@ -64,9 +64,15 @@ library Errors { //require error messages - LendingPoolConfiguration string public constant CALLER_NOT_AAVE_ADMIN = '35'; // 'The caller must be the aave admin' string public constant RESERVE_LIQUIDITY_NOT_0 = '36'; // 'The liquidity of the reserve needs to be 0' + string public constant INVALID_ATOKEN_POOL_ADDRESS = '63'; // the lending pool in the aToken implementation is not configured correctly + string public constant INVALID_STABLE_DEBT_TOKEN_POOL_ADDRESS = '64'; // the lending pool in the stable debt token implementation is not configured correctly + string public constant INVALID_VARIABLE_DEBT_TOKEN_POOL_ADDRESS = '65'; // the lending pool in the variable debt token implementation is not configured correctly + string public constant INVALID_STABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '66'; // the underlying asset in the stable debt token implementation is not configured correctly + string public constant INVALID_VARIABLE_DEBT_TOKEN_UNDERLYING_ADDRESS = '67'; // the underlying asset in the variable debt token implementation is not configured correctly //require error messages - LendingPoolAddressesProviderRegistry string public constant PROVIDER_NOT_REGISTERED = '37'; // 'Provider is not registered' + string public constant INVALID_ADDRESSES_PROVIDER_ID = '68'; // the addresses provider id needs to be greater than 0 //return error messages - LendingPoolCollateralManager string public constant HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '38'; // 'Health factor is not below the threshold' diff --git a/contracts/tokenization/interfaces/ITokenConfiguration.sol b/contracts/tokenization/interfaces/ITokenConfiguration.sol new file mode 100644 index 00000000..50eb3b09 --- /dev/null +++ b/contracts/tokenization/interfaces/ITokenConfiguration.sol @@ -0,0 +1,13 @@ +pragma solidity ^0.6; + +/** + * @title ITokenConfiguration + * @author Aave + * @dev common interface between aTokens and debt tokens to fetch the + * token configuration + **/ +interface ITokenConfiguration { + function UNDERLYING_ASSET_ADDRESS() external view returns (address); + + function POOL() external view returns (address); +} diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 77730b04..62afaa35 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -857,7 +857,6 @@ export const initReserves = async ( console.log('init reserve currency ', assetSymbol); await lendingPoolConfigurator.initReserve( - tokenAddress, aToken.address, stableDebtToken.address, variableDebtToken.address, diff --git a/helpers/types.ts b/helpers/types.ts index 0b5e4a33..f2682691 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -106,6 +106,7 @@ export enum ProtocolErrors { //require error messages - LendingPoolAddressesProviderRegistry PROVIDER_NOT_REGISTERED = '37', // 'Provider is not registered' + INVALID_ADDRESSES_PROVIDER_ID = '68', //return error messages - LendingPoolCollateralManager HEALTH_FACTOR_NOT_BELOW_THRESHOLD = '38', // 'Health factor is not below the threshold' diff --git a/test/addresses-provider-registry.spec.ts b/test/addresses-provider-registry.spec.ts index 457514e4..5630591d 100644 --- a/test/addresses-provider-registry.spec.ts +++ b/test/addresses-provider-registry.spec.ts @@ -18,6 +18,15 @@ makeSuite('AddressesProviderRegistry', (testEnv: TestEnv) => { ); }); + it('tries to register an addresses provider with id 0', async () => { + const {users, registry} = testEnv; + const {INVALID_ADDRESSES_PROVIDER_ID} = ProtocolErrors; + + await expect(registry.registerAddressesProvider(users[2].address, '0')).to.be.revertedWith( + INVALID_ADDRESSES_PROVIDER_ID + ); + }); + it('Registers a new mock addresses provider', async () => { const {users, registry} = testEnv; From 4ee41dbece2e286e06340e9f7d7ce44ff2ca22bc Mon Sep 17 00:00:00 2001 From: David Racero Date: Wed, 21 Oct 2020 11:42:27 +0200 Subject: [PATCH 07/38] Added waitForTx to missing methods. --- helpers/contracts-helpers.ts | 20 +++++++++++--------- helpers/init-helpers.ts | 20 ++++++++++++++------ helpers/oracles-helpers.ts | 2 +- 3 files changed, 26 insertions(+), 16 deletions(-) diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 77730b04..6cb94d84 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -1,6 +1,6 @@ import {Contract, Signer, utils, ethers} from 'ethers'; import {CommonsConfig} from '../config/commons'; -import {getDb, BRE} from './misc-utils'; +import {getDb, BRE, waitForTx} from './misc-utils'; import { tEthereumAddress, eContractid, @@ -101,7 +101,7 @@ export const deployContract = async ( const contract = (await (await BRE.ethers.getContractFactory(contractName)).deploy( ...args )) as ContractType; - + await waitForTx(contract.deployTransaction); await registerContractInJsonDb(contractName, contract); return contract; }; @@ -856,13 +856,15 @@ export const initReserves = async ( } console.log('init reserve currency ', assetSymbol); - await lendingPoolConfigurator.initReserve( - tokenAddress, - aToken.address, - stableDebtToken.address, - variableDebtToken.address, - reserveDecimals, - rateStrategyContract.address + await waitForTx( + await lendingPoolConfigurator.initReserve( + tokenAddress, + aToken.address, + stableDebtToken.address, + variableDebtToken.address, + reserveDecimals, + rateStrategyContract.address + ) ); } catch (e) { console.log(`Reserve initialization for ${assetSymbol} failed with error ${e}. Skipped.`); diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index 6e049c51..ede2bbc3 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -2,6 +2,7 @@ import {iMultiPoolsAssets, IReserveParams, tEthereumAddress} from './types'; import {LendingPool} from '../types/LendingPool'; import {LendingPoolConfigurator} from '../types/LendingPoolConfigurator'; import {AaveProtocolTestHelpers} from '../types/AaveProtocolTestHelpers'; +import {waitForTx} from './misc-utils'; export const enableReservesToBorrow = async ( reservesParams: iMultiPoolsAssets, @@ -29,7 +30,12 @@ export const enableReservesToBorrow = async ( continue; } - await lendingPoolConfigurator.enableBorrowingOnReserve(tokenAddress, stableBorrowRateEnabled); + await waitForTx( + await lendingPoolConfigurator.enableBorrowingOnReserve( + tokenAddress, + stableBorrowRateEnabled + ) + ); } catch (e) { console.log( `Enabling reserve for borrowings for ${assetSymbol} failed with error ${e}. Skipped.` @@ -66,11 +72,13 @@ export const enableReservesAsCollateral = async ( } try { - await lendingPoolConfigurator.enableReserveAsCollateral( - tokenAddress, - baseLTVAsCollateral, - liquidationThreshold, - liquidationBonus + await waitForTx( + await lendingPoolConfigurator.enableReserveAsCollateral( + tokenAddress, + baseLTVAsCollateral, + liquidationThreshold, + liquidationBonus + ) ); } catch (e) { console.log( diff --git a/helpers/oracles-helpers.ts b/helpers/oracles-helpers.ts index b3439df9..f5b5941d 100644 --- a/helpers/oracles-helpers.ts +++ b/helpers/oracles-helpers.ts @@ -30,7 +30,7 @@ export const setInitialMarketRatesInRatesOracle = async ( const [, assetAddress] = (Object.entries(assetsAddresses) as [string, string][])[ assetAddressIndex ]; - await lendingRateOracleInstance.setMarketBorrowRate(assetAddress, borrowRate); + await waitForTx(await lendingRateOracleInstance.setMarketBorrowRate(assetAddress, borrowRate)); console.log('added Market Borrow Rate for: ', assetSymbol); } }; From d864836ec5e90f15b2717860e31398adf92556e6 Mon Sep 17 00:00:00 2001 From: David Racero Date: Wed, 21 Oct 2020 11:50:54 +0200 Subject: [PATCH 08/38] Added waitForTx for lendingpoool --- deployed-contracts.json | 32 ++++++++++++++++---------------- helpers/contracts-helpers.ts | 1 + 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/deployed-contracts.json b/deployed-contracts.json index 033a9c6c..35117b59 100644 --- a/deployed-contracts.json +++ b/deployed-contracts.json @@ -27,8 +27,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0xd7e3C4b2CE495066dE1923c268D68A844bD7Ae13", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0xF9a2E6D57c691f3aa5269858178a13Ef06378579", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "LendingPoolAddressesProviderRegistry": { @@ -45,8 +45,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0x83c7A0E78e8eee2108a87d7a6770f22BAcb68b5A", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0xf3266d89e6742fAE2C35D05eD549cd4e117300a7", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "FeeProvider": { @@ -76,7 +76,7 @@ "address": "0x65e0Cd5B8904A02f2e00BC6f58bf881998D54BDe" }, "kovan": { - "address": "0x1339f3c1FfF00D0FD8946187fdC61F0ef0fFe786" + "address": "0x1aae278bCcdb95817c7A546d752fC662F09b6DBa" } }, "LendingPoolDataProvider": { @@ -92,7 +92,7 @@ "address": "0x5d12dDe3286D94E0d85F9D3B01B7099cfA0aBCf1" }, "kovan": { - "address": "0xB43CCfF1148bb5ab2104E2ee68A7c30cDEBb9A9C" + "address": "0x8E05A3054cb736258FaF4638D07058cE6e294d2C" } }, "PriceOracle": { @@ -173,8 +173,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0xc4e3d83AEd3D3c60Cf4b238F634014cE103F6fa1", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0x47341CE48FfE1cbD91991578B880a18c45cdB5CA", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "LendingPoolLiquidationManager": { @@ -580,8 +580,8 @@ "address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4" }, "kovan": { - "address": "0xE4566ce19626826360f4faD941418e2849fC3685", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0xfF28b837352d9531bAb6dFF3650D7831192117F7", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "StableDebtToken": { @@ -598,8 +598,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0x0043967C1Cf13c4Ff3Bc38109054D5a97C147B4A", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0x0EDc241FdA0dF39EB1B9eB1236217BBe72Ab911D", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "VariableDebtToken": { @@ -616,8 +616,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0xdF75B68c75c30D177f4Dbd47cBcb5E2E4f3cf8F9", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0x293f5BcC66762c28a5d3Bd8512a799D457F5296D", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "AToken": { @@ -634,8 +634,8 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "kovan": { - "address": "0x1A23ADa7218e0a66b7368E12E379Ea88d7a68a27", - "deployer": "0x6b40a028d2Ab94e5f6d3793F32D326CDf724Bb1D" + "address": "0xf303Ae6F24C29D94E367fdb5C7aE04D32BEbF13E", + "deployer": "0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F" } }, "MockAToken": { diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 6cb94d84..8216c950 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -205,6 +205,7 @@ export const deployLendingPool = async (verify?: boolean) => { ); const factory = await linkLibrariesToArtifact(lendingPoolArtifact); const lendingPool = await factory.deploy(); + await waitForTx(lendingPool.deployTransaction); const instance = (await lendingPool.deployed()) as LendingPool; if (verify) { await verifyContract(eContractid.LendingPool, instance.address, []); From 76031c878f74459a280fcd5c69e587ab86f27a9c Mon Sep 17 00:00:00 2001 From: The3D Date: Wed, 21 Oct 2020 13:35:52 +0200 Subject: [PATCH 09/38] Fixed console messages --- helpers/contracts-helpers.ts | 10 +++++----- helpers/init-helpers.ts | 4 ++++ helpers/misc-utils.ts | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 8216c950..c6dc1331 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -799,7 +799,7 @@ export const initReserves = async ( stableRateSlope2, }, ] = (Object.entries(reservesParams) as [string, IReserveParams][])[reserveParamIndex]; - console.log('deploy def reserve'); + console.log('deploy the interest rate strategy for ', assetSymbol); const rateStrategyContract = await deployDefaultReserveInterestRateStrategy( [ lendingPoolAddressesProvider.address, @@ -812,7 +812,7 @@ export const initReserves = async ( verify ); - console.log('deploy stable deb totken ', assetSymbol); + console.log('deploy the stable debt totken for ', assetSymbol); const stableDebtToken = await deployStableDebtToken( [ `Aave stable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`, @@ -824,7 +824,7 @@ export const initReserves = async ( verify ); - console.log('deploy var deb totken ', assetSymbol); + console.log('deploy the variable debt totken for ', assetSymbol); const variableDebtToken = await deployVariableDebtToken( [ `Aave variable debt bearing ${assetSymbol === 'WETH' ? 'ETH' : assetSymbol}`, @@ -836,7 +836,7 @@ export const initReserves = async ( verify ); - console.log('deploy a token ', assetSymbol); + console.log('deploy the aToken for ', assetSymbol); const aToken = await deployGenericAToken( [ lendingPool.address, @@ -856,7 +856,7 @@ export const initReserves = async ( } } - console.log('init reserve currency ', assetSymbol); + console.log('initialize the reserve ', assetSymbol); await waitForTx( await lendingPoolConfigurator.initReserve( tokenAddress, diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index ede2bbc3..599fc7ff 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -30,6 +30,8 @@ export const enableReservesToBorrow = async ( continue; } + console.log('Enabling borrowing on reserve ', assetSymbol); + await waitForTx( await lendingPoolConfigurator.enableBorrowingOnReserve( tokenAddress, @@ -72,6 +74,8 @@ export const enableReservesAsCollateral = async ( } try { + console.log(`Enabling reserve ${assetSymbol} as collateral`); + await waitForTx( await lendingPoolConfigurator.enableReserveAsCollateral( tokenAddress, diff --git a/helpers/misc-utils.ts b/helpers/misc-utils.ts index 67ac7fe2..8bf0c416 100644 --- a/helpers/misc-utils.ts +++ b/helpers/misc-utils.ts @@ -41,7 +41,7 @@ export const increaseTime = async (secondsToIncrease: number) => { await BRE.ethers.provider.send('evm_mine', []); }; -export const waitForTx = async (tx: ContractTransaction) => await tx.wait(); +export const waitForTx = async (tx: ContractTransaction) => await tx.wait(1); export const filterMapBy = (raw: {[key: string]: any}, fn: (key: string) => boolean) => Object.keys(raw) From 9496af645540f864d3880bd7f70f5667a8b8ed0b Mon Sep 17 00:00:00 2001 From: David Racero Date: Thu, 22 Oct 2020 11:17:21 +0200 Subject: [PATCH 10/38] Replace compilation for glob file finder. Stop verify if it finds a critical error. --- helpers/etherscan-verification.ts | 27 +++- package-lock.json | 204 ++++++++++++++++-------------- package.json | 1 + 3 files changed, 132 insertions(+), 100 deletions(-) diff --git a/helpers/etherscan-verification.ts b/helpers/etherscan-verification.ts index 65b6f440..a7393f0a 100644 --- a/helpers/etherscan-verification.ts +++ b/helpers/etherscan-verification.ts @@ -1,13 +1,20 @@ import {exit} from 'process'; import fs from 'fs'; +import globby from 'globby'; import {file} from 'tmp-promise'; import {BRE} from './misc-utils'; +const listSolidityFiles = (dir: string) => globby(`${dir}/**/*.sol`); + +const fatalErrors = [ + `The address provided as argument contains a contract, but its bytecode`, + `Daily limit of 100 source code submissions reached`, +]; + export const SUPPORTED_ETHERSCAN_NETWORKS = ['main', 'ropsten', 'kovan']; export const getEtherscanPath = async (contractName: string) => { - const compilerInput = await BRE.run('compile:get-compiler-input'); - const paths = Object.keys(compilerInput.sources); + const paths = await listSolidityFiles(BRE.config.paths.sources); const path = paths.find((p) => p.includes(contractName)); if (!path) { throw new Error( @@ -79,12 +86,22 @@ export const runTaskWithRetry = async ( cleanup(); } else { cleanup(); - console.error('[ERROR] Errors after all the retries, check the logs for more information.'); + console.error( + '[ETHERSCAN][ERROR] Errors after all the retries, check the logs for more information.' + ); } } catch (error) { counter--; - console.info(`[INFO] Retrying attemps: ${counter}.`); - console.error('[ERROR]', error.message); + console.info(`[ETHERSCAN][[INFO] Retrying attemps: ${counter}.`); + console.error('[ETHERSCAN][[ERROR]', error.message); + + if (fatalErrors.some((fatalError) => error.message.includes(fatalError))) { + console.error( + '[ETHERSCAN][[ERROR] Fatal error detected, skip retries and resume deployment.' + ); + return; + } + await runTaskWithRetry(task, params, counter, msDelay, cleanup); } }; diff --git a/package-lock.json b/package-lock.json index e0d0567e..51b67993 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5264,13 +5264,13 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { "version": "3.2.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { @@ -5279,7 +5279,7 @@ }, "bindings": { "version": "1.5.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "dev": true, "requires": { @@ -5288,7 +5288,7 @@ }, "bip66": { "version": "1.1.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "dev": true, "requires": { @@ -5297,19 +5297,19 @@ }, "bn.js": { "version": "4.11.8", - "resolved": false, + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "dev": true }, "brorand": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, "browserify-aes": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { @@ -5323,25 +5323,25 @@ }, "buffer-from": { "version": "1.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "buffer-xor": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", "dev": true }, "camelcase": { "version": "5.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "cipher-base": { "version": "1.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { @@ -5351,7 +5351,7 @@ }, "cliui": { "version": "5.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { @@ -5362,7 +5362,7 @@ }, "color-convert": { "version": "1.9.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { @@ -5371,13 +5371,13 @@ }, "color-name": { "version": "1.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, "create-hash": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { @@ -5390,7 +5390,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": false, + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { @@ -5404,7 +5404,7 @@ }, "cross-spawn": { "version": "6.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { @@ -5417,13 +5417,13 @@ }, "decamelize": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, "drbg.js": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "dev": true, "requires": { @@ -5434,7 +5434,7 @@ }, "elliptic": { "version": "6.5.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "dev": true, "requires": { @@ -5449,13 +5449,13 @@ }, "emoji-regex": { "version": "7.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "end-of-stream": { "version": "1.4.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { @@ -5464,7 +5464,7 @@ }, "ethereumjs-util": { "version": "6.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "dev": true, "requires": { @@ -5479,7 +5479,7 @@ }, "ethjs-util": { "version": "0.1.6", - "resolved": false, + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "dev": true, "requires": { @@ -5489,7 +5489,7 @@ }, "evp_bytestokey": { "version": "1.0.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { @@ -5499,7 +5499,7 @@ }, "execa": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "dev": true, "requires": { @@ -5514,13 +5514,13 @@ }, "file-uri-to-path": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", "dev": true }, "find-up": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { @@ -5529,13 +5529,13 @@ }, "get-caller-file": { "version": "2.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-stream": { "version": "4.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "dev": true, "requires": { @@ -5544,7 +5544,7 @@ }, "hash-base": { "version": "3.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { @@ -5554,7 +5554,7 @@ }, "hash.js": { "version": "1.1.7", - "resolved": false, + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "dev": true, "requires": { @@ -5564,7 +5564,7 @@ }, "hmac-drbg": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { @@ -5575,43 +5575,43 @@ }, "inherits": { "version": "2.0.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "invert-kv": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==", "dev": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, "is-hex-prefixed": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=", "dev": true }, "is-stream": { "version": "1.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", "dev": true }, "isexe": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, "keccak": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "dev": true, "requires": { @@ -5623,7 +5623,7 @@ }, "lcid": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "dev": true, "requires": { @@ -5632,7 +5632,7 @@ }, "locate-path": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { @@ -5642,7 +5642,7 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "dev": true, "requires": { @@ -5651,7 +5651,7 @@ }, "md5.js": { "version": "1.3.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "dev": true, "requires": { @@ -5662,7 +5662,7 @@ }, "mem": { "version": "4.3.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { @@ -5673,37 +5673,37 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimalistic-assert": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", "dev": true }, "minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", "dev": true }, "nan": { "version": "2.14.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true }, "nice-try": { "version": "1.0.5", - "resolved": false, + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, "npm-run-path": { "version": "2.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { @@ -5712,7 +5712,7 @@ }, "once": { "version": "1.4.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { @@ -5721,7 +5721,7 @@ }, "os-locale": { "version": "3.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "dev": true, "requires": { @@ -5732,25 +5732,25 @@ }, "p-defer": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=", "dev": true }, "p-finally": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", "dev": true }, "p-is-promise": { "version": "2.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { "version": "2.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { @@ -5759,7 +5759,7 @@ }, "p-locate": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { @@ -5768,25 +5768,25 @@ }, "p-try": { "version": "2.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "path-exists": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", "dev": true }, "path-key": { "version": "2.0.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "dev": true }, "pump": { "version": "3.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "dev": true, "requires": { @@ -5796,19 +5796,19 @@ }, "require-directory": { "version": "2.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", "dev": true }, "require-main-filename": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "ripemd160": { "version": "2.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { @@ -5818,7 +5818,7 @@ }, "rlp": { "version": "2.2.3", - "resolved": false, + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "dev": true, "requires": { @@ -5828,13 +5828,13 @@ }, "safe-buffer": { "version": "5.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==", "dev": true }, "secp256k1": { "version": "3.7.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "dev": true, "requires": { @@ -5850,19 +5850,19 @@ }, "semver": { "version": "5.7.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", "dev": true }, "set-blocking": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, "sha.js": { "version": "2.4.11", - "resolved": false, + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { @@ -5872,7 +5872,7 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { @@ -5881,25 +5881,25 @@ }, "shebang-regex": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", "dev": true }, "signal-exit": { "version": "3.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, "source-map": { "version": "0.6.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "source-map-support": { "version": "0.5.12", - "resolved": false, + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { @@ -5909,7 +5909,7 @@ }, "string-width": { "version": "3.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { @@ -5920,7 +5920,7 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { @@ -5929,13 +5929,13 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "dev": true }, "strip-hex-prefix": { "version": "1.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "dev": true, "requires": { @@ -5944,7 +5944,7 @@ }, "which": { "version": "1.3.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { @@ -5953,13 +5953,13 @@ }, "which-module": { "version": "2.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wrap-ansi": { "version": "5.1.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { @@ -5970,19 +5970,19 @@ }, "wrappy": { "version": "1.0.2", - "resolved": false, + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true }, "y18n": { "version": "4.0.0", - "resolved": false, + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { "version": "13.2.4", - "resolved": false, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "dev": true, "requires": { @@ -6001,7 +6001,7 @@ }, "yargs-parser": { "version": "13.1.1", - "resolved": false, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "dev": true, "requires": { @@ -21040,18 +21040,16 @@ } }, "globby": { - "version": "10.0.2", - "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", - "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.0.1.tgz", + "integrity": "sha512-iH9RmgwCmUJHi2z5o2l3eTtGBtXek1OYlHrbcxOYugyHLmAsZrPj43OtHThd62Buh/Vv6VyCBD2bdyWcGNQqoQ==", "dev": true, "requires": { - "@types/glob": "^7.1.1", "array-union": "^2.1.0", "dir-glob": "^3.0.1", - "fast-glob": "^3.0.3", - "glob": "^7.1.3", - "ignore": "^5.1.1", - "merge2": "^1.2.3", + "fast-glob": "^3.1.1", + "ignore": "^5.1.4", + "merge2": "^1.3.0", "slash": "^3.0.0" } }, @@ -24247,6 +24245,22 @@ "universalify": "^0.1.0" } }, + "globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + } + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", diff --git a/package.json b/package.json index 1c0bfb5b..38b574f1 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "ethereum-waffle": "3.0.2", "ethereumjs-util": "7.0.2", "ethers": "5.0.8", + "globby": "^11.0.1", "husky": "^4.2.5", "lowdb": "1.0.0", "prettier": "^2.0.5", From c9df20f74d2c1e1eb2c5ca536fb7c1524c96b653 Mon Sep 17 00:00:00 2001 From: David Racero Date: Thu, 22 Oct 2020 11:27:45 +0200 Subject: [PATCH 11/38] Added .env support for docker-compose.yml. Add --verify again to package.json kovan script --- docker-compose.yml | 2 ++ package.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 61e4f178..a30c069a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,8 @@ version: '3.5' services: contracts-env: + env_file: + - .env build: context: ./ working_dir: /src diff --git a/package.json b/package.json index 38b574f1..576a4c78 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "aave:evm:dev:migration": "buidler aave:dev", "aave:evm:full:migration": "buidler aave:full", "aave:kovan:dev:migration": "npm run buidler:kovan -- aave:dev --verify", - "aave:kovan:full:migration": "npm run buidler:kovan -- aave:full", + "aave:kovan:full:migration": "npm run buidler:kovan -- aave:full --verify", "aave:ropsten:dev:migration": "npm run buidler:ropsten -- aave:dev --verify", "aave:ropsten:full:migration": "npm run buidler:ropsten -- aave:full --verify", "aave:main:dev:migration": "npm run buidler:main -- aave:dev --verify", From 8873b9cdacf9cf6f91327af84abb8a25fe751cb7 Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 22 Oct 2020 18:15:56 +0200 Subject: [PATCH 12/38] initial implementation --- contracts/interfaces/ILendingPool.sol | 8 +- contracts/lendingpool/LendingPool.sol | 91 +++++++++++-------- contracts/libraries/logic/ValidationLogic.sol | 8 +- 3 files changed, 63 insertions(+), 44 deletions(-) diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 2b4ead37..5271d6bd 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -270,10 +270,10 @@ interface ILendingPool { * @param referralCode the referral code of the caller **/ function flashLoan( - address receiver, - address reserve, - uint256 amount, - uint256 debtType, + address receiverAddress, + address[] calldata assets, + uint256[] calldata amounts, + uint256 mode, bytes calldata params, uint16 referralCode ) external; diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index c1ff20bb..cdf2be48 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -483,11 +483,9 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage } struct FlashLoanLocalVars { - uint256 premium; - uint256 amountPlusPremium; IFlashLoanReceiver receiver; - address aTokenAddress; address oracle; + ReserveLogic.InterestRateMode debtMode; } /** @@ -495,68 +493,83 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage * as long as the amount taken plus a fee is returned. NOTE There are security concerns for developers of flashloan receiver contracts * that must be kept into consideration. For further details please visit https://developers.aave.com * @param receiverAddress The address of the contract receiving the funds. The receiver should implement the IFlashLoanReceiver interface. - * @param asset The address of the principal reserve - * @param amount The amount requested for this flashloan + * @param assets The address of the principal reserve + * @param amounts The amount requested for this flashloan * @param mode Type of the debt to open if the flash loan is not returned. 0 -> Don't open any debt, just revert, 1 -> stable, 2 -> variable * @param params Variadic packed params to pass to the receiver as extra information * @param referralCode Referral code of the flash loan **/ function flashLoan( address receiverAddress, - address asset, - uint256 amount, + address[] calldata assets, + uint256[] calldata amounts, uint256 mode, bytes calldata params, uint16 referralCode ) external override { _whenNotPaused(); - ReserveLogic.ReserveData storage reserve = _reserves[asset]; + FlashLoanLocalVars memory vars; - vars.aTokenAddress = reserve.aTokenAddress; + ValidationLogic.validateFlashloan(assets, amounts, mode, vars.premium); - vars.premium = amount.mul(FLASHLOAN_PREMIUM_TOTAL).div(10000); - - ValidationLogic.validateFlashloan(mode, vars.premium); - - ReserveLogic.InterestRateMode debtMode = ReserveLogic.InterestRateMode(mode); + address[] memory aTokenAddresses = new address[](assets.length); + uint256[] memory premiums = new uint256[](assets.length); vars.receiver = IFlashLoanReceiver(receiverAddress); + vars.debtMode = ReserveLogic.InterestRateMode(mode); - //transfer funds to the receiver - IAToken(vars.aTokenAddress).transferUnderlyingTo(receiverAddress, amount); + for (uint256 i = 0; i < assets.length; i++) { + ReserveLogic.ReserveData storage reserve = _reserves[assets[i]]; + + aTokenAddresses[i] = reserve.aTokenAddress; + + premiums[i] = amounts[i].mul(FLASHLOAN_PREMIUM_TOTAL).div(10000); + + //transfer funds to the receiver + IAToken(vars.aTokenAddress).transferUnderlyingTo(receiverAddress, amounts[i]); + } //execute action of the receiver require( - vars.receiver.executeOperation(asset, amount, vars.premium, params), + vars.receiver.executeOperation(assets, amounts, premiums, params), Errors.INVALID_FLASH_LOAN_EXECUTOR_RETURN ); - vars.amountPlusPremium = amount.add(vars.premium); + for (uint256 i = 0; i < assets.length; i++) { + uint256 amountPlusPremium = amounts[i].add(premiums[i]); - if (debtMode == ReserveLogic.InterestRateMode.NONE) { - IERC20(asset).safeTransferFrom(receiverAddress, vars.aTokenAddress, vars.amountPlusPremium); + if (vars.debtMode == ReserveLogic.InterestRateMode.NONE) { + _reserves[assets[i]].updateState(); + _reserves[assets[i]].cumulateToLiquidityIndex( + IERC20(aTokenAddresses[i]).totalSupply(), + vars.premium + ); + _reserves[assets[i]].updateInterestRates(assets[i], aTokenAddresses[i], vars.premium, 0); - reserve.updateState(); - reserve.cumulateToLiquidityIndex(IERC20(vars.aTokenAddress).totalSupply(), vars.premium); - reserve.updateInterestRates(asset, vars.aTokenAddress, vars.premium, 0); + IERC20(assets[i]).safeTransferFrom( + receiverAddress, + vars.aTokenAddresses[i], + vars.amountPlusPremium + ); - emit FlashLoan(receiverAddress, asset, amount, vars.premium, referralCode); - } else { - //if the user didn't choose to return the funds, the system checks if there - //is enough collateral and eventually open a position - _executeBorrow( - ExecuteBorrowParams( - asset, - msg.sender, - msg.sender, - vars.amountPlusPremium, - mode, - vars.aTokenAddress, - referralCode, - false - ) - ); + emit FlashLoan(receiverAddress, assets[i], amounts[i], vars.premium, referralCode); + } else { + //if the user didn't choose to return the funds, the system checks if there + //is enough collateral and eventually open a position + _executeBorrow( + ExecuteBorrowParams( + assets[i], + msg.sender, + msg.sender, + amountPlusPremium, + vars.mode, + aTokenAddresses[i], + referralCode, + false + ) + ); + } } } diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index 93219ce8..838d43b7 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -329,9 +329,15 @@ library ValidationLogic { * @param mode the flashloan mode (0 = classic flashloan, 1 = open a stable rate loan, 2 = open a variable rate loan) * @param premium the premium paid on the flashloan **/ - function validateFlashloan(uint256 mode, uint256 premium) internal pure { + function validateFlashloan( + address[] memory assets, + address[] memory amounts, + uint256 mode, + uint256 premium + ) internal pure { require(premium > 0, Errors.REQUESTED_AMOUNT_TOO_SMALL); require(mode <= uint256(ReserveLogic.InterestRateMode.VARIABLE), Errors.INVALID_FLASHLOAN_MODE); + require(assets.length == amounts.length, Errors.INCONSISTENT_FLASHLOAN_PARAMS); } /** From d05a2d1c4fecb55c280a387340731ba11a51103b Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 22 Oct 2020 18:59:15 +0200 Subject: [PATCH 13/38] Rolled back PVE002, added further optimization --- contracts/libraries/math/WadRayMath.sol | 32 +- deployed-contracts.json | 88 +- test.log | 3077 ----------------------- 3 files changed, 52 insertions(+), 3145 deletions(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index c4001a71..949118c6 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -54,17 +54,13 @@ library WadRayMath { * @return the result of a*b, in wad **/ function wadMul(uint256 a, uint256 b) internal pure returns (uint256) { - if (a == 0 || b == 0) { + if (a == 0) { return 0; } - uint256 result = a * b; + uint256 result = a * b + halfWAD; - require(result / a == b, Errors.MULTIPLICATION_OVERFLOW); - - result += halfWAD; - - require(result >= halfWAD, Errors.ADDITION_OVERFLOW); + require((result - halfWAD) / a == b, Errors.MULTIPLICATION_OVERFLOW); return result / WAD; } @@ -102,17 +98,13 @@ library WadRayMath { * @return the result of a*b, in ray **/ function rayMul(uint256 a, uint256 b) internal pure returns (uint256) { - if (a == 0 || b == 0) { + if (a == 0) { return 0; } - uint256 result = a * b; + uint256 result = a * b + halfRAY; - require(result / a == b, Errors.MULTIPLICATION_OVERFLOW); - - result += halfRAY; - - require(result >= halfRAY, Errors.ADDITION_OVERFLOW); + require((result - halfRAY) / a == b, Errors.MULTIPLICATION_OVERFLOW); return result / RAY; } @@ -126,19 +118,11 @@ library WadRayMath { function rayDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.DIVISION_BY_ZERO); - if (a == 0) { - return 0; - } - uint256 halfB = b / 2; - uint256 result = a * RAY; + uint256 result = a * RAY + halfB; - require(result / RAY == a, Errors.MULTIPLICATION_OVERFLOW); - - result += halfB; - - require(result >= halfB, Errors.ADDITION_OVERFLOW); + require((result - halfB) / RAY == a, Errors.MULTIPLICATION_OVERFLOW); return result / b; } diff --git a/deployed-contracts.json b/deployed-contracts.json index 46423910..92647298 100644 --- a/deployed-contracts.json +++ b/deployed-contracts.json @@ -5,7 +5,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x58F132FBB86E21545A4Bace3C19f1C05d86d7A22", + "address": "0xAA6DfC2A802857Fadb75726B6166484e2c011cf5", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -19,7 +19,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xa4bcDF64Cdd5451b6ac3743B414124A6299B65FF", + "address": "0xFd23fD3d937ae73a7b545B8Bfeb218395bDe9b8f", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -37,7 +37,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x5A0773Ff307Bf7C71a832dBB5312237fD3437f9F", + "address": "0xE567BA007c79D491D585015c30c73BA7FfDAFaF0", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -73,7 +73,7 @@ "address": "0x6642B57e4265BAD868C17Fc1d1F4F88DBBA04Aa8" }, "localhost": { - "address": "0x65e0Cd5B8904A02f2e00BC6f58bf881998D54BDe" + "address": "0x81228BFb2fE916C0fF76bF4e12c165321BdF1CFB" }, "kovan": { "address": "0x50C9d3aD9399c1EEf6DDeadF8e57fF69994F552e" @@ -89,7 +89,7 @@ "address": "0xD9273d497eDBC967F39d419461CfcF382a0A822e" }, "localhost": { - "address": "0x5d12dDe3286D94E0d85F9D3B01B7099cfA0aBCf1" + "address": "0xE2302ab9A6754EfaA8Ea55eECA668bCE72d8a4FE" }, "kovan": { "address": "0x6d1e69bB0578699dd955Eefbf23aAC65c0DA5cE7" @@ -101,7 +101,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x1750499D05Ed1674d822430FB960d5F6731fDf64", + "address": "0x8720da7Bc69d35800937CD0CB2a88517Ab681a34", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -115,7 +115,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xEC1C93A9f6a9e18E97784c76aC52053587FcDB89", + "address": "0x3F1976472C22fb2bC05Ff74CF3d03E52b0FDD6b8", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -129,7 +129,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x7B6C3e5486D9e6959441ab554A889099eed76290", + "address": "0x804E98F470694629b5005b3B8f092B0188B2A770", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -147,7 +147,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xD83D2773a7873ae2b5f8Fb92097e20a8C64F691E", + "address": "0xdaE51d2e6C77C5EC035Ab3B2a8eEF552F74035d0", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -165,7 +165,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x626FdE749F9d499d3777320CAf29484B624ab84a", + "address": "0x4e92ed34740Ef54325D0382BeA1F433374e92593", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -223,7 +223,7 @@ "address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2" }, "localhost": { - "address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA" + "address": "0xaFc2D7E7f6915c053E257200D10BF53daCD37206" }, "coverage": { "address": "0x2B681757d757fbB80cc51c6094cEF5eE75bF55aA" @@ -235,7 +235,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10", + "address": "0x917873BDf56b8404b984e1D0946A9791fB8723ff", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -249,7 +249,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x7c2C195CD6D34B8F845992d380aADB2730bB9C6F", + "address": "0xda8D610DBF58CdbBd9FF63Cfd5d152d6aC03D827", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -263,7 +263,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x8858eeB3DfffA017D4BCE9801D340D36Cf895CCf", + "address": "0x230063F7a99684eCB09C0100B46e4ef52F790787", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -277,7 +277,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x0078371BDeDE8aAc7DeBfFf451B74c5EDB385Af7", + "address": "0x9357981b57000D78aE088D85D8B93aabd971E44c", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -291,7 +291,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xf4e77E5Da47AC3125140c470c71cBca77B5c638c", + "address": "0x347aB2276e45528d0869d98454dB85d0353289cc", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -305,7 +305,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x3619DbE27d7c1e7E91aA738697Ae7Bc5FC3eACA5", + "address": "0x2120a59e1800077C8dd0a60bB36315282d3AD73d", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -319,7 +319,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x038B86d9d8FAFdd0a02ebd1A476432877b0107C8", + "address": "0xAD8b260d4a55fa27D9611E32029b74CE4fBb43B7", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -333,7 +333,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x1A1FEe7EeD918BD762173e4dc5EfDB8a78C924A8", + "address": "0x15556f286eA3dc789b31d71058F236d3f84a8CdC", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -347,7 +347,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x500D1d6A4c7D8Ae28240b47c8FCde034D827fD5e", + "address": "0xc1D388F1b4a9448cC88249020D3Bb82588496aDD", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -361,7 +361,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xc4905364b78a742ccce7B890A89514061E47068D", + "address": "0x8AA4ef0B7069333d32e1a301c3e8867050Ce7dd4", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -375,7 +375,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xD6C850aeBFDC46D7F4c207e445cC0d6B0919BDBe", + "address": "0xFB2DB49aEfdfb4A1443D369F9707BF07EC200609", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -389,7 +389,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x8B5B7a6055E54a36fF574bbE40cf2eA68d5554b3", + "address": "0x231926CDdAf87b45382127E83b371D81dd3071dE", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -403,7 +403,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xEcc0a6dbC0bb4D51E4F84A315a9e5B0438cAD4f0", + "address": "0x3DBE70A3bE31C9Bd7EeE42F2d89e6D8BdbB60d9D", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -417,7 +417,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x20Ce94F404343aD2752A2D01b43fa407db9E0D00", + "address": "0x17CcC196687feD7693580e5C327C16623c1422aA", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -431,7 +431,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x1d80315fac6aBd3EfeEbE97dEc44461ba7556160", + "address": "0xa3C9636e8A83e9A20F17d6101D8f5fC19cFa5cF1", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -445,7 +445,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x2D8553F9ddA85A9B3259F6Bf26911364B85556F5", + "address": "0x7b3e185D7Dd72CB6a8e4f3b77f2afa9cc2986702", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -459,7 +459,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x52d3b94181f8654db2530b0fEe1B19173f519C52", + "address": "0x582e9540A4FCA6aF23543D10e274bFfC6A1C4bd0", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -473,7 +473,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xd15468525c35BDBC1eD8F2e09A00F8a173437f2f", + "address": "0x1380773F68a96A09181551658ae1F23EA5298339", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -487,7 +487,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x7e35Eaf7e8FBd7887ad538D4A38Df5BbD073814a", + "address": "0x0E512D4c480168bB354F9D70EfEe4c2779757Dc7", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -501,7 +501,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x5bcb88A0d20426e451332eE6C4324b0e663c50E0", + "address": "0x77607B1E8f05c2D80Ad209368F9d812a79E89D0a", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -515,7 +515,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x3521eF8AaB0323004A6dD8b03CE890F4Ea3A13f5", + "address": "0x86089a044275B66A8C01D31B5e234a2c4099DCcA", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -529,7 +529,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x53369fd4680FfE3DfF39Fc6DDa9CfbfD43daeA2E", + "address": "0x7B49a4DA95c3d8e3a308D9d550fd735285D2445b", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -543,7 +543,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xB00cC45B4a7d3e1FEE684cFc4417998A1c183e6d", + "address": "0xE3e60d4513d7A63a5C4EE91df71e92cfDd97ac89", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -557,7 +557,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x58F132FBB86E21545A4Bace3C19f1C05d86d7A22", + "address": "0xAA6DfC2A802857Fadb75726B6166484e2c011cf5", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -570,7 +570,7 @@ "address": "0xe7536f450378748E1BD4645D3c77ec38e0F3ba28" }, "localhost": { - "address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4" + "address": "0xAD4EA7747fF8C3ea98009B016280d3E5A93B71e4" }, "coverage": { "address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4" @@ -582,7 +582,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xB660Fdd109a95718cB9d20E3A89EE6cE342aDcB6", + "address": "0xc59Ff5B5Ed3F1aEF6e37ec21B5BfFA21bD7fb2D9", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -596,7 +596,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x830bceA96E56DBC1F8578f75fBaC0AF16B32A07d", + "address": "0xB6a7e0831d309e3dA99A4D169f0074910f047Dae", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -606,7 +606,7 @@ }, "AToken": { "localhost": { - "address": "0xA0AB1cB92A4AF81f84dCd258155B5c25D247b54E", + "address": "0x094D1D9DbA786f0cb1269e5Ddb3EfeB0d12d20c5", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "buidlerevm": { @@ -624,7 +624,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xa89E20284Bd638F31b0011D0fC754Fc9d2fa73e3", + "address": "0x5DbA865405aAEFe5bf9b77a877EA3956C92E309b", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -638,7 +638,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xf784709d2317D872237C4bC22f867d1BAe2913AB", + "address": "0xdA43fC20d88c77FdebE172b960f8eb1853a0A46F", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -652,7 +652,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0xaA935993065F2dDB1d13623B1941C7AEE3A60F23", + "address": "0x7AE7D25Ce30A48FED0bf4A5e86B46829EA73C69a", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -666,7 +666,7 @@ "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { - "address": "0x35A2624888e207e4B3434E9a9E250bF6Ee68FeA3", + "address": "0x031F94d0E0B894aa4458E3d34ceA141103641CDC", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "coverage": { @@ -682,7 +682,7 @@ "address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2" }, "localhost": { - "address": "0xBEF0d4b9c089a5883741fC14cbA352055f35DDA2" + "address": "0x48AbD2dBBbaA7466313963ea17804B3cBC2cA71f" } }, "MockFlashRepayAdapter": { diff --git a/test.log b/test.log index ca8c215e..e69de29b 100644 --- a/test.log +++ b/test.log @@ -1,3077 +0,0 @@ -Compiling... - - - - - - - - - - - - - - - - -Compiled 76 contracts successfully - --> Deploying test environment... -*** MintableERC20 *** - -Network: localhost -tx: 0x7fa031db361a2b22addc1542eb9dca3b16ddce863e1b52294c94ec3cf9ce1a82 -contract address: 0xbe66dC9DFEe580ED968403e35dF7b5159f873df8 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** DAI *** - -Network: localhost -tx: 0x7fa031db361a2b22addc1542eb9dca3b16ddce863e1b52294c94ec3cf9ce1a82 -contract address: 0xbe66dC9DFEe580ED968403e35dF7b5159f873df8 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xbfedacf9ef4b74c7e64c1b5cbb30142abcb758d2f75ebfb7afcbd8f64e985b8c -contract address: 0x93AfC6Df4bB8F62F2493B19e577f8382c0BA9EBC -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** LEND *** - -Network: localhost -tx: 0xbfedacf9ef4b74c7e64c1b5cbb30142abcb758d2f75ebfb7afcbd8f64e985b8c -contract address: 0x93AfC6Df4bB8F62F2493B19e577f8382c0BA9EBC -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x77fb425d1e7d898c3d9ef846acd4541625fa0b69caeb1c73a45e81925fa965a4 -contract address: 0x75Ded61646B5945BdDd0CD9a9Db7c8288DA6F810 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** TUSD *** - -Network: localhost -tx: 0x77fb425d1e7d898c3d9ef846acd4541625fa0b69caeb1c73a45e81925fa965a4 -contract address: 0x75Ded61646B5945BdDd0CD9a9Db7c8288DA6F810 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x9279772c3bd0cc7ff7229fac6a46e2a19c46ddd507d15026d758b77f8a9d1934 -contract address: 0xdE7c40e675bF1aA45c18cCbaEb9662B16b0Ddf7E -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** BAT *** - -Network: localhost -tx: 0x9279772c3bd0cc7ff7229fac6a46e2a19c46ddd507d15026d758b77f8a9d1934 -contract address: 0xdE7c40e675bF1aA45c18cCbaEb9662B16b0Ddf7E -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x6e201e503500ae5ee3b900a7a0970085b2d03e5702c1192ca07cb228d3dde9a9 -contract address: 0xEcb928A3c079a1696Aa5244779eEc3dE1717fACd -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** WETH *** - -Network: localhost -tx: 0x6e201e503500ae5ee3b900a7a0970085b2d03e5702c1192ca07cb228d3dde9a9 -contract address: 0xEcb928A3c079a1696Aa5244779eEc3dE1717fACd -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x8a2b86528542d7500abbb9af3712b6e2d93a70dccff69ad5fbcc74973be2f0c3 -contract address: 0xDFbeeed692AA81E7f86E72F7ACbEA2A1C4d63544 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** USDC *** - -Network: localhost -tx: 0x8a2b86528542d7500abbb9af3712b6e2d93a70dccff69ad5fbcc74973be2f0c3 -contract address: 0xDFbeeed692AA81E7f86E72F7ACbEA2A1C4d63544 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x759e5c27217595d2b42a14cabfd3fd66bdfe03d8c1976ffed978e3ddaa37bcba -contract address: 0x5191aA68c7dB195181Dd2441dBE23A48EA24b040 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** USDT *** - -Network: localhost -tx: 0x759e5c27217595d2b42a14cabfd3fd66bdfe03d8c1976ffed978e3ddaa37bcba -contract address: 0x5191aA68c7dB195181Dd2441dBE23A48EA24b040 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x5ea082d2b1c31d832663b08ac1d7ad4190415a8ea5b4994b406a793a2e3b9f06 -contract address: 0x8F9422aa37215c8b3D1Ea1674138107F84D68F26 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** SUSD *** - -Network: localhost -tx: 0x5ea082d2b1c31d832663b08ac1d7ad4190415a8ea5b4994b406a793a2e3b9f06 -contract address: 0x8F9422aa37215c8b3D1Ea1674138107F84D68F26 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xd44e0f48e38f7c216be9a16449efedfb231d7430a1c0fc3f8bcffdf7948ccfcf -contract address: 0xa89E20284Bd638F31b0011D0fC754Fc9d2fa73e3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** ZRX *** - -Network: localhost -tx: 0xd44e0f48e38f7c216be9a16449efedfb231d7430a1c0fc3f8bcffdf7948ccfcf -contract address: 0xa89E20284Bd638F31b0011D0fC754Fc9d2fa73e3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x239d5b4ae02e9b51640fc4b37e76d04e5a8d4d89583046744365d5c986a2b03e -contract address: 0xaA935993065F2dDB1d13623B1941C7AEE3A60F23 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MKR *** - -Network: localhost -tx: 0x239d5b4ae02e9b51640fc4b37e76d04e5a8d4d89583046744365d5c986a2b03e -contract address: 0xaA935993065F2dDB1d13623B1941C7AEE3A60F23 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xf04a9569ae24444f812d6e27087a159b9f2d8efd6af87530cb84dee7be87eb60 -contract address: 0x35A2624888e207e4B3434E9a9E250bF6Ee68FeA3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** WBTC *** - -Network: localhost -tx: 0xf04a9569ae24444f812d6e27087a159b9f2d8efd6af87530cb84dee7be87eb60 -contract address: 0x35A2624888e207e4B3434E9a9E250bF6Ee68FeA3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xd14a76002a7764f1942b286cdbd83a6c31c963a6536c11e245dd844c80bf2423 -contract address: 0x1f569c307949a908A4b8Ff7453a88Ca0b8D8df13 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** LINK *** - -Network: localhost -tx: 0xd14a76002a7764f1942b286cdbd83a6c31c963a6536c11e245dd844c80bf2423 -contract address: 0x1f569c307949a908A4b8Ff7453a88Ca0b8D8df13 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x3eff7433edc5c39c2f4023a61518e744c4b551fc459f9a7b6ab1ca549b779895 -contract address: 0x4301cb254CCc126B9eb9cbBE030C6FDA2FA16D4a -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** KNC *** - -Network: localhost -tx: 0x3eff7433edc5c39c2f4023a61518e744c4b551fc459f9a7b6ab1ca549b779895 -contract address: 0x4301cb254CCc126B9eb9cbBE030C6FDA2FA16D4a -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x264fbe1fd2c4bd18b3e256411d085b30f34386ae6a4566a0b2f0d0c04e6bec88 -contract address: 0x0766c9592a8686CAB0081b4f35449462c6e82F11 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MANA *** - -Network: localhost -tx: 0x264fbe1fd2c4bd18b3e256411d085b30f34386ae6a4566a0b2f0d0c04e6bec88 -contract address: 0x0766c9592a8686CAB0081b4f35449462c6e82F11 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xf7f19edbb06b36151a13ed1730693bda0470274d911b3017bb05a6e17959ba80 -contract address: 0xaF6D34adD35E1A565be4539E4d1069c48A49C953 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** REP *** - -Network: localhost -tx: 0xf7f19edbb06b36151a13ed1730693bda0470274d911b3017bb05a6e17959ba80 -contract address: 0xaF6D34adD35E1A565be4539E4d1069c48A49C953 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x609c4f2e84f0f979bed72c3fabc665e49917afc02cccd616223eaaa597a0064c -contract address: 0x48bb3E35D2D6994374db457a6Bf61de2d9cC8E49 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** SNX *** - -Network: localhost -tx: 0x609c4f2e84f0f979bed72c3fabc665e49917afc02cccd616223eaaa597a0064c -contract address: 0x48bb3E35D2D6994374db457a6Bf61de2d9cC8E49 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xdaa890cf86da34cfd100482d0245d86acb9521c435fb6b6606dd5af05be05b0e -contract address: 0x1E59BA56B1F61c3Ee946D8c7e2994B4A9b0cA45C -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** BUSD *** - -Network: localhost -tx: 0xdaa890cf86da34cfd100482d0245d86acb9521c435fb6b6606dd5af05be05b0e -contract address: 0x1E59BA56B1F61c3Ee946D8c7e2994B4A9b0cA45C -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770555 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x34072a8a7ddff91366675c0443c6ed4a56f4ea38284d959ba5cac87d9176559d -contract address: 0x53813198c75959DDB604462831d8989C29152164 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** USD *** - -Network: localhost -tx: 0x34072a8a7ddff91366675c0443c6ed4a56f4ea38284d959ba5cac87d9176559d -contract address: 0x53813198c75959DDB604462831d8989C29152164 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3770435 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0xd9d0b27927d9ea1d6e01a0b3ab30ad5fff8b1fee863170c0e09bba3164473c86 -contract address: 0x0eD6115873ce6B807a03FE0df1f940387779b729 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771395 - -****** - -*** UNI_DAI_ETH *** - -Network: localhost -tx: 0xd9d0b27927d9ea1d6e01a0b3ab30ad5fff8b1fee863170c0e09bba3164473c86 -contract address: 0x0eD6115873ce6B807a03FE0df1f940387779b729 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771395 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x7108f6a2b5d09c345cef81faed01768eebc82e88cfca411f19ff89d67f39d155 -contract address: 0xFFfDa24e7E3d5F89a24278f53d6f0F81B3bE0d6B -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** UNI_USDC_ETH *** - -Network: localhost -tx: 0x7108f6a2b5d09c345cef81faed01768eebc82e88cfca411f19ff89d67f39d155 -contract address: 0xFFfDa24e7E3d5F89a24278f53d6f0F81B3bE0d6B -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x711140cdc325fa89a8fc7c57d40398135dbafbb8386a9714ac9406c097d7f5e1 -contract address: 0x5889354f21A1C8D8D2f82669d778f6Dab778B519 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** UNI_SETH_ETH *** - -Network: localhost -tx: 0x711140cdc325fa89a8fc7c57d40398135dbafbb8386a9714ac9406c097d7f5e1 -contract address: 0x5889354f21A1C8D8D2f82669d778f6Dab778B519 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x96e564062931f9f5b4dfec6ff64447d1413db8b199f777e40ef49b6f4cf74e42 -contract address: 0x09F7bF33B3F8922268B34103af3a8AF83148C9B1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** UNI_LINK_ETH *** - -Network: localhost -tx: 0x96e564062931f9f5b4dfec6ff64447d1413db8b199f777e40ef49b6f4cf74e42 -contract address: 0x09F7bF33B3F8922268B34103af3a8AF83148C9B1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x7e85b4e591d15586638a15aa1585d01b53792cffbb9e88f2858e86c401eb3563 -contract address: 0x8f3966F7d53Fd5f12b701C8835e1e32541613869 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771395 - -****** - -*** UNI_MKR_ETH *** - -Network: localhost -tx: 0x7e85b4e591d15586638a15aa1585d01b53792cffbb9e88f2858e86c401eb3563 -contract address: 0x8f3966F7d53Fd5f12b701C8835e1e32541613869 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771395 - -****** - -*** MintableERC20 *** - -Network: localhost -tx: 0x3a490bd7d0486d2de64b06bdfe5cbc71cf68360015175f695f765ffbdaa0db73 -contract address: 0x9Dc554694756dC303a087e04bA6918C333Bc26a7 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** UNI_LEND_ETH *** - -Network: localhost -tx: 0x3a490bd7d0486d2de64b06bdfe5cbc71cf68360015175f695f765ffbdaa0db73 -contract address: 0x9Dc554694756dC303a087e04bA6918C333Bc26a7 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3771515 - -****** - -*** LendingPoolAddressesProvider *** - -Network: localhost -tx: 0xe9232d3aec0076f72b4dece0ec89cbc78a8373e4abf5561b0a5008887622851b -contract address: 0xAfC307938C1c0035942c141c31524504c89Aaa8B -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6959345 - -****** - -*** LendingPoolAddressesProviderRegistry *** - -Network: localhost -tx: 0x3e67f200a858db6eb7fb8e1fd5939782b89d45fd82e40900fdf16d11da8e2d1b -contract address: 0x73DE1e0ab6A5C221258703bc546E0CAAcCc6EC87 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 2515695 - -****** - -Deployed lending pool, address: 0xD2720591186c6DCf1DaCE6FAF262f3eB595317C5 -Added pool to addresses provider -Address is 0x5d12dDe3286D94E0d85F9D3B01B7099cfA0aBCf1 -implementation set, address: 0x5d12dDe3286D94E0d85F9D3B01B7099cfA0aBCf1 -*** LendingPoolConfigurator *** - -Network: localhost -tx: 0xf708c6f21e3ea0ce6d809ecc76fbf2682b9bb398681aebb58942712dfc5fdc01 -contract address: 0xa7a62540B8F2a0C1e091e734E261d13fd9a2B226 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** PriceOracle *** - -Network: localhost -tx: 0x76a61118b12b1416a6a75626cf23450a5e9a00e561b99c992719e549e619f000 -contract address: 0xbeA90474c2F3C7c43bC7c36CaAf5272c927Af5a1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 767525 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x0e04f73e5593e0ae08c773127c7659a847c7c9cfbbe870b5b8169807ab7390d9 -contract address: 0xa191baa1E96FeFE2b700C536E245725F09717275 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524490 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x9240496d0be4193febdb3233ecdd21b90f3d2e93e76d814d5d541f6b16015ae8 -contract address: 0xbD51e397Aa5012aa91628f0354f9670805BfA94E -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x5e8af233bf52b883a0c4e7a2dfbd962649954d8ef4ad3e6cffba9c966887a1e8 -contract address: 0xFc40e47aFD52bD460D65B06c828E54A13d288CE4 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xaa3066730f7ebd39de215205a768145fd99e65157d871d0c640f79f2eaf440ad -contract address: 0x5795a1e56931bB7Fb8389821f3574983502A785d -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x8d9500b1f7bc9e00ebf25c25b81fb93603eca6a4ac1c6a23559873944ee873ca -contract address: 0x715Ad5d800535dB0d334F9F42e3eC393947996e3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524490 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xe4019cc104e2ff38106e730db33f74a256d59327614b2f9c3f4dd847ec53ff0e -contract address: 0xC452C5244F701108B4e8E8BCe693160046b30332 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524490 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x5864636182a83ef038a4aa03551d9a1327ca7f6964e25b023bc32dc823000246 -contract address: 0x0B63c002cb44B2e5e580C3B3560a27F4101D95c0 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x4c7e8f67718f9ef15d31e9527499897c6defbe50e91ccbf28d324e37f3936105 -contract address: 0x3F80d60280cc4AdF3e5891765b5545A6B36ebe57 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524490 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xbbf4865f658e69a60041983d174c53c77d2132e6e498e64efe27434f03c3a911 -contract address: 0xCeB290A2C6614BF23B2faa0f0B8067F29C48DB0F -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xfb956a1da74bf9ac7dd6daee9929a48bb6954730310a45d7a0e005dc7ff997ff -contract address: 0x90ee8009AA6add17A0de8Ee22666a91602fa4adf -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xcc9a2257abeaeecd6fa045901912802ade13c615974e0b22db1eaaf1a3ba1cf3 -contract address: 0xc5BeCE9e44E7dE5464f102f6cD4e5b7aBC94B059 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524550 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x8e1d91a3cca76bb345ad3b61df570df661418dba282d4bc5a0e3879170ef8b9d -contract address: 0xF63EA31f84CFF5D1Eb4b8C3ca0D9489490fB98d5 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x63dc4fbb424450404f66b100c36cb33dd3e2efc1d73da8f386e8869ad1d68151 -contract address: 0xD8f534d97D241Fc9EC4A224C90BDD5E3F3990874 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524370 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x82e4360e3ed1913609f51a2e80cee06aa9df2ebb9292f5f3abacf24aff0e686d -contract address: 0xDCAB55FBf59a253B3Fb0CD2Ba45F0c02413dF375 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524370 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xf1da3e37ee20e209ccdd756fa2e07a2be9d01bf7675dea41309a2a56ff96c9b5 -contract address: 0x293965D84cE150Cbf5F36332ba47e997e2763bf2 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x8ae4fb0d23dec3b653f720bae0a4eb0538f17a88dde2d596b7e78928a121e076 -contract address: 0x3CADfB3f580F805658B747057E2Cf4E570bA378A -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x01a1c77c94c1c43e927bf5090b25ec4826a32801cfa55fb0b97d2d50c04e2f0e -contract address: 0x7549d6bb05083613eF87b723595553dCc570Ca21 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xb240c91e88558e87d3be7b5c9c312c18eb3679144d2a0f3af8d7c1d053648cc4 -contract address: 0xd28bf46B340fD3ad0c3dBD979BbE6D1663F41D80 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xfc87e10978edcdf0db0d9c5d5240e4db1d9e0567abe0a8047fe1f7ca28da2815 -contract address: 0xdd008b1A40e43ABD51C7Ba41c1F810aA77b77D22 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xe5991391fac8afd904b94215614914404dd1acb81cb46c9a679c0adfff1894ef -contract address: 0x23F06e0ECec7ecDb9cf204FAA35C284B51B31C0e -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xaeb4931c1d026a8d162c2c019d5d4ac6d667f78b34c714fd56ffeb01c7ebed92 -contract address: 0x9e63e23026BfA85E2BCdb6e81eF78c71071b6016 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x1bd7ec12d77551e8af98729fea7cfd251eb14641724b6a0216fb307af7cfa26a -contract address: 0x4EfDBAb487985C09d3be2E7d2B8e98cc09A9757b -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0x84dd9d9906a51b08c845eba64c05e708064c351f17ae10a127efd6ff479cdf85 -contract address: 0xAbA65A243A64622eA13382160d410F269Cd63eC1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** MockAggregator *** - -Network: localhost -tx: 0xa83c9fb3b2af5858ad72e5323e311bbeafde65b930ded1418006e4e660bf6f38 -contract address: 0x19E42cA990cF697D3dda0e59131215C43bB6989F -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 524430 - -****** - -*** ChainlinkProxyPriceProvider *** - -Network: localhost -tx: 0x0d084d72f9d6b20a27654ff6612be6cd271b1d7f5442399e0d7872ec5a0a480d -contract address: 0xE30c3983E51bC9d6baE3E9437710a1459e21e81F -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6255480 - -****** - -*** LendingRateOracle *** - -Network: localhost -tx: 0xff049fb48683766195e7de8b648f8a805bc1c76e12cfc8811dbc46b40308908e -contract address: 0xDf69898e844197a24C658CcF9fD53dF15948dc8b -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 1720040 - -****** - -Initialize configuration -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x7f2393d8b55ddd4f0bdf96dd1ae30cab9d26935db6bdfa9943ce54c69bfe3eaf -contract address: 0x303CEAFd0aF91A63576FF7dEFc01E66ca2D19E3a -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xe4bacd3cf0bb45f3e03d8a99036b4a77bf70ac220ec8635d7be130c83805f2ca -contract address: 0x168ef56fCb0382f4808497C9570434684657A9D3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x1bd0700a586883870734011f942a2c0ec8af12431c2e4a20ed83f7127a319330 -contract address: 0x5366cD335B002b009304Dc74a21EC97e94510177 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0x97b28bbdc29f1bf73d223aac5ce6a3298175135ae0089d0189a1a6748c3b36ff -contract address: 0x8821b8e3000629f2c43BB99A092f6687366592F0 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x696fd437c7b45c15abe1e7c35d71915e74c2f8ba5ce76fdafcc03a0b72e1e6b8 -contract address: 0x3E447b144e446558c2467d95FcF17Eaee9d704Bf -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xfe8ce2454ff8599e9c3bd21d1b4805b854875a1f1525abbe48b5bf7a1ed19f1b -contract address: 0x6452dDB1f891be0426b6B519E461a777aeAe2E9d -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x24c25ca9ebb2588733588d07e05e6e74cd617c417296ac046c2d12fdc0b95e9d -contract address: 0x6174769FBbC16D956a7bf70c3Ae7283341CAe3B6 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x469a3347ec96fad195e41b5d62b21d2cf8ff0d603f0f2c62b0fada2ae09727a0 -contract address: 0x9e498c2dF52Efdd649140417E405B9DeedcfEbE1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x2e78bf0b216139babb6e33aea0ffbe3e165124e551e4131664f9f0717cdd4f2a -contract address: 0x184E5376484c2728e7A2cb4E7f2c1975f4a177dA -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xb40b0345dc8645ccd2de39cec597afa889d61d337c83d98402848e20650f0b57 -contract address: 0x23Fa899d0b780f2f439354DcdC325ff738d1234d -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x68079ed8c90d74997e59e47b4e99119f374f59793c5245e4a9254373042bbff3 -contract address: 0x398A7a447E4D9007Fa1A5F82F2D07F0B369bD26f -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x297d99eb0ebb373ac4d6aedb1d973974aaaf398c2fb2cb9b7ad6c1a523078a5b -contract address: 0xc9ffDd024B01AcE9B8ee692b85797593ddd25eBb -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x29d94602d60b38369651722227f15226632a76aeb8225b3e7c20761ed8935d4e -contract address: 0x8A054E7463937F7bf914B2a0C6C1a9D7348f32d9 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x8e926fd7735088a84c0253e4c0fc852d56f7b875bf497014f296c054c9382d50 -contract address: 0x9cbEE5c0A6178F61dcD57C3b21180C8602aBdAc1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x8713a3ce634d0280113197ed918c57ecb508ab053e8d6d562c9e54659abed5bc -contract address: 0xdE00B3eb5e9F867eE45F9B9E5aF0d102Fe6A093f -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x25e4771fd18e0bfbd9caabbba1c1ea0439705770362752945f567aec663aacea -contract address: 0x3Eb52adc2294219C9A8F27C6a0BCcBBBEEeB0637 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x4ee8cad51cbfc07c56566826a77c12c07213bd5799200257bfcbbb5274654f9e -contract address: 0x1b59Cd56B9D76CF3FFE0b8671164Fbe7ACA33164 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x48074d32ee1aa4263ffd99c906205b2cb211085ef64b6593b6c869e073feb20b -contract address: 0xEC828976783079948F5DfAc8e61de6a895EB59D2 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x6082f47e348f616bf616739250d90c768d1638e599d52736942af94f093560a4 -contract address: 0xbA81aEa1F2b60dF39a96952FfbE121A0c82dc590 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0xd685996cbfaee73738b4435112642be71a62bd5150b7622060d29a5bc10e86a2 -contract address: 0xdB70141346347383D8e01c565E74b1a607f3Dd05 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x89c15e0f7e757ea6bb08a253ee7aeff7977641fc163e8063e15f714aa207f0cc -contract address: 0x3597899d1c79b516D724b33c6b5e404dCdD45Da1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x42a31cd5ec3a1a0616b2dcca2d6178f436454fc2ba7d4cd4c86daae9f0d8b724 -contract address: 0xc489495Ad73C2E75fbBA3916df7BD186F6b1696F -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x0213cc4f1faf661fdc368dd513afbfd94743d931a3501d0df5d1ebc2629653d2 -contract address: 0xf77136FA9c9280c3bBCA29a431B770AD04BE0aE3 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x540c880640831ce39ae7be3f870f96a68fe64d5b77b4e5fb57a03b428faf3f19 -contract address: 0x1FB3ccD743653c4f8533268fFe4a9a9DA97db500 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0xea49a43b755144530500ffb8b8001b88558831737543deb69a451d0e5850e63d -contract address: 0x54f9224C1A99951ABc0A7e843CE19a92dFA2E3c4 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xf85b360885516da2a05f4ec85a0a29861caac0a8d11ac0225d5d2e1b80d5ebb0 -contract address: 0xf62D2373BAbb096EF4f7dc508e5c153c73dD9CfE -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x496c3e75abb9d525d1d38888324a42615a52975871565b6dcdefb70aca47d508 -contract address: 0x662b3D8C8Dc691C46334bcB2229336063e3c2487 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0x37edd828c08b60bc80c517b50fc90f8218623c65e844a2db67e8748e50f9cb5e -contract address: 0xEa02aebdf8DccbD3bf2BaA9eeBa48b0275D370b8 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x1370094924d5683d96bed3dcf4331597eada7653b9dca5f15cee62184a134de1 -contract address: 0x5a3343A0CF72dC6933362676Bb5831784CaA0014 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x4617c93975b1b7681079d512168203358d18890f610b7bcb51c98748732d0b78 -contract address: 0xbC15a5eEA769cfB4BA6d7574c9942f0b8C40Ae03 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0xefa498d1e69d9fe6409a50b3aa506a592b807e94dddd1f21aea2cd7de547dd8f -contract address: 0x3c3AB51fF33032159e82E1FDEe6503dEd082F1d9 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0xe80eca2e4658c64f6398e96298cefbb500fc9022a0fcffe444c310fbf6492911 -contract address: 0x2d17b3E44e413F1fDa30E569895863EeD139CE6B -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x12bd37e159dabe8a4841f79d966ba2c38d83da6c82227045ab65f0a19bb157b9 -contract address: 0x09e2af829b1C36A6A8876925D1557C0FA1FF7eF5 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xbda59242e7edfa65c64d898da377e5db00fba42d5f0f0bce70f9967e460aec7b -contract address: 0x64179c836DD6D887034e14be49c912d166786534 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0xdba8d42783dad76edf7623d93ca8720c94a246f2916f683577de0a94abea5eeb -contract address: 0x912e47ab2257B0fE50516444bb6a12CffaCFA322 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x994d41b318faa0d04d5e6475ec1c3faccd4670022897c77e2e10c6f87ff5d514 -contract address: 0x29f65c17aD1e6D6b3C99aE80093E4Bf382fA0F69 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x0d4d2be3095a1aa2ec941bad0e6d41ce8de15cd8354d0cd56fa3d919c167d49e -contract address: 0xD4991960dB15FFd68cc78AAAF42dcC0B7ccb6459 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xd32a1b9b1413871a3001c6e8ba0a9e4ef2a83c4ab09f28194e20befcd9e25090 -contract address: 0xAB45290275E6970b7B76FbaC8b39619EE05D0B69 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x3cf245cc6e80e8b0e47af13b6a48e7784236c6f06be28a566c3f6f4b6edf4122 -contract address: 0xb1c9e66a9064208a930e446811aBE8f4c24310e0 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0xe794f12c3bd49d9118d9ad2cf14efc0afaad2c4b3ae746f1aceb9c375840db48 -contract address: 0x4dab1e43593c3045D3FCb1eEaBBE839C16F12dA6 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0xc2db0defdfaf772c832b78fa1adb471d831ac9f2dd44f0c9829abc6136e90ce6 -contract address: 0x62650cE1014A9880f8651f5b4ADB3314F339Dc3b -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x8065c8f31a805076424b8f6bc16b7d8fb38e3e6ee105d73b798f73bb0f8038d2 -contract address: 0x43d8f4f99eCEE76977B75F1659ad34d6A7652c93 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x0f409992c4dcbd92e3fd2c2fca0ce635d82ce9dfa400dc7cf118be901918b331 -contract address: 0x5fc30A361D6dDf1dBa00b4D86aC2EBBe265E76fc -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0x1b2509cbaa127b8d6b76a64c38c66a035ad59f69e3adddd9a5180f3297c47b9b -contract address: 0x2f77845F39273850bf6d734e21c0D8E7bdfF50F8 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0xc8572498fec572951914dc2e1558c8834da00750856e80964504270cc6971e16 -contract address: 0x739e654a4550FC22652eFD4d91fF3bf982bEDA4d -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x152777a73df721c0de6d51a4118e8a492d25275e25757653c4f2267e7976ade0 -contract address: 0x708e2B13F6EB3f62686BAC1795c1e3C09e91eEaF -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x5450edbf0e2695bf4add1f68970ba7b01fc13206a27f0833f3e882eff515b802 -contract address: 0x7c888989D880597456a250098e8F57B0686A2B29 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0xd1931ba728e39a704c7fc1fdc0f87af362ed4e56384e828ad679607b182cf3f3 -contract address: 0x65df659Be90a49356a33458d806d9dE3d8F03969 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x77ba9383e9e5b2960c06e763cd6af1219b5de6c18d91f9013bd69f7f03e06343 -contract address: 0xE5464F611113932335B397Eb0dD1601a896005C6 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0x81358741e66b74a3238e9781bd0fb634fee8ffce2a914d82dcba0a591d4f7430 -contract address: 0xF0cDB2EcE3A2188048b79B1f94b434c594B807fB -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0xe4552f83561f339dabcbbbeededbb56ccb1ab4d5fcf1ddfa2135982cf246985a -contract address: 0x9D8Ae53F3D152a668C7c2d7a6cB37FdD9aF38285 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0x748c940099df36aae3b2b10368e70bde62e3e3dbe45ca55e7d5033f44f779a1d -contract address: 0x7C95b1ad025F0C9aB14192f87bF2aD53889bE4F7 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0xf4f55e9354a916fa5b9549b681025a341502d384d2f77645cf0f4060e0d1e637 -contract address: 0x9bD0Bec44106D8Ea8fFb6296d7A84742a290E064 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xc40f435954d1fc3a8ad096e084a83b05647c26b0bbe9f32fee215bbfb8d4e9e8 -contract address: 0x00f126cCA2266bFb634Ed6DB17c4C74fb8cA5177 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0xab44990260fe38bf2b4fc6cf1100f3aad1326eb3e9cb415e5cb65f69102e6ba2 -contract address: 0x34Ac3eB6180FdD94043664C22043F004734Dc480 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x667372a46626f30abeebcf4516685a8417975a73478090f6083b0dc58eaef381 -contract address: 0x04dE7A5bCCf369cb28AB389BfD7a6262E870B0a6 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0xffecfe6215cd8137e3ba605236c39278b56592675dc35a802d53de8b5378005b -contract address: 0xC9366C94D1760624DFa702Ee99a04E9f6271Aa70 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3276945 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xe9c01fb60c1d3d74881c2833d199081cca4c4fa57701855d63c479c4a1006bc4 -contract address: 0xd405FD3185d05Ed8ba637C1C1ae772F9916A4F49 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425430 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x13deded53ea75d1a7fae2ea5e517dcb2ec6501dd72847bfdf4d293929400ed11 -contract address: 0x54F1df7dB2E46dbeF18CF97A376b79108166fa36 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936830 - -****** - -*** AToken *** - -Network: localhost -tx: 0x3f8f8ec47ba5d1c5e02a248086dea3eac1a72367cc5f4a730e61afe787d444cf -contract address: 0xF778f628abF1C0E17618077bAEA4FDA95D334136 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x1f791622f6dd6ee0e3ca7369a05f94de5ac9ad34758400c20bb62d720c52bdcc -contract address: 0x267B07Fd1032e9A4e10dBF2600C8407ee6CA1e8c -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xbc9d4ce2f71b60a86e0936a9eccd7990fa8ed5731d53c2e0961fd8ce42b4ec3b -contract address: 0x61751f72Fa303F3bB256707dD3cD368c89E82f1b -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425490 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x7af317b3ebd94924badd8b088357a9c144aa99243bb8a48de6b23cfdbc41e1b9 -contract address: 0x2E10b24b10692fa972510051A1e296D4535043ad -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6936890 - -****** - -*** AToken *** - -Network: localhost -tx: 0x901aedab1094e416b81636292fd3df29b6e73aeb794526a728843bd4ff9c8ec2 -contract address: 0x99245fC7F2d63e1b09EE1b89f0861dcD09e7a4C1 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** DefaultReserveInterestRateStrategy *** - -Network: localhost -tx: 0x3fa610059efa2c6228780079b05e9d200fe986a7a6a48911278cb52e461b9e8f -contract address: 0xBe6d8642382C241c9B4B50c89574DbF3f4181E7D -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 3277425 - -****** - -*** StableDebtToken *** - -Network: localhost -tx: 0xc1af9ee6909ed0d6e2a5ff0deef43dbbdd0e85dfabeb20bb60f67f27b28a758c -contract address: 0x02BB514187B830d6A2111197cd7D8cb60650B970 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7425610 - -****** - -*** VariableDebtToken *** - -Network: localhost -tx: 0x6612bc1ec1d383ce25143b2cb399480c4f76996b218d1150e8407fdf46520593 -contract address: 0x6774Ce86Abf5EBB22E9F45b5f55daCbB4170aD7f -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 6937010 - -****** - -*** AToken *** - -Network: localhost -tx: 0x99665e44ce3b98d3f39d6ed1bc18bbc2705109a8b5f54b36dca59e1cf3e928a0 -contract address: 0x007C1a44e85bDa8F562F916685A9DC8BdC6542bF -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** MockFlashLoanReceiver *** - -Network: localhost -tx: 0x04999d6cad119214e028099ca819a45a5f26cf5c523de92e83701bf79575f08d -contract address: 0xAd49512dFBaD6fc13D67d3935283c0606812E962 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 1872305 - -****** - -*** MockSwapAdapter *** - -Network: localhost -tx: 0xfd8e8e01a41ef55102549e5e4489b6dfe5405233a722d5913758517b3d50b53b -contract address: 0x749258D38b0473d96FEcc14cC5e7DCE12d7Bd6f6 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 1895365 - -****** - -*** WalletBalanceProvider *** - -Network: localhost -tx: 0xf36d7aaae62638f3e44de25aa1df006a96928b6459a7a3d2b80ed79e11ce190a -contract address: 0xA29C2A7e59aa49C71aF084695337E3AA5e820758 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 2512320 - -****** - -*** AaveProtocolTestHelpers *** - -Network: localhost -tx: 0x6f1847e62f402f758eaa6dfaa62f318688f8822c5090cd57157d13da892cc489 -contract address: 0x9305d862ee95a899b83906Cd9CB666aC269E5f66 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 2838385 - -****** - -setup: 22.427s -Pool loaded -Configurator loaded - -*************** -Setup and snapshot finished -*************** - - AToken: Modifiers - ✓ Tries to invoke mint not being the LendingPool - ✓ Tries to invoke burn not being the LendingPool - ✓ Tries to invoke transferOnLiquidation not being the LendingPool - ✓ Tries to invoke transferUnderlyingTo not being the LendingPool - - AToken: Transfer - ✓ User 0 deposits 1000 DAI, transfers to user 1 - ✓ User 0 deposits 1 WETH and user 1 tries to borrow, but the aTokens received as a transfer are not available as collateral (revert expected) - ✓ User 1 sets the DAI as collateral and borrows, tries to transfer everything back to user 0 (revert expected) - - LendingPoolConfigurator - - 1) Deactivates the ETH reserve - ✓ Rectivates the ETH reserve - ✓ Check the onlyLendingPoolManager on deactivateReserve - ✓ Check the onlyLendingPoolManager on activateReserve - ✓ Freezes the ETH reserve - ✓ Unfreezes the ETH reserve - ✓ Check the onlyLendingPoolManager on freezeReserve - ✓ Check the onlyLendingPoolManager on unfreezeReserve - ✓ Deactivates the ETH reserve for borrowing - ✓ Activates the ETH reserve for borrowing - ✓ Check the onlyLendingPoolManager on disableBorrowingOnReserve - ✓ Check the onlyLendingPoolManager on enableBorrowingOnReserve - ✓ Deactivates the ETH reserve as collateral - ✓ Activates the ETH reserve as collateral - ✓ Check the onlyLendingPoolManager on disableReserveAsCollateral - ✓ Check the onlyLendingPoolManager on enableReserveAsCollateral - ✓ Disable stable borrow rate on the ETH reserve - ✓ Enables stable borrow rate on the ETH reserve - ✓ Check the onlyLendingPoolManager on disableReserveStableRate - ✓ Check the onlyLendingPoolManager on enableReserveStableRate - ✓ Changes LTV of the reserve - ✓ Check the onlyLendingPoolManager on setLtv - ✓ Changes liquidation threshold of the reserve - ✓ Check the onlyLendingPoolManager on setLiquidationThreshold - ✓ Changes liquidation bonus of the reserve - ✓ Check the onlyLendingPoolManager on setLiquidationBonus - ✓ Check the onlyLendingPoolManager on setReserveDecimals - ✓ Check the onlyLendingPoolManager on setLiquidationBonus - ✓ Reverts when trying to disable the DAI reserve with liquidity on it - - LendingPool. repayWithCollateral() - ✓ User 1 provides some liquidity for others to borrow - ✓ User 2 deposit WETH and borrows DAI at Variable - ✓ It is not possible to do reentrancy on repayWithCollateral() - - 2) User 2 tries to repay his DAI Variable loan using his WETH collateral. First half the amount, after that, the rest - - 3) User 3 deposits WETH and borrows USDC at Variable - - 4) User 3 repays completely his USDC loan by swapping his WETH collateral - ✓ Revert expected. User 3 tries to repay with his collateral a currency he havent borrow - - 5) User 3 tries to repay with his collateral all his variable debt and part of the stable - - 6) User 4 tries to repay a bigger amount that what can be swapped of a particular collateral, repaying only the maximum allowed by that collateral - ✓ User 5 deposits WETH and DAI, then borrows USDC at Variable, then disables WETH as collateral - - 7) User 5 tries to repay his USDC loan by swapping his WETH collateral, should not revert even with WETH collateral disabled - - LendingPool. repayWithCollateral() with liquidator - ✓ User 1 provides some liquidity for others to borrow - - 8) User 5 liquidate User 3 collateral, all his variable debt and part of the stable - ✓ User 3 deposits WETH and borrows USDC at Variable - - 9) User 5 liquidates half the USDC loan of User 3 by swapping his WETH collateral - ✓ Revert expected. User 5 tries to liquidate an User 3 collateral a currency he havent borrow - - 10) User 5 liquidates all the USDC loan of User 3 by swapping his WETH collateral - ✓ User 2 deposit WETH and borrows DAI at Variable - - 11) It is not possible to do reentrancy on repayWithCollateral() - ✓ User 5 tries to liquidate User 2 DAI Variable loan using his WETH collateral, with good HF - - 12) User 5 liquidates User 2 DAI Variable loan using his WETH collateral, half the amount - - 13) User 2 tries to repay remaining DAI Variable loan using his WETH collateral - - 14) Liquidator tries to repay 4 user a bigger amount that what can be swapped of a particular collateral, repaying only the maximum allowed by that collateral - - 15) User 5 deposits WETH and DAI, then borrows USDC at Variable, then disables WETH as collateral - - 16) Liquidator tries to liquidates User 5 USDC loan by swapping his WETH collateral, should revert due WETH collateral disabled - - LendingPool FlashLoan function - ✓ Deposits ETH into the reserve - - 17) Takes WETH flashloan with mode = 0, returns the funds correctly - - 18) Takes an ETH flashloan with mode = 0 as big as the available liquidity - ✓ Takes WETH flashloan, does not return the funds with mode = 0. (revert expected) - ✓ Takes a WETH flashloan with an invalid mode. (revert expected) - - 19) Caller deposits 1000 DAI as collateral, Takes WETH flashloan with mode = 2, does not return the funds. A variable loan for caller is created - ✓ tries to take a very small flashloan, which would result in 0 fees (revert expected) - - 20) tries to take a flashloan that is bigger than the available liquidity (revert expected) - ✓ tries to take a flashloan using a non contract address as receiver (revert expected) - ✓ Deposits USDC into the reserve - - 21) Takes out a 500 USDC flashloan, returns the funds correctly - - 22) Takes out a 500 USDC flashloan with mode = 0, does not return the funds. (revert expected) - - 23) Caller deposits 5 WETH as collateral, Takes a USDC flashloan with mode = 2, does not return the funds. A loan for caller is created - ✓ Caller deposits 1000 DAI as collateral, Takes a WETH flashloan with mode = 0, does not approve the transfer of the funds - - 24) Caller takes a WETH flashloan with mode = 1 - - LendingPoolAddressesProvider - ✓ Test the accessibility of the LendingPoolAddressesProvider - - LendingPool liquidation - liquidator receiving aToken - - 25) LIQUIDATION - Deposits WETH, borrows DAI/Check liquidation fails because health factor is above 1 - - 26) LIQUIDATION - Drop the health factor below 1 - - 27) LIQUIDATION - Tries to liquidate a different currency than the loan principal - - 28) LIQUIDATION - Tries to liquidate a different collateral than the borrower collateral - - 29) LIQUIDATION - Liquidates the borrow - - 30) User 3 deposits 1000 USDC, user 4 1 WETH, user 4 borrows - drops HF, liquidates the borrow - - LendingPool liquidation - liquidator receiving the underlying asset - - 31) LIQUIDATION - Deposits WETH, borrows DAI - - 32) LIQUIDATION - Drop the health factor below 1 - - 33) LIQUIDATION - Liquidates the borrow - - 34) User 3 deposits 1000 USDC, user 4 1 WETH, user 4 borrows - drops HF, liquidates the borrow - ✓ User 4 deposits 1000 LEND - drops HF, liquidates the LEND, which results on a lower amount being liquidated - - LendingPool: Borrow negatives (reverts) - - 35) User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and tries to borrow 100 DAI with rate mode NONE (revert expected) - - 36) User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and tries to borrow 100 DAI with an invalid rate mode (revert expected) - - LendingPool: Borrow/repay (stable rate) - - 37) User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and borrows 100 DAI at stable rate - ✓ User 1 tries to borrow the rest of the DAI liquidity (revert expected) - ✓ User 1 repays the half of the DAI borrow after one year - ✓ User 1 repays the rest of the DAI borrow after one year - ✓ User 0 withdraws the deposited DAI plus interest - - 38) User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected) - - 39) User 0 deposits 1000 DAI, user 1,2,3,4 deposit 1 WETH each and borrow 100 DAI at stable rate. Everything is repaid, user 0 withdraws - - 40) User 0 deposits 1000 DAI, user 1 deposits 2 WETH and borrow 100 DAI at stable rate first, then 100 DAI at variable rate, repays everything. User 0 withdraws - - LendingPool: Borrow/repay (variable rate) - ✓ User 2 deposits 1 DAI to account for rounding errors - - 41) User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and borrows 100 DAI at variable rate - ✓ User 1 tries to borrow the rest of the DAI liquidity (revert expected) - ✓ User 1 tries to repay 0 DAI (revert expected) - ✓ User 1 repays a small amount of DAI, enough to cover a small part of the interest - ✓ User 1 repays the DAI borrow after one year - ✓ User 0 withdraws the deposited DAI plus interest - ✓ User 1 withdraws the collateral - ✓ User 2 deposits a small amount of WETH to account for rounding errors - ✓ User 0 deposits 1 WETH, user 1 deposits 100 LINK as collateral and borrows 0.5 ETH at variable rate - ✓ User 1 tries to repay 0 ETH - ✓ User 2 tries to repay everything on behalf of user 1 using uint(-1) (revert expected) - ✓ User 3 repays a small amount of WETH on behalf of user 1 - ✓ User 1 repays the WETH borrow after one year - ✓ User 0 withdraws the deposited WETH plus interest - ✓ User 1 withdraws the collateral - ✓ User 2 deposits 1 USDC to account for rounding errors - - 42) User 0 deposits 1000 USDC, user 1 deposits 1 WETH as collateral and borrows 100 USDC at variable rate - ✓ User 1 tries to borrow the rest of the USDC liquidity (revert expected) - - 43) User 1 repays the USDC borrow after one year - ✓ User 0 withdraws the deposited USDC plus interest - ✓ User 1 withdraws the collateral - - 44) User 1 deposits 1000 DAI, user 3 tries to borrow 1000 DAI without any collateral (revert expected) - - 45) user 3 deposits 0.1 ETH collateral to borrow 100 DAI; 0.1 ETH is not enough to borrow 100 DAI (revert expected) - ✓ user 3 withdraws the 0.1 ETH - - 46) User 1 deposits 1000 USDC, user 3 tries to borrow 1000 USDC without any collateral (revert expected) - - 47) user 3 deposits 0.1 ETH collateral to borrow 100 USDC; 0.1 ETH is not enough to borrow 100 USDC (revert expected) - ✓ user 3 withdraws the 0.1 ETH - - 48) User 0 deposits 1000 DAI, user 6 deposits 2 WETH and borrow 100 DAI at variable rate first, then 100 DAI at stable rate, repays everything. User 0 withdraws - - LendingPool: Deposit - ✓ User 0 Deposits 1000 DAI in an empty reserve - ✓ User 1 deposits 1000 DAI after user 1 - ✓ User 0 deposits 1000 USDC in an empty reserve - ✓ User 1 deposits 1000 USDC after user 0 - ✓ User 0 deposits 1 WETH in an empty reserve - - 49) User 1 deposits 1 WETH after user 0 - ✓ User 1 deposits 0 ETH (revert expected) - ✓ User 1 deposits 0 DAI - ✓ User 1 deposits 100 DAI on behalf of user 2, user 2 tries to borrow 0.1 WETH - - LendingPool: Rebalance stable rate - ✓ User 0 tries to rebalance user 1 who has no borrows in progress (revert expected) - - 50) User 0 deposits 1000 DAI, user 1 deposits 1 ETH, borrows 100 DAI at a variable rate, user 0 rebalances user 1 (revert expected) - - 51) User 1 swaps to stable, user 0 tries to rebalance but the conditions are not met (revert expected) - - 52) User 2 deposits ETH and borrows the remaining DAI, causing the stable rates to rise (liquidity rate < user 1 borrow rate). User 0 tries to rebalance user 1 (revert expected) - - 53) User 2 borrows more DAI, causing the liquidity rate to rise above user 1 stable borrow rate User 0 rebalances user 1 - - LendingPool: Usage as collateral - - 54) User 0 Deposits 1000 DAI, disables DAI as collateral - - 55) User 1 Deposits 2 ETH, disables ETH as collateral, borrows 400 DAI (revert expected) - - 56) User 1 enables ETH as collateral, borrows 400 DAI - - 57) User 1 disables ETH as collateral (revert expected) - - LendingPool: Swap rate mode - ✓ User 0 tries to swap rate mode without any variable rate loan in progress (revert expected) - ✓ User 0 tries to swap rate mode without any stable rate loan in progress (revert expected) - - 58) User 0 deposits 1000 DAI, user 1 deposits 2 ETH as collateral, borrows 100 DAI at variable rate and swaps to stable after one year - ✓ User 1 borrows another 100 DAI, and swaps back to variable after one year, repays the loan - - LendingPool: Redeem negative test cases - ✓ Users 0 Deposits 1000 DAI and tries to redeem 0 DAI (revert expected) - - 59) Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected) - - 60) Users 1 deposits 1 WETH, borrows 100 DAI, tries to redeem the 1 WETH deposited (revert expected) - - LendingPool: withdraw - ✓ User 0 Deposits 1000 DAI in an empty reserve - ✓ User 0 withdraws half of the deposited DAI - ✓ User 0 withdraws remaining half of the deposited DAI - ✓ User 0 Deposits 1000 USDC in an empty reserve - ✓ User 0 withdraws half of the deposited USDC - ✓ User 0 withdraws remaining half of the deposited USDC - ✓ User 0 Deposits 1 WETH in an empty reserve - ✓ User 0 withdraws half of the deposited ETH - ✓ User 0 withdraws remaining half of the deposited ETH - ✓ Users 0 and 1 Deposit 1000 DAI, both withdraw - - 61) Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI. User 1 tries to withdraw all the USDC - - Stable debt token tests - ✓ Tries to invoke mint not being the LendingPool - ✓ Tries to invoke burn not being the LendingPool - - Upgradeability -*** MockAToken *** - -Network: localhost -tx: 0x696dc0be963fe2924a4aa5558d3e5a3bf1fed36fe36d7d23c789a3777f35f512 -contract address: 0xFBdF1E93D0D88145e3CcA63bf8d513F83FB0903b -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 9499999 - -****** - -*** MockStableDebtToken *** - -Network: localhost -tx: 0x01436232ca0350c63f60eb508aa006612a889e9d678c026f810f6a4966382a11 -contract address: 0xE45fF4A0A8D0E9734C73874c034E03594E15ba28 -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7628560 - -****** - -*** MockVariableDebtToken *** - -Network: localhost -tx: 0xefccca15b91974bbe2288e8671c0451f22dfdc62e088ccfe05a744402b4e0b2e -contract address: 0x5cCC6Abc4c9F7262B9485797a848Ec6CC28A11dF -deployer address: 0xc783df8a850f42e7F7e57013759C285caa701eB6 -gas price: 8000000000 -gas used: 7139960 - -****** - - ✓ Tries to update the DAI Atoken implementation with a different address than the lendingPoolManager - ✓ Upgrades the DAI Atoken implementation - ✓ Tries to update the DAI Stable debt token implementation with a different address than the lendingPoolManager - ✓ Upgrades the DAI stable debt token implementation - ✓ Tries to update the DAI variable debt token implementation with a different address than the lendingPoolManager - ✓ Upgrades the DAI variable debt token implementation - - Variable debt token tests - ✓ Tries to invoke mint not being the LendingPool - ✓ Tries to invoke burn not being the LendingPool - -·------------------------------------------------------------------|---------------------------|-------------|-----------------------------· -| Solc version: 0.6.8 · Optimizer enabled: true · Runs: 200 · Block limit: 10000000 gas │ -···································································|···························|·············|······························ -| Methods │ -·································|·································|·············|·············|·············|···············|·············· -| Contract · Method · Min · Max · Avg · # calls · eur (avg) │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · borrow · 262042 · 357423 · 307591 · 14 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · deposit · 106722 · 203343 · 166219 · 58 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · flashLoan · 174269 · 334932 · 281378 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · liquidationCall · - · - · 402890 · 1 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · repay · 133914 · 207869 · 181299 · 14 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · repayWithCollateral · 404877 · 475002 · 432357 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · setUserUseReserveAsCollateral · 93517 · 176141 · 148600 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · swapBorrowRateMode · - · - · 159870 · 1 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPool · withdraw · 171316 · 318009 · 207305 · 28 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolAddressesProvider · transferOwnership · - · - · 30839 · 1 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · activateReserve · - · - · 46958 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · disableBorrowingOnReserve · - · - · 51124 · 2 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · disableReserveAsCollateral · - · - · 51060 · 2 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · disableReserveStableRate · - · - · 51189 · 2 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · enableBorrowingOnReserve · - · - · 51700 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · enableReserveAsCollateral · - · - · 52549 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · enableReserveStableRate · - · - · 51069 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · freezeReserve · - · - · 51104 · 2 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · setLiquidationBonus · - · - · 51381 · 5 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · setLiquidationThreshold · - · - · 51382 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · setLtv · - · - · 51410 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · unfreezeReserve · - · - · 51167 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · updateAToken · - · - · 141032 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · updateStableDebtToken · - · - · 140990 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| LendingPoolConfigurator · updateVariableDebtToken · - · - · 140959 · 3 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MintableERC20 · approve · 24907 · 44119 · 36154 · 42 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MintableERC20 · mint · 35427 · 65487 · 44328 · 44 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MintableERC20 · transfer · - · - · 79721 · 2 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MockFlashLoanReceiver · setAmountToApprove · - · - · 41475 · 1 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MockFlashLoanReceiver · setFailExecutionTransfer · 13614 · 42239 · 29921 · 7 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MockSwapAdapter · setAmountToReturn · 26483 · 41519 · 29521 · 5 · - │ -·································|·································|·············|·············|·············|···············|·············· -| MockSwapAdapter · setTryReentrancy · - · - · 27257 · 1 · - │ -·································|·································|·············|·············|·············|···············|·············· -| PriceOracle · setAssetPrice · 28539 · 28551 · 28548 · 4 · - │ -·································|·································|·············|·············|·············|···············|·············· -| Deployments · · % of limit · │ -···································································|·············|·············|·············|···············|·············· -| MockVariableDebtToken · - · - · 1427992 · 14.3 % · - │ -···································································|·············|·············|·············|···············|·············· -| ValidationLogic · - · - · 1539063 · 15.4 % · - │ -·------------------------------------------------------------------|-------------|-------------|-------------|---------------|-------------· - - 112 passing (3m) - 61 failing - - 1) LendingPoolConfigurator - Deactivates the ETH reserve: - Error: VM Exception while processing transaction: revert 36 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 2) LendingPool. repayWithCollateral() - User 2 tries to repay his DAI Variable loan using his WETH collateral. First half the amount, after that, the rest: - - AssertionError: expected '999594024748679625' to equal '961247816651583750' - + expected - actual - - -999594024748679625 - +961247816651583750 - - at /src/test/repay-with-collateral.spec.ts:169:68 - at step (test/repay-with-collateral.spec.ts:33:23) - at Object.next (test/repay-with-collateral.spec.ts:14:53) - at fulfilled (test/repay-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 3) LendingPool. repayWithCollateral() - User 3 deposits WETH and borrows USDC at Variable: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 4) LendingPool. repayWithCollateral() - User 3 repays completely his USDC loan by swapping his WETH collateral: - Error: VM Exception while processing transaction: revert 40 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 5) LendingPool. repayWithCollateral() - User 3 tries to repay with his collateral all his variable debt and part of the stable: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 6) LendingPool. repayWithCollateral() - User 4 tries to repay a bigger amount that what can be swapped of a particular collateral, repaying only the maximum allowed by that collateral: - - AssertionError: expected '52004058862' to equal '-2.383204320379782404696e+21' - + expected - actual - - -52004058862 - +-2.383204320379782404696e+21 - - at /src/test/repay-with-collateral.spec.ts:518:66 - at step (test/repay-with-collateral.spec.ts:33:23) - at Object.next (test/repay-with-collateral.spec.ts:14:53) - at fulfilled (test/repay-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 7) LendingPool. repayWithCollateral() - User 5 tries to repay his USDC loan by swapping his WETH collateral, should not revert even with WETH collateral disabled: - - AssertionError: expected '9997370843952131411' to equal '9749035101915727008' - + expected - actual - - -9997370843952131411 - +9749035101915727008 - - at /src/test/repay-with-collateral.spec.ts:631:68 - at step (test/repay-with-collateral.spec.ts:33:23) - at Object.next (test/repay-with-collateral.spec.ts:14:53) - at fulfilled (test/repay-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 8) LendingPool. repayWithCollateral() with liquidator - User 5 liquidate User 3 collateral, all his variable debt and part of the stable: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 9) LendingPool. repayWithCollateral() with liquidator - User 5 liquidates half the USDC loan of User 3 by swapping his WETH collateral: - - AssertionError: expected '1097065639317749425' to be less than '1000000000000000000' - + expected - actual - - -1097065639317749425 - +1000000000000000000 - - at /src/test/flash-liquidation-with-collateral.spec.ts:223:68 - at step (test/flash-liquidation-with-collateral.spec.ts:33:23) - at Object.next (test/flash-liquidation-with-collateral.spec.ts:14:53) - at fulfilled (test/flash-liquidation-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 10) LendingPool. repayWithCollateral() with liquidator - User 5 liquidates all the USDC loan of User 3 by swapping his WETH collateral: - - AssertionError: expected '59993908751455423405' to equal '59418562594024569644' - + expected - actual - - -59993908751455423405 - +59418562594024569644 - - at /src/test/flash-liquidation-with-collateral.spec.ts:433:68 - at step (test/flash-liquidation-with-collateral.spec.ts:33:23) - at Object.next (test/flash-liquidation-with-collateral.spec.ts:14:53) - at fulfilled (test/flash-liquidation-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 11) LendingPool. repayWithCollateral() with liquidator - It is not possible to do reentrancy on repayWithCollateral(): - AssertionError: Expected transaction to be reverted with 53, but other exception was thrown: Error: VM Exception while processing transaction: revert 38 - - - 12) LendingPool. repayWithCollateral() with liquidator - User 5 liquidates User 2 DAI Variable loan using his WETH collateral, half the amount: - - AssertionError: expected '1198981160048434745' to be less than '1000000000000000000' - + expected - actual - - -1198981160048434745 - +1000000000000000000 - - at /src/test/flash-liquidation-with-collateral.spec.ts:556:68 - at step (test/flash-liquidation-with-collateral.spec.ts:33:23) - at Object.next (test/flash-liquidation-with-collateral.spec.ts:14:53) - at fulfilled (test/flash-liquidation-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 13) LendingPool. repayWithCollateral() with liquidator - User 2 tries to repay remaining DAI Variable loan using his WETH collateral: - Error: VM Exception while processing transaction: revert 53 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 14) LendingPool. repayWithCollateral() with liquidator - Liquidator tries to repay 4 user a bigger amount that what can be swapped of a particular collateral, repaying only the maximum allowed by that collateral: - - AssertionError: expected '1270283356830566122' to be less than '1000000000000000000' - + expected - actual - - -1270283356830566122 - +1000000000000000000 - - at /src/test/flash-liquidation-with-collateral.spec.ts:761:73 - at step (test/flash-liquidation-with-collateral.spec.ts:33:23) - at Object.next (test/flash-liquidation-with-collateral.spec.ts:14:53) - at fulfilled (test/flash-liquidation-with-collateral.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 15) LendingPool. repayWithCollateral() with liquidator - User 5 deposits WETH and DAI, then borrows USDC at Variable, then disables WETH as collateral: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 16) LendingPool. repayWithCollateral() with liquidator - Liquidator tries to liquidates User 5 USDC loan by swapping his WETH collateral, should revert due WETH collateral disabled: - AssertionError: Expected transaction to be reverted with 39, but other exception was thrown: Error: VM Exception while processing transaction: revert 38 - - - 17) LendingPool FlashLoan function - Takes WETH flashloan with mode = 0, returns the funds correctly: - - AssertionError: expected '485188345817617606687' to equal '1000720000000000000' - + expected - actual - - -485188345817617606687 - +1000720000000000000 - - at /src/test/flashloan.spec.ts:66:45 - at step (test/flashloan.spec.ts:33:23) - at Object.next (test/flashloan.spec.ts:14:53) - at fulfilled (test/flashloan.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 18) LendingPool FlashLoan function - Takes an ETH flashloan with mode = 0 as big as the available liquidity: - - AssertionError: expected '485189246465617606687' to equal '1001620648000000000' - + expected - actual - - -485189246465617606687 - +1001620648000000000 - - at /src/test/flashloan.spec.ts:93:45 - at step (test/flashloan.spec.ts:33:23) - at Object.next (test/flashloan.spec.ts:14:53) - at fulfilled (test/flashloan.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 19) LendingPool FlashLoan function - Caller deposits 1000 DAI as collateral, Takes WETH flashloan with mode = 2, does not return the funds. A variable loan for caller is created: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 20) LendingPool FlashLoan function - tries to take a flashloan that is bigger than the available liquidity (revert expected): - - AssertionError: ERC20: transfer amount exceeds balance: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 21) LendingPool FlashLoan function - Takes out a 500 USDC flashloan, returns the funds correctly: - AssertionError: Expected "40000000000001000450000" to be equal 1000450000 - at /src/test/flashloan.spec.ts:254:34 - at step (test/flashloan.spec.ts:33:23) - at Object.next (test/flashloan.spec.ts:14:53) - at fulfilled (test/flashloan.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 22) LendingPool FlashLoan function - Takes out a 500 USDC flashloan with mode = 0, does not return the funds. (revert expected): - AssertionError: Expected transaction to be reverted with 9, but other exception was thrown: Error: VM Exception while processing transaction: revert 11 - - - 23) LendingPool FlashLoan function - Caller deposits 5 WETH as collateral, Takes a USDC flashloan with mode = 2, does not return the funds. A loan for caller is created: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 24) LendingPool FlashLoan function - Caller takes a WETH flashloan with mode = 1: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 25) LendingPool liquidation - liquidator receiving aToken - LIQUIDATION - Deposits WETH, borrows DAI/Check liquidation fails because health factor is above 1: - - AssertionError: expected '2180' to equal '8000' - + expected - actual - - -2180 - +8000 - - at /src/test/liquidation-atoken.spec.ts:70:88 - at step (test/liquidation-atoken.spec.ts:33:23) - at Object.next (test/liquidation-atoken.spec.ts:14:53) - at fulfilled (test/liquidation-atoken.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 26) LendingPool liquidation - liquidator receiving aToken - LIQUIDATION - Drop the health factor below 1: - - AssertionError: expected '1106703694383782217' to be less than '1000000000000000000' - + expected - actual - - -1106703694383782217 - +1000000000000000000 - - at /src/test/liquidation-atoken.spec.ts:94:68 - at step (test/liquidation-atoken.spec.ts:33:23) - at Object.next (test/liquidation-atoken.spec.ts:14:53) - at fulfilled (test/liquidation-atoken.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 27) LendingPool liquidation - liquidator receiving aToken - LIQUIDATION - Tries to liquidate a different currency than the loan principal: - AssertionError: Expected transaction to be reverted with 40, but other exception was thrown: Error: VM Exception while processing transaction: revert 38 - - - 28) LendingPool liquidation - liquidator receiving aToken - LIQUIDATION - Tries to liquidate a different collateral than the borrower collateral: - AssertionError: Expected transaction to be reverted with 39, but other exception was thrown: Error: VM Exception while processing transaction: revert 38 - - - 29) LendingPool liquidation - liquidator receiving aToken - LIQUIDATION - Liquidates the borrow: - Error: VM Exception while processing transaction: revert 38 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 30) LendingPool liquidation - liquidator receiving aToken - User 3 deposits 1000 USDC, user 4 1 WETH, user 4 borrows - drops HF, liquidates the borrow: - Error: VM Exception while processing transaction: revert 39 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 31) LendingPool liquidation - liquidator receiving the underlying asset - LIQUIDATION - Deposits WETH, borrows DAI: - - AssertionError: expected '2053' to equal '8000' - + expected - actual - - -2053 - +8000 - - at /src/test/liquidation-underlying.spec.ts:75:88 - at step (test/liquidation-underlying.spec.ts:33:23) - at Object.next (test/liquidation-underlying.spec.ts:14:53) - at fulfilled (test/liquidation-underlying.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 32) LendingPool liquidation - liquidator receiving the underlying asset - LIQUIDATION - Drop the health factor below 1: - - AssertionError: expected '1084735437615841522' to be less than '1000000000000000000' - + expected - actual - - -1084735437615841522 - +1000000000000000000 - - at /src/test/liquidation-underlying.spec.ts:94:68 - at step (test/liquidation-underlying.spec.ts:33:23) - at Object.next (test/liquidation-underlying.spec.ts:14:53) - at fulfilled (test/liquidation-underlying.spec.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 33) LendingPool liquidation - liquidator receiving the underlying asset - LIQUIDATION - Liquidates the borrow: - Error: VM Exception while processing transaction: revert 38 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 34) LendingPool liquidation - liquidator receiving the underlying asset - User 3 deposits 1000 USDC, user 4 1 WETH, user 4 borrows - drops HF, liquidates the borrow: - Error: VM Exception while processing transaction: revert 39 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 35) LendingPool: Borrow negatives (reverts) - User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and tries to borrow 100 DAI with rate mode NONE (revert expected): - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 36) LendingPool: Borrow negatives (reverts) - User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and tries to borrow 100 DAI with an invalid rate mode (revert expected): - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 37) LendingPool: Borrow/repay (stable rate) - User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and borrows 100 DAI at stable rate: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 38) LendingPool: Borrow/repay (stable rate) - User 1 deposits 1000 DAI, user 2 tries to borrow 1000 DAI at a stable rate without any collateral (revert expected): - - AssertionError: expected '0' to be almost equal or equal '1358000328427211421354' for property principalStableDebt - + expected - actual - - -0 - +1358000328427211421354 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 39) LendingPool: Borrow/repay (stable rate) - User 0 deposits 1000 DAI, user 1,2,3,4 deposit 1 WETH each and borrow 100 DAI at stable rate. Everything is repaid, user 0 withdraws: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 40) LendingPool: Borrow/repay (stable rate) - User 0 deposits 1000 DAI, user 1 deposits 2 WETH and borrow 100 DAI at stable rate first, then 100 DAI at variable rate, repays everything. User 0 withdraws: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 41) LendingPool: Borrow/repay (variable rate) - User 0 deposits 1000 DAI, user 1 deposits 1 WETH as collateral and borrows 100 DAI at variable rate: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 42) LendingPool: Borrow/repay (variable rate) - User 0 deposits 1000 USDC, user 1 deposits 1 WETH as collateral and borrows 100 USDC at variable rate: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 43) LendingPool: Borrow/repay (variable rate) - User 1 repays the USDC borrow after one year: - Error: VM Exception while processing transaction: revert 15 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 44) LendingPool: Borrow/repay (variable rate) - User 1 deposits 1000 DAI, user 3 tries to borrow 1000 DAI without any collateral (revert expected): - - AssertionError: The collateral balance is 0: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 45) LendingPool: Borrow/repay (variable rate) - user 3 deposits 0.1 ETH collateral to borrow 100 DAI; 0.1 ETH is not enough to borrow 100 DAI (revert expected): - - AssertionError: There is not enough collateral to cover a new borrow: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 46) LendingPool: Borrow/repay (variable rate) - User 1 deposits 1000 USDC, user 3 tries to borrow 1000 USDC without any collateral (revert expected): - - AssertionError: The collateral balance is 0: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 47) LendingPool: Borrow/repay (variable rate) - user 3 deposits 0.1 ETH collateral to borrow 100 USDC; 0.1 ETH is not enough to borrow 100 USDC (revert expected): - - AssertionError: There is not enough collateral to cover a new borrow: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 48) LendingPool: Borrow/repay (variable rate) - User 0 deposits 1000 DAI, user 6 deposits 2 WETH and borrow 100 DAI at variable rate first, then 100 DAI at stable rate, repays everything. User 0 withdraws: - Error: VM Exception while processing transaction: revert 11 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 49) LendingPool: Deposit - User 1 deposits 1 WETH after user 0: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 50) LendingPool: Rebalance stable rate - User 0 deposits 1000 DAI, user 1 deposits 1 ETH, borrows 100 DAI at a variable rate, user 0 rebalances user 1 (revert expected): - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 51) LendingPool: Rebalance stable rate - User 1 swaps to stable, user 0 tries to rebalance but the conditions are not met (revert expected): - Error: VM Exception while processing transaction: revert 18 - at HttpProvider.send (node_modules/@nomiclabs/buidler/src/internal/core/providers/http.ts:36:34) - at getMultipliedGasEstimation (node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:150:45) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:108:14 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/accounts.ts:219:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:63:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at /src/node_modules/@nomiclabs/buidler/src/internal/core/providers/gas-providers.ts:82:21 - at Proxy.cloningSendWrapper (node_modules/@nomiclabs/buidler/src/internal/core/providers/wrapper.ts:9:12) - at EthersProviderWrapper.send (node_modules/@nomiclabs/buidler-ethers/src/ethers-provider-wrapper.ts:13:48) - at EthersProviderWrapper.JsonRpcProvider.perform (node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:432:21) - at EthersProviderWrapper. (node_modules/@ethersproject/providers/src.ts/base-provider.ts:850:42) - at step (node_modules/@ethersproject/providers/lib/base-provider.js:46:23) - at Object.next (node_modules/@ethersproject/providers/lib/base-provider.js:27:53) - at fulfilled (node_modules/@ethersproject/providers/lib/base-provider.js:18:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 52) LendingPool: Rebalance stable rate - User 2 deposits ETH and borrows the remaining DAI, causing the stable rates to rise (liquidity rate < user 1 borrow rate). User 0 tries to rebalance user 1 (revert expected): - - AssertionError: expected '0' to be almost equal or equal '100000000006972721' for property principalStableDebt - + expected - actual - - -0 - +100000000006972721 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 53) LendingPool: Rebalance stable rate - User 2 borrows more DAI, causing the liquidity rate to rise above user 1 stable borrow rate User 0 rebalances user 1: - - AssertionError: expected '0' to be almost equal or equal '100000000009270565' for property principalStableDebt - + expected - actual - - -0 - +100000000009270565 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 54) LendingPool: Usage as collateral - User 0 Deposits 1000 DAI, disables DAI as collateral: - - AssertionError: expected '4000000000706215436781' to be almost equal or equal '4000000000676018902879' for property currentATokenBalance - + expected - actual - - -4000000000706215436781 - +4000000000676018902879 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:509:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 55) LendingPool: Usage as collateral - User 1 Deposits 2 ETH, disables ETH as collateral, borrows 400 DAI (revert expected): - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 56) LendingPool: Usage as collateral - User 1 enables ETH as collateral, borrows 400 DAI: - - AssertionError: expected '4000000000008306119' to be almost equal or equal '4000000000007484590' for property currentATokenBalance - + expected - actual - - -4000000000008306119 - +4000000000007484590 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:509:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 57) LendingPool: Usage as collateral - User 1 disables ETH as collateral (revert expected): - - AssertionError: User deposit is already being used as collateral: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 58) LendingPool: Swap rate mode - User 0 deposits 1000 DAI, user 1 deposits 2 ETH as collateral, borrows 100 DAI at variable rate and swaps to stable after one year: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 59) LendingPool: Redeem negative test cases - Users 0 tries to redeem 1100 DAI from the 1000 DAI deposited (revert expected): - - AssertionError: User cannot redeem more than the available balance: Expected transaction to be reverted - + expected - actual - - -Transaction NOT reverted. - +Transaction reverted. - - - - 60) LendingPool: Redeem negative test cases - Users 1 deposits 1 WETH, borrows 100 DAI, tries to redeem the 1 WETH deposited (revert expected): - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - 61) LendingPool: withdraw - Users 0 deposits 1000 DAI, user 1 Deposit 1000 USDC and 1 WETH, borrows 100 DAI. User 1 tries to withdraw all the USDC: - - AssertionError: expected '100000000000000000' to be almost equal or equal '0' for property principalStableDebt - + expected - actual - - -100000000000000000 - +0 - - at expectEqual (test/helpers/actions.ts:664:26) - at /src/test/helpers/actions.ts:194:5 - at step (test/helpers/actions.ts:33:23) - at Object.next (test/helpers/actions.ts:14:53) - at fulfilled (test/helpers/actions.ts:5:58) - at runMicrotasks () - at processTicksAndRejections (internal/process/task_queues.js:97:5) - - - From d4abc123492f637ef12a3e424c3360db5694fdf6 Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 22 Oct 2020 19:06:37 +0200 Subject: [PATCH 14/38] Updated wadDiv --- contracts/libraries/math/WadRayMath.sol | 4 ---- 1 file changed, 4 deletions(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index 949118c6..6b67641c 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -74,10 +74,6 @@ library WadRayMath { function wadDiv(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, Errors.DIVISION_BY_ZERO); - if (a == 0) { - return 0; - } - uint256 halfB = b / 2; uint256 result = a * WAD; From af99c88b70956eccfec0cea8f16cfe7a6e238d64 Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 22 Oct 2020 19:20:19 +0200 Subject: [PATCH 15/38] Added error constant --- contracts/libraries/helpers/Errors.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/libraries/helpers/Errors.sol b/contracts/libraries/helpers/Errors.sol index ee71efaa..6e13143a 100644 --- a/contracts/libraries/helpers/Errors.sol +++ b/contracts/libraries/helpers/Errors.sol @@ -45,6 +45,7 @@ library Errors { string public constant INVALID_EQUAL_ASSETS_TO_SWAP = '56'; string public constant NO_MORE_RESERVES_ALLOWED = '59'; string public constant INVALID_FLASH_LOAN_EXECUTOR_RETURN = '60'; + string public constant INCONSISTENT_FLASHLOAN_PARAMS = '69'; // require error messages - aToken - DebtTokens string public constant CALLER_MUST_BE_LENDING_POOL = '28'; // 'The caller of this function must be a lending pool' From a2e2450bb351844086f749ee24c005df03bc0e4a Mon Sep 17 00:00:00 2001 From: The3D Date: Thu, 22 Oct 2020 20:37:50 +0200 Subject: [PATCH 16/38] Finalized implementation, fixed tests --- .../interfaces/IFlashLoanReceiver.sol | 6 +- contracts/interfaces/ILendingPool.sol | 19 +++--- contracts/lendingpool/LendingPool.sol | 59 ++++++++++------- contracts/libraries/logic/ValidationLogic.sol | 9 ++- .../mocks/flashloan/MockFlashLoanReceiver.sol | 43 +++++++------ test/flashloan.spec.ts | 64 ++++++++----------- test/pausable-functions.spec.ts | 2 +- 7 files changed, 107 insertions(+), 95 deletions(-) diff --git a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol index 5c92236a..8d4353f3 100644 --- a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol +++ b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol @@ -9,9 +9,9 @@ pragma solidity ^0.6.8; **/ interface IFlashLoanReceiver { function executeOperation( - address reserve, - uint256 amount, - uint256 fee, + address[] calldata reserve, + uint256[] calldata amounts, + uint256[] calldata premiums, bytes calldata params ) external returns (bool); } diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 5271d6bd..4e36c87b 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -99,16 +99,16 @@ interface ILendingPool { /** * @dev emitted when a flashloan is executed * @param target the address of the flashLoanReceiver - * @param reserve the address of the reserve - * @param amount the amount requested - * @param totalPremium the total fee on the amount + * @param assets the address of the assets being flashborrowed + * @param amounts the amount requested + * @param premiums the total fee on the amount * @param referralCode the referral code of the caller **/ event FlashLoan( address indexed target, - address indexed reserve, - uint256 amount, - uint256 totalPremium, + address[] assets, + uint256[] amounts, + uint256[] premiums, uint16 referralCode ); /** @@ -264,13 +264,14 @@ interface ILendingPool { * as long as the amount taken plus a fee is returned. NOTE There are security concerns for developers of flashloan receiver contracts * that must be kept into consideration. For further details please visit https://developers.aave.com * @param receiver The address of the contract receiving the funds. The receiver should implement the IFlashLoanReceiver interface. - * @param reserve the address of the principal reserve - * @param amount the amount requested for this flashloan + * @param assets the address of the principal reserve + * @param amounts the amount requested for this flashloan + * @param mode the flashloan mode * @param params a bytes array to be sent to the flashloan executor * @param referralCode the referral code of the caller **/ function flashLoan( - address receiverAddress, + address receiver, address[] calldata assets, uint256[] calldata amounts, uint256 mode, diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index cdf2be48..fc9413ab 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -486,6 +486,12 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage IFlashLoanReceiver receiver; address oracle; ReserveLogic.InterestRateMode debtMode; + uint256 i; + address currentAsset; + address currentATokenAddress; + uint256 currentAmount; + uint256 currentPremium; + uint256 currentAmountPlusPremium; } /** @@ -511,7 +517,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage FlashLoanLocalVars memory vars; - ValidationLogic.validateFlashloan(assets, amounts, mode, vars.premium); + ValidationLogic.validateFlashloan(assets, amounts, mode); address[] memory aTokenAddresses = new address[](assets.length); uint256[] memory premiums = new uint256[](assets.length); @@ -519,15 +525,13 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage vars.receiver = IFlashLoanReceiver(receiverAddress); vars.debtMode = ReserveLogic.InterestRateMode(mode); - for (uint256 i = 0; i < assets.length; i++) { - ReserveLogic.ReserveData storage reserve = _reserves[assets[i]]; + for (vars.i = 0; vars.i < assets.length; vars.i++) { + aTokenAddresses[vars.i] = _reserves[assets[vars.i]].aTokenAddress; - aTokenAddresses[i] = reserve.aTokenAddress; - - premiums[i] = amounts[i].mul(FLASHLOAN_PREMIUM_TOTAL).div(10000); + premiums[vars.i] = amounts[vars.i].mul(FLASHLOAN_PREMIUM_TOTAL).div(10000); //transfer funds to the receiver - IAToken(vars.aTokenAddress).transferUnderlyingTo(receiverAddress, amounts[i]); + IAToken(aTokenAddresses[vars.i]).transferUnderlyingTo(receiverAddress, amounts[vars.i]); } //execute action of the receiver @@ -536,40 +540,49 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage Errors.INVALID_FLASH_LOAN_EXECUTOR_RETURN ); - for (uint256 i = 0; i < assets.length; i++) { - uint256 amountPlusPremium = amounts[i].add(premiums[i]); + for (vars.i = 0; vars.i < assets.length; vars.i++) { + vars.currentAsset = assets[vars.i]; + vars.currentAmount = amounts[vars.i]; + vars.currentPremium = premiums[vars.i]; + vars.currentATokenAddress = aTokenAddresses[vars.i]; + + vars.currentAmountPlusPremium = amounts[vars.i].add(premiums[vars.i]); if (vars.debtMode == ReserveLogic.InterestRateMode.NONE) { - _reserves[assets[i]].updateState(); - _reserves[assets[i]].cumulateToLiquidityIndex( - IERC20(aTokenAddresses[i]).totalSupply(), - vars.premium + _reserves[vars.currentAsset].updateState(); + _reserves[vars.currentAsset].cumulateToLiquidityIndex( + IERC20(vars.currentATokenAddress).totalSupply(), + vars.currentPremium + ); + _reserves[vars.currentAsset].updateInterestRates( + assets[vars.i], + vars.currentATokenAddress, + vars.currentPremium, + 0 ); - _reserves[assets[i]].updateInterestRates(assets[i], aTokenAddresses[i], vars.premium, 0); - IERC20(assets[i]).safeTransferFrom( + IERC20(vars.currentAsset).safeTransferFrom( receiverAddress, - vars.aTokenAddresses[i], - vars.amountPlusPremium + vars.currentATokenAddress, + vars.currentAmountPlusPremium ); - - emit FlashLoan(receiverAddress, assets[i], amounts[i], vars.premium, referralCode); } else { //if the user didn't choose to return the funds, the system checks if there //is enough collateral and eventually open a position _executeBorrow( ExecuteBorrowParams( - assets[i], + vars.currentAsset, msg.sender, msg.sender, - amountPlusPremium, - vars.mode, - aTokenAddresses[i], + vars.currentAmount, + mode, + vars.currentATokenAddress, referralCode, false ) ); } + emit FlashLoan(receiverAddress, assets, amounts, premiums, referralCode); } } diff --git a/contracts/libraries/logic/ValidationLogic.sol b/contracts/libraries/logic/ValidationLogic.sol index 838d43b7..947d84ea 100644 --- a/contracts/libraries/logic/ValidationLogic.sol +++ b/contracts/libraries/logic/ValidationLogic.sol @@ -327,15 +327,14 @@ library ValidationLogic { /** * @dev validates a flashloan action * @param mode the flashloan mode (0 = classic flashloan, 1 = open a stable rate loan, 2 = open a variable rate loan) - * @param premium the premium paid on the flashloan + * @param assets the assets being flashborrowed + * @param amounts the amounts for each asset being borrowed **/ function validateFlashloan( address[] memory assets, - address[] memory amounts, - uint256 mode, - uint256 premium + uint256[] memory amounts, + uint256 mode ) internal pure { - require(premium > 0, Errors.REQUESTED_AMOUNT_TOO_SMALL); require(mode <= uint256(ReserveLogic.InterestRateMode.VARIABLE), Errors.INVALID_FLASHLOAN_MODE); require(assets.length == amounts.length, Errors.INCONSISTENT_FLASHLOAN_PARAMS); } diff --git a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol index 0a767712..7b72c2cb 100644 --- a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol +++ b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol @@ -14,8 +14,8 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase { ILendingPoolAddressesProvider internal _provider; - event ExecutedWithFail(address _reserve, uint256 _amount, uint256 _fee); - event ExecutedWithSuccess(address _reserve, uint256 _amount, uint256 _fee); + event ExecutedWithFail(address[] _assets, uint256[] _amounts, uint256[] _premiums); + event ExecutedWithSuccess(address[] _assets, uint256[] _amounts, uint256[] _premiums); bool _failExecution; uint256 _amountToApprove; @@ -44,33 +44,40 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase { } function executeOperation( - address reserve, - uint256 amount, - uint256 fee, + address[] memory assets, + uint256[] memory amounts, + uint256[] memory premiums, bytes memory params ) public override returns (bool) { params; - //mint to this contract the specific amount - MintableERC20 token = MintableERC20(reserve); - - //check the contract has the specified balance - require(amount <= IERC20(reserve).balanceOf(address(this)), 'Invalid balance for the contract'); - - uint256 amountToReturn = (_amountToApprove != 0) ? _amountToApprove : amount.add(fee); if (_failExecution) { - emit ExecutedWithFail(reserve, amount, fee); + emit ExecutedWithFail(assets, amounts, premiums); return !_simulateEOA; } - //execution does not fail - mint tokens and return them to the _destination - //note: if the reserve is eth, the mock contract must receive at least _fee ETH before calling executeOperation + for (uint256 i = 0; i < assets.length; i++) { + //mint to this contract the specific amount + MintableERC20 token = MintableERC20(assets[i]); - token.mint(fee); + //check the contract has the specified balance + require( + amounts[i] <= IERC20(assets[i]).balanceOf(address(this)), + 'Invalid balance for the contract' + ); - IERC20(reserve).approve(_addressesProvider.getLendingPool(), amountToReturn); + uint256 amountToReturn = (_amountToApprove != 0) + ? _amountToApprove + : amounts[i].add(premiums[i]); + //execution does not fail - mint tokens and return them to the _destination + //note: if the reserve is eth, the mock contract must receive at least _fee ETH before calling executeOperation - emit ExecutedWithSuccess(reserve, amount, fee); + token.mint(premiums[i]); + + IERC20(assets[i]).approve(_addressesProvider.getLendingPool(), amountToReturn); + } + + emit ExecutedWithSuccess(assets, amounts, premiums); return true; } diff --git a/test/flashloan.spec.ts b/test/flashloan.spec.ts index 1ca080f9..c34c37b1 100644 --- a/test/flashloan.spec.ts +++ b/test/flashloan.spec.ts @@ -48,8 +48,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await pool.flashLoan( _mockFlashLoanReceiver.address, - weth.address, - ethers.utils.parseEther('0.8'), + [weth.address], + [ethers.utils.parseEther('0.8')], 0, '0x10', '0' @@ -77,8 +77,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { const reserveDataBefore = await helpersContract.getReserveData(weth.address); const txResult = await pool.flashLoan( _mockFlashLoanReceiver.address, - weth.address, - '1000720000000000000', + [weth.address], + ['1000720000000000000'], 0, '0x10', '0' @@ -108,8 +108,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { .connect(caller.signer) .flashLoan( _mockFlashLoanReceiver.address, - weth.address, - ethers.utils.parseEther('0.8'), + [weth.address], + [ethers.utils.parseEther('0.8')], 0, '0x10', '0' @@ -128,8 +128,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { .connect(caller.signer) .flashLoan( _mockFlashLoanReceiver.address, - weth.address, - ethers.utils.parseEther('0.8'), + [weth.address], + [ethers.utils.parseEther('0.8')], 0, '0x10', '0' @@ -148,8 +148,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { .connect(caller.signer) .flashLoan( _mockFlashLoanReceiver.address, - weth.address, - ethers.utils.parseEther('0.8'), + [weth.address], + [ethers.utils.parseEther('0.8')], 4, '0x10', '0' @@ -176,8 +176,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { .connect(caller.signer) .flashLoan( _mockFlashLoanReceiver.address, - weth.address, - ethers.utils.parseEther('0.8'), + [weth.address], + [ethers.utils.parseEther('0.8')], 2, '0x10', '0' @@ -196,29 +196,14 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { expect(callerDebt.toString()).to.be.equal('800720000000000000', 'Invalid user debt'); }); - it('tries to take a very small flashloan, which would result in 0 fees (revert expected)', async () => { - const {pool, weth} = testEnv; - - await expect( - pool.flashLoan( - _mockFlashLoanReceiver.address, - weth.address, - '1', //1 wei loan - 2, - '0x10', - '0' - ) - ).to.be.revertedWith(REQUESTED_AMOUNT_TOO_SMALL); - }); - it('tries to take a flashloan that is bigger than the available liquidity (revert expected)', async () => { const {pool, weth} = testEnv; await expect( pool.flashLoan( _mockFlashLoanReceiver.address, - weth.address, - '1004415000000000000', //slightly higher than the available liquidity + [weth.address], + ['1004415000000000000'], //slightly higher than the available liquidity 2, '0x10', '0' @@ -231,7 +216,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { const {pool, deployer, weth} = testEnv; await expect( - pool.flashLoan(deployer.address, weth.address, '1000000000000000000', 2, '0x10', '0') + pool.flashLoan(deployer.address, [weth.address], ['1000000000000000000'], 2, '0x10', '0') ).to.be.reverted; }); @@ -257,8 +242,8 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await pool.flashLoan( _mockFlashLoanReceiver.address, - usdc.address, - flashloanAmount, + [usdc.address], + [flashloanAmount], 0, '0x10', '0' @@ -297,7 +282,14 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await expect( pool .connect(caller.signer) - .flashLoan(_mockFlashLoanReceiver.address, usdc.address, flashloanAmount, 2, '0x10', '0') + .flashLoan( + _mockFlashLoanReceiver.address, + [usdc.address], + [flashloanAmount], + 2, + '0x10', + '0' + ) ).to.be.revertedWith(COLLATERAL_BALANCE_IS_0); }); @@ -320,7 +312,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await pool .connect(caller.signer) - .flashLoan(_mockFlashLoanReceiver.address, usdc.address, flashloanAmount, 2, '0x10', '0'); + .flashLoan(_mockFlashLoanReceiver.address, [usdc.address], [flashloanAmount], 2, '0x10', '0'); const {variableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses( usdc.address ); @@ -355,7 +347,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await expect( pool .connect(caller.signer) - .flashLoan(_mockFlashLoanReceiver.address, weth.address, flashAmount, 0, '0x10', '0') + .flashLoan(_mockFlashLoanReceiver.address, [weth.address], [flashAmount], 0, '0x10', '0') ).to.be.revertedWith(SAFEERC20_LOWLEVEL_CALL); }); @@ -370,7 +362,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { await pool .connect(caller.signer) - .flashLoan(_mockFlashLoanReceiver.address, weth.address, flashAmount, 1, '0x10', '0'); + .flashLoan(_mockFlashLoanReceiver.address, [weth.address], [flashAmount], 1, '0x10', '0'); const {stableDebtTokenAddress} = await helpersContract.getReserveTokensAddresses(weth.address); diff --git a/test/pausable-functions.spec.ts b/test/pausable-functions.spec.ts index 8e7cc2a7..cc8fb0d4 100644 --- a/test/pausable-functions.spec.ts +++ b/test/pausable-functions.spec.ts @@ -186,7 +186,7 @@ makeSuite('Pausable Pool', (testEnv: TestEnv) => { await expect( pool .connect(caller.signer) - .flashLoan(_mockFlashLoanReceiver.address, weth.address, flashAmount, 1, '0x10', '0') + .flashLoan(_mockFlashLoanReceiver.address, [weth.address], [flashAmount], 1, '0x10', '0') ).revertedWith(IS_PAUSED); // Unpause pool From dadebe9d2cc4683cdc114e0195c2fec4189066ab Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 10:57:22 +0200 Subject: [PATCH 17/38] Updated optimization --- contracts/libraries/math/WadRayMath.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index 6b67641c..696a0e09 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -100,7 +100,7 @@ library WadRayMath { uint256 result = a * b + halfRAY; - require((result - halfRAY) / a == b, Errors.MULTIPLICATION_OVERFLOW); + require(result >= halfRAY && (result - halfRAY) / a == b, Errors.MULTIPLICATION_OVERFLOW); return result / RAY; } @@ -118,7 +118,7 @@ library WadRayMath { uint256 result = a * RAY + halfB; - require((result - halfB) / RAY == a, Errors.MULTIPLICATION_OVERFLOW); + require(result >= halfB && (result - halfB) / RAY == a, Errors.MULTIPLICATION_OVERFLOW); return result / b; } From 614244272e0ee802f324f30bc93b9f0054d50f34 Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 12:20:06 +0200 Subject: [PATCH 18/38] Added the gas reporter --- buidler.config.ts | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buidler.config.ts b/buidler.config.ts index ae6ef7e3..878bc53f 100644 --- a/buidler.config.ts +++ b/buidler.config.ts @@ -11,7 +11,7 @@ usePlugin('buidler-typechain'); usePlugin('solidity-coverage'); usePlugin('@nomiclabs/buidler-waffle'); usePlugin('@nomiclabs/buidler-etherscan'); -//usePlugin('buidler-gas-reporter'); +usePlugin('buidler-gas-reporter'); const SKIP_LOAD = process.env.SKIP_LOAD === 'true'; const DEFAULT_BLOCK_GAS_LIMIT = 10000000; diff --git a/package.json b/package.json index 1c0bfb5b..bb6816d4 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@types/mocha": "7.0.2", "@types/node": "14.0.5", "bignumber.js": "9.0.0", - "buidler-gas-reporter": "^0.1.3", + "buidler-gas-reporter": "^0.1.4", "buidler-typechain": "0.1.1", "chai": "4.2.0", "chai-bignumber": "3.0.0", From 86d25393e9cf18856f0d237f9057a525836f555b Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 13:09:19 +0200 Subject: [PATCH 19/38] Add small optimization in _mintToTreasury --- contracts/libraries/logic/ReserveLogic.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/libraries/logic/ReserveLogic.sol b/contracts/libraries/logic/ReserveLogic.sol index c253d6a9..ee6749da 100644 --- a/contracts/libraries/logic/ReserveLogic.sol +++ b/contracts/libraries/logic/ReserveLogic.sol @@ -359,7 +359,9 @@ library ReserveLogic { vars.amountToMint = vars.totalDebtAccrued.percentMul(vars.reserveFactor); - IAToken(reserve.aTokenAddress).mintToTreasury(vars.amountToMint, newLiquidityIndex); + if (vars.amountToMint != 0) { + IAToken(reserve.aTokenAddress).mintToTreasury(vars.amountToMint, newLiquidityIndex); + } } /** From 4e1a8c29bd904b8dce47a8a7c83cf80d67fc6693 Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 16:52:22 +0200 Subject: [PATCH 20/38] Fixed wad functions in WadRayMath --- contracts/libraries/math/WadRayMath.sol | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/contracts/libraries/math/WadRayMath.sol b/contracts/libraries/math/WadRayMath.sol index 696a0e09..a1a8d8f4 100644 --- a/contracts/libraries/math/WadRayMath.sol +++ b/contracts/libraries/math/WadRayMath.sol @@ -60,7 +60,7 @@ library WadRayMath { uint256 result = a * b + halfWAD; - require((result - halfWAD) / a == b, Errors.MULTIPLICATION_OVERFLOW); + require(result >= halfWAD && (result - halfWAD) / a == b, Errors.MULTIPLICATION_OVERFLOW); return result / WAD; } @@ -76,13 +76,9 @@ library WadRayMath { uint256 halfB = b / 2; - uint256 result = a * WAD; + uint256 result = a * WAD + halfB; - require(result / WAD == a, Errors.MULTIPLICATION_OVERFLOW); - - result += halfB; - - require(result >= halfB, Errors.ADDITION_OVERFLOW); + require(result >= halfB && (result - halfB) / WAD == a, Errors.MULTIPLICATION_OVERFLOW); return result / b; } From 6398fe4260a10beff1dd299fb539e11f54ca71ff Mon Sep 17 00:00:00 2001 From: The3D Date: Fri, 23 Oct 2020 18:41:08 +0200 Subject: [PATCH 21/38] Fix comments, tests --- contracts/flashloan/interfaces/IFlashLoanReceiver.sol | 2 +- contracts/lendingpool/LendingPool.sol | 8 ++++---- test/flashloan.spec.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol index 8d4353f3..784d0fa3 100644 --- a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol +++ b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol @@ -9,7 +9,7 @@ pragma solidity ^0.6.8; **/ interface IFlashLoanReceiver { function executeOperation( - address[] calldata reserve, + address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, bytes calldata params diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index fc9413ab..a16e9cd6 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -499,8 +499,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage * as long as the amount taken plus a fee is returned. NOTE There are security concerns for developers of flashloan receiver contracts * that must be kept into consideration. For further details please visit https://developers.aave.com * @param receiverAddress The address of the contract receiving the funds. The receiver should implement the IFlashLoanReceiver interface. - * @param assets The address of the principal reserve - * @param amounts The amount requested for this flashloan + * @param assets The addresss of the assets being flashborrowed + * @param amounts The amounts requested for this flashloan for each asset * @param mode Type of the debt to open if the flash loan is not returned. 0 -> Don't open any debt, just revert, 1 -> stable, 2 -> variable * @param params Variadic packed params to pass to the receiver as extra information * @param referralCode Referral code of the flash loan @@ -546,7 +546,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage vars.currentPremium = premiums[vars.i]; vars.currentATokenAddress = aTokenAddresses[vars.i]; - vars.currentAmountPlusPremium = amounts[vars.i].add(premiums[vars.i]); + vars.currentAmountPlusPremium = vars.currentAmount.add(vars.currentPremium); if (vars.debtMode == ReserveLogic.InterestRateMode.NONE) { _reserves[vars.currentAsset].updateState(); @@ -555,7 +555,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage vars.currentPremium ); _reserves[vars.currentAsset].updateInterestRates( - assets[vars.i], + vars.currentAsset, vars.currentATokenAddress, vars.currentPremium, 0 diff --git a/test/flashloan.spec.ts b/test/flashloan.spec.ts index c34c37b1..4edd4848 100644 --- a/test/flashloan.spec.ts +++ b/test/flashloan.spec.ts @@ -193,7 +193,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { const callerDebt = await wethDebtToken.balanceOf(caller.address); - expect(callerDebt.toString()).to.be.equal('800720000000000000', 'Invalid user debt'); + expect(callerDebt.toString()).to.be.equal('800000000000000000', 'Invalid user debt'); }); it('tries to take a flashloan that is bigger than the available liquidity (revert expected)', async () => { @@ -324,7 +324,7 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { const callerDebt = await usdcDebtToken.balanceOf(caller.address); - expect(callerDebt.toString()).to.be.equal('500450000', 'Invalid user debt'); + expect(callerDebt.toString()).to.be.equal('500000000', 'Invalid user debt'); }); it('Caller deposits 1000 DAI as collateral, Takes a WETH flashloan with mode = 0, does not approve the transfer of the funds', async () => { @@ -373,6 +373,6 @@ makeSuite('LendingPool FlashLoan function', (testEnv: TestEnv) => { const callerDebt = await wethDebtToken.balanceOf(caller.address); - expect(callerDebt.toString()).to.be.equal('800720000000000000', 'Invalid user debt'); + expect(callerDebt.toString()).to.be.equal('800000000000000000', 'Invalid user debt'); }); }); From c44ed2c0c7c54535456b7c88176efeeda97dce3e Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 10:35:44 +0100 Subject: [PATCH 22/38] Updated flashloan event --- contracts/interfaces/ILendingPool.sol | 1 + contracts/lendingpool/LendingPool.sol | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 4e36c87b..891781dc 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -106,6 +106,7 @@ interface ILendingPool { **/ event FlashLoan( address indexed target, + uint256 mode, address[] assets, uint256[] amounts, uint256[] premiums, diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index a16e9cd6..22dd7454 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -582,7 +582,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage ) ); } - emit FlashLoan(receiverAddress, assets, amounts, premiums, referralCode); + emit FlashLoan(receiverAddress, mode, assets, amounts, premiums, referralCode); } } From 4b750850a2fe4253f2fb3ba4ce1e2345416c3eea Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 10:48:43 +0100 Subject: [PATCH 23/38] Fixes PVE006-2 --- contracts/lendingpool/LendingPoolCollateralManager.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/lendingpool/LendingPoolCollateralManager.sol b/contracts/lendingpool/LendingPoolCollateralManager.sol index 0341748e..b6a0b5ca 100644 --- a/contracts/lendingpool/LendingPoolCollateralManager.sol +++ b/contracts/lendingpool/LendingPoolCollateralManager.sol @@ -306,8 +306,8 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor .principalCurrencyPrice .mul(purchaseAmount) .mul(10**vars.collateralDecimals) - .div(vars.collateralPrice.mul(10**vars.principalDecimals)) - .percentMul(vars.liquidationBonus); + .percentMul(vars.liquidationBonus) + .div(vars.collateralPrice.mul(10**vars.principalDecimals)); if (vars.maxAmountCollateralToLiquidate > userCollateralBalance) { collateralAmount = userCollateralBalance; From 65dace00540564895cecfe7bc03ad80686c04f93 Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 10:57:45 +0100 Subject: [PATCH 24/38] updated validation of validateRepay --- contracts/lendingpool/LendingPool.sol | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 963ef7cf..400276e4 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -262,15 +262,6 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage ReserveLogic.InterestRateMode interestRateMode = ReserveLogic.InterestRateMode(rateMode); - //default to max amount - uint256 paybackAmount = interestRateMode == ReserveLogic.InterestRateMode.STABLE - ? stableDebt - : variableDebt; - - if (amount < paybackAmount) { - paybackAmount = amount; - } - ValidationLogic.validateRepay( reserve, amount, @@ -280,6 +271,15 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage variableDebt ); + //default to max amount + uint256 paybackAmount = interestRateMode == ReserveLogic.InterestRateMode.STABLE + ? stableDebt + : variableDebt; + + if (amount < paybackAmount) { + paybackAmount = amount; + } + reserve.updateState(); //burns an equivalent amount of debt tokens From c5d7bb5e80e08a7c901cd7bb41b7bb839c2e0f0e Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 11:04:13 +0100 Subject: [PATCH 25/38] Fixed PVE011 --- .../lendingpool/LendingPoolCollateralManager.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contracts/lendingpool/LendingPoolCollateralManager.sol b/contracts/lendingpool/LendingPoolCollateralManager.sol index b6a0b5ca..16abdd10 100644 --- a/contracts/lendingpool/LendingPoolCollateralManager.sol +++ b/contracts/lendingpool/LendingPoolCollateralManager.sol @@ -194,13 +194,6 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor //update the principal reserve principalReserve.updateState(); - principalReserve.updateInterestRates( - principal, - principalReserve.aTokenAddress, - vars.actualAmountToLiquidate, - 0 - ); - if (vars.userVariableDebt >= vars.actualAmountToLiquidate) { IVariableDebtToken(principalReserve.variableDebtTokenAddress).burn( user, @@ -223,6 +216,13 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor ); } + principalReserve.updateInterestRates( + principal, + principalReserve.aTokenAddress, + vars.actualAmountToLiquidate, + 0 + ); + //if liquidator reclaims the aToken, he receives the equivalent atoken amount if (receiveAToken) { vars.collateralAtoken.transferOnLiquidation(user, msg.sender, vars.maxCollateralToLiquidate); From 8a82c8f1c0a0ccd4766d6d8fc067edbc932ea73a Mon Sep 17 00:00:00 2001 From: eboado Date: Mon, 26 Oct 2020 11:10:57 +0100 Subject: [PATCH 26/38] - Optimized getAddressesProvidersList() on addresses provider registry. --- .../LendingPoolAddressesProviderRegistry.sol | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol index 77c260bf..f2c7dc34 100644 --- a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol +++ b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol @@ -36,13 +36,15 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP * @return the list of addressesProviders **/ function getAddressesProvidersList() external override view returns (address[] memory) { - uint256 maxLength = _addressesProvidersList.length; + address[] memory addressesProvidersList = _addressesProvidersList; + + uint256 maxLength = addressesProvidersList.length; address[] memory activeProviders = new address[](maxLength); - for (uint256 i = 0; i < _addressesProvidersList.length; i++) { - if (_addressesProviders[_addressesProvidersList[i]] > 0) { - activeProviders[i] = _addressesProvidersList[i]; + for (uint256 i = 0; i < maxLength; i++) { + if (_addressesProviders[addressesProvidersList[i]] > 0) { + activeProviders[i] = addressesProvidersList[i]; } } From 14c4b750e1bdbba7fa461718b5ece20f7144552a Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 11:18:25 +0100 Subject: [PATCH 27/38] Fixes PVE013 --- contracts/lendingpool/LendingPool.sol | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 400276e4..76f621ac 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -356,9 +356,10 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage } /** - * @dev rebalances the stable interest rate of a user if current liquidity rate > user stable rate. - * this is regulated by Aave to ensure that the protocol is not abused, and the user is paying a fair - * rate. Anyone can call this function. + * @dev rebalances the stable interest rate of a user. Users can be rebalanced if the following conditions are satisfied: + * 1. Usage ratio is above 95% + * 2. the current deposit APY is below REBALANCE_UP_THRESHOLD * maxVariableBorrowRate, which means that too much has been + * borrowed at a stable rate and depositors are not earning enough. * @param asset the address of the reserve * @param user the address of the user to be rebalanced **/ @@ -373,7 +374,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage uint256 stableBorrowBalance = IERC20(stableDebtToken).balanceOf(user); - //if the utilization rate is below 95%, no rebalances are needed + //if the usage ratio is below 95%, no rebalances are needed uint256 totalBorrows = stableDebtToken .totalSupply() .add(variableDebtToken.totalSupply()) From c14ea749c467fc8b65b580d5891291e780b935e8 Mon Sep 17 00:00:00 2001 From: eboado Date: Mon, 26 Oct 2020 11:18:56 +0100 Subject: [PATCH 28/38] - Optimized length load on _addToAddressesProvidersList(). --- .../configuration/LendingPoolAddressesProviderRegistry.sol | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol index 77c260bf..50e79288 100644 --- a/contracts/configuration/LendingPoolAddressesProviderRegistry.sol +++ b/contracts/configuration/LendingPoolAddressesProviderRegistry.sol @@ -76,7 +76,9 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP * @param provider the pool address to be added **/ function _addToAddressesProvidersList(address provider) internal { - for (uint256 i = 0; i < _addressesProvidersList.length; i++) { + uint256 providersCount = _addressesProvidersList.length; + + for (uint256 i = 0; i < providersCount; i++) { if (_addressesProvidersList[i] == provider) { return; } From 5bd4fd0e13e85bfb0d11b3e76a5bb6a957f11c0f Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 11:58:57 +0100 Subject: [PATCH 29/38] Updated comment --- contracts/lendingpool/LendingPool.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index 76f621ac..ed912a6c 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -418,7 +418,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage /** * @dev allows depositors to enable or disable a specific deposit as collateral. * @param asset the address of the reserve - * @param useAsCollateral true if the user wants to user the deposit as collateral, false otherwise. + * @param useAsCollateral true if the user wants to use the deposit as collateral, false otherwise. **/ function setUserUseReserveAsCollateral(address asset, bool useAsCollateral) external override { _whenNotPaused(); From 7a8ed507f4ebae8e8d4d1c5d5d78ff7fb4a3eadd Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 11:59:49 +0100 Subject: [PATCH 30/38] Fixes PVE013-4 --- contracts/tokenization/StableDebtToken.sol | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contracts/tokenization/StableDebtToken.sol b/contracts/tokenization/StableDebtToken.sol index d24228ea..5d38c464 100644 --- a/contracts/tokenization/StableDebtToken.sol +++ b/contracts/tokenization/StableDebtToken.sol @@ -196,8 +196,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { /** * @dev Calculates the increase in balance since the last user interaction * @param user The address of the user for which the interest is being accumulated - * @return The previous principal balance, the new principal balance, the balance increase - * and the new user index + * @return The previous principal balance, the new principal balance and the balance increase **/ function _calculateBalanceIncrease(address user) internal From 9c283fb4cb28bbfa32c5cd454d08ca7fac17a3d3 Mon Sep 17 00:00:00 2001 From: The3D Date: Mon, 26 Oct 2020 12:14:33 +0100 Subject: [PATCH 31/38] Fixed PVE014 --- contracts/libraries/logic/GenericLogic.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/libraries/logic/GenericLogic.sol b/contracts/libraries/logic/GenericLogic.sol index ac379dc8..a5801b9d 100644 --- a/contracts/libraries/logic/GenericLogic.sol +++ b/contracts/libraries/logic/GenericLogic.sol @@ -25,7 +25,6 @@ library GenericLogic { using UserConfiguration for UserConfiguration.Map; uint256 public constant HEALTH_FACTOR_LIQUIDATION_THRESHOLD = 1 ether; - uint256 public constant HEALTH_FACTOR_CRITICAL_THRESHOLD = 0.98 ether; struct balanceDecreaseAllowedLocalVars { uint256 decimals; From 31a76ef047c4396099c029e7eacd631add4d5387 Mon Sep 17 00:00:00 2001 From: emilio Date: Tue, 27 Oct 2020 10:31:32 +0100 Subject: [PATCH 32/38] Updated ILendingPool --- contracts/interfaces/ILendingPool.sol | 48 +++++++++++++++++++-------- 1 file changed, 34 insertions(+), 14 deletions(-) diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 891781dc..17e75fa6 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -112,15 +112,22 @@ interface ILendingPool { uint256[] premiums, uint16 referralCode ); - /** - * @dev these events are not emitted directly by the LendingPool - * but they are declared here as the LendingPoolCollateralManager - * is executed using a delegateCall(). - * This allows to have the events in the generated ABI for LendingPool. - **/ /** - * @dev emitted when a borrower is liquidated + * @dev Emitted when the pause is triggered. + */ + event Paused(); + + /** + * @dev Emitted when the pause is lifted. + */ + event Unpaused(); + + /** + * @dev emitted when a borrower is liquidated. Thos evemt is emitted directly by the LendingPool + * but it's declared here as the LendingPoolCollateralManager + * is executed using a delegateCall(). + * This allows to have the events in the generated ABI for LendingPool. * @param collateral the address of the collateral being liquidated * @param principal the address of the reserve * @param user the address of the user being liquidated @@ -138,15 +145,28 @@ interface ILendingPool { address liquidator, bool receiveAToken ); - /** - * @dev Emitted when the pause is triggered. - */ - event Paused(); /** - * @dev Emitted when the pause is lifted. - */ - event Unpaused(); + * @dev Emitted when the state of a reserve is updated. NOTE: This event is actually declared + * in the ReserveLogic library and emitted in the updateInterestRates() function. Since the function is internal, + * the event will actually be fired by the LendingPool contract. The event is therefore replicated here so it + * gets added to the LendingPool ABI + * @param reserve the address of the reserve + * @param liquidityRate the new liquidity rate + * @param stableBorrowRate the new stable borrow rate + * @param variableBorrowRate the new variable borrow rate + * @param liquidityIndex the new liquidity index + * @param variableBorrowIndex the new variable borrow index + **/ + event ReserveDataUpdated( + address indexed reserve, + uint256 liquidityRate, + uint256 stableBorrowRate, + uint256 averageStableBorrowRate, + uint256 variableBorrowRate, + uint256 liquidityIndex, + uint256 variableBorrowIndex + ); /** * @dev deposits The underlying asset into the reserve. A corresponding amount of the overlying asset (aTokens) From aba38a800fc0bcbf6d035faa231f2356960fd770 Mon Sep 17 00:00:00 2001 From: emilio Date: Tue, 27 Oct 2020 10:36:02 +0100 Subject: [PATCH 33/38] Fixed event for the avg stable rate --- contracts/tokenization/StableDebtToken.sol | 19 ++++++++++++++----- .../interfaces/IStableDebtToken.sol | 8 ++++++-- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/contracts/tokenization/StableDebtToken.sol b/contracts/tokenization/StableDebtToken.sol index 5d38c464..346d9719 100644 --- a/contracts/tokenization/StableDebtToken.sol +++ b/contracts/tokenization/StableDebtToken.sol @@ -128,7 +128,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { _totalSupplyTimestamp = _timestamps[user] = uint40(block.timestamp); //calculates the updated average stable rate - _avgStableRate = vars + vars.currentAvgStableRate = _avgStableRate = vars .currentAvgStableRate .rayMul(vars.previousSupply.wadToRay()) .add(rate.rayMul(vars.amountInRay)) @@ -139,7 +139,15 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { // transfer event to track balances emit Transfer(address(0), user, amount); - emit Mint(user, amount, previousBalance, currentBalance, balanceIncrease, vars.newStableRate); + emit Mint( + user, + amount, + previousBalance, + currentBalance, + balanceIncrease, + vars.newStableRate, + vars.currentAvgStableRate + ); } /** @@ -155,17 +163,18 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { ) = _calculateBalanceIncrease(user); uint256 previousSupply = totalSupply(); + uint256 newStableRate = 0; //since the total supply and each single user debt accrue separately, //there might be accumulation errors so that the last borrower repaying //might actually try to repay more than the available debt supply. //in this case we simply set the total supply and the avg stable rate to 0 if (previousSupply <= amount) { - _avgStableRate = 0; + newStableRate = _avgStableRate = 0; _totalSupply = 0; } else { uint256 nextSupply = _totalSupply = previousSupply.sub(amount); - _avgStableRate = _avgStableRate + newStableRate = _avgStableRate = _avgStableRate .rayMul(previousSupply.wadToRay()) .sub(_usersData[user].rayMul(amount.wadToRay())) .rayDiv(nextSupply.wadToRay()); @@ -190,7 +199,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase { // transfer event to track balances emit Transfer(user, address(0), amount); - emit Burn(user, amount, previousBalance, currentBalance, balanceIncrease); + emit Burn(user, amount, previousBalance, currentBalance, balanceIncrease, newStableRate); } /** diff --git a/contracts/tokenization/interfaces/IStableDebtToken.sol b/contracts/tokenization/interfaces/IStableDebtToken.sol index 8862c30d..4c0d5940 100644 --- a/contracts/tokenization/interfaces/IStableDebtToken.sol +++ b/contracts/tokenization/interfaces/IStableDebtToken.sol @@ -21,6 +21,7 @@ interface IStableDebtToken { * @param currentBalance the current balance of the user * @param balanceIncrease the debt increase since the last update * @param newRate the rate of the debt after the minting + * @param avgStableRate the new average stable rate after the minting **/ event Mint( address indexed user, @@ -28,7 +29,8 @@ interface IStableDebtToken { uint256 previousBalance, uint256 currentBalance, uint256 balanceIncrease, - uint256 newRate + uint256 newRate, + uint256 avgStableRate ); /** @@ -38,13 +40,15 @@ interface IStableDebtToken { * @param previousBalance the previous balance of the user * @param currentBalance the current balance of the user * @param balanceIncrease the debt increase since the last update + * @param avgStableRate the new average stable rate after the minting **/ event Burn( address indexed user, uint256 amount, uint256 previousBalance, uint256 currentBalance, - uint256 balanceIncrease + uint256 balanceIncrease, + uint256 avgStableRate ); /** From 0a6b1caad0716b57e1a8d54dfd07ae99087c5d22 Mon Sep 17 00:00:00 2001 From: eboado Date: Tue, 27 Oct 2020 10:44:37 +0100 Subject: [PATCH 34/38] - Added comment to SECONDS_PER_YEAR constant --- contracts/libraries/math/MathUtils.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/contracts/libraries/math/MathUtils.sol b/contracts/libraries/math/MathUtils.sol index 63eb0abe..662ef7c3 100644 --- a/contracts/libraries/math/MathUtils.sol +++ b/contracts/libraries/math/MathUtils.sol @@ -8,6 +8,7 @@ library MathUtils { using SafeMath for uint256; using WadRayMath for uint256; + /// @dev Ignoring leap years uint256 internal constant SECONDS_PER_YEAR = 365 days; /** From 4834a587f5e127a05bd1b4bc73678915facca48e Mon Sep 17 00:00:00 2001 From: emilio Date: Tue, 27 Oct 2020 10:47:01 +0100 Subject: [PATCH 35/38] Fixed the amountToWithdraw in withdraw event --- contracts/lendingpool/LendingPool.sol | 2 +- package-lock.json | 278 ++++++++++++++------------ 2 files changed, 146 insertions(+), 134 deletions(-) diff --git a/contracts/lendingpool/LendingPool.sol b/contracts/lendingpool/LendingPool.sol index be1333de..c63ff348 100644 --- a/contracts/lendingpool/LendingPool.sol +++ b/contracts/lendingpool/LendingPool.sol @@ -157,7 +157,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage IAToken(aToken).burn(msg.sender, msg.sender, amountToWithdraw, reserve.liquidityIndex); - emit Withdraw(asset, msg.sender, amount); + emit Withdraw(asset, msg.sender, amountToWithdraw); } /** diff --git a/package-lock.json b/package-lock.json index 51b67993..b44b0962 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2094,9 +2094,9 @@ "dev": true }, "@types/qs": { - "version": "6.9.3", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.3.tgz", - "integrity": "sha512-7s9EQWupR1fTc2pSMtXRQ9w9gLOcrJn+h7HOXw4evxyvVqMi4f+q7d2tnFe3ng3SNHjtK+0EzGMGFUQX4/AQRA==", + "version": "6.9.5", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.5.tgz", + "integrity": "sha512-/JHkVHtx/REVG0VVToGRGH2+23hsYLHdyG+GrvoUGlGAd0ErauXDyvHtRI/7H7mzLm+tBCKA7pfcpkQ1lf58iQ==", "dev": true }, "@types/resolve": { @@ -2889,12 +2889,12 @@ "dev": true }, "buidler-gas-reporter": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/buidler-gas-reporter/-/buidler-gas-reporter-0.1.3.tgz", - "integrity": "sha512-3Q27K52iGEghJ4icDdkV/67iJiRCaiZ39E2LLCBNZgx5NvltI5Q7oR3RVyCGO/m3SZBcj418zC8p7yeyj/jFdw==", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/buidler-gas-reporter/-/buidler-gas-reporter-0.1.4.tgz", + "integrity": "sha512-objSu/tGggxKDmlpZViM9uEKRSo7vXxBsPv+vXegre1AWapJXQNfJPtBmrNvnT5Ixl8pecWSRXsfO95nJAn4yw==", "dev": true, "requires": { - "eth-gas-reporter": "^0.2.13" + "eth-gas-reporter": "^0.2.18" } }, "buidler-typechain": { @@ -4108,13 +4108,13 @@ } }, "eth-gas-reporter": { - "version": "0.2.17", - "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.17.tgz", - "integrity": "sha512-MsrUqeXTAFU9QEdAIdaVu+QeU1XwFsKvPDEC68iheppVR5xUP11h4SyPhSRZiGfOzXr1CfTtPM/B6wPGtt7/LA==", + "version": "0.2.18", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.18.tgz", + "integrity": "sha512-P6LQ1QmU9bqU4zmd01Ws/b2EWAD5rT771U0wyJ/c+fKE6RdE9ks8KzjdR1zjosV2uilMfqVTtrBrXveCOnaTyQ==", "dev": true, "requires": { "@ethersproject/abi": "^5.0.0-beta.146", - "@solidity-parser/parser": "^0.5.2", + "@solidity-parser/parser": "^0.8.0", "cli-table3": "^0.5.0", "colors": "^1.1.2", "ethereumjs-util": "6.2.0", @@ -4130,6 +4130,27 @@ "sync-request": "^6.0.0" }, "dependencies": { + "@solidity-parser/parser": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.8.1.tgz", + "integrity": "sha512-DF7H6T8I4lo2IZOE2NZwt3631T8j1gjpQLjmvY2xBNK50c4ltslR4XPKwT6RkeSd4+xCAK0GHC/k7sbRDBE4Yw==", + "dev": true + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, "ethereumjs-util": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.0.tgz", @@ -4146,37 +4167,20 @@ } }, "ethers": { - "version": "4.0.47", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.47.tgz", - "integrity": "sha512-hssRYhngV4hiDNeZmVU/k5/E8xmLG8UpcNUzg6mb7lqhgpFPH/t7nuv20RjRrEf0gblzvi2XwR5Te+V3ZFc9pQ==", + "version": "4.0.48", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-4.0.48.tgz", + "integrity": "sha512-sZD5K8H28dOrcidzx9f8KYh8083n5BexIO3+SbE4jK83L85FxtpXZBCQdXb8gkg+7sBqomcLhhkU7UHL+F7I2g==", "dev": true, "requires": { "aes-js": "3.0.0", "bn.js": "^4.4.0", - "elliptic": "6.5.2", + "elliptic": "6.5.3", "hash.js": "1.1.3", "js-sha3": "0.5.7", "scrypt-js": "2.0.4", "setimmediate": "1.0.4", "uuid": "2.0.1", "xmlhttprequest": "1.8.0" - }, - "dependencies": { - "elliptic": { - "version": "6.5.2", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.2.tgz", - "integrity": "sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==", - "dev": true, - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - } } }, "hash.js": { @@ -5264,13 +5268,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": { @@ -5279,7 +5283,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": { @@ -5288,7 +5292,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": { @@ -5297,19 +5301,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": { @@ -5323,25 +5327,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": { @@ -5351,7 +5355,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": { @@ -5362,7 +5366,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": { @@ -5371,13 +5375,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": { @@ -5390,7 +5394,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": { @@ -5404,7 +5408,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": { @@ -5417,13 +5421,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": { @@ -5434,7 +5438,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": { @@ -5449,13 +5453,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": { @@ -5464,7 +5468,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": { @@ -5479,7 +5483,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": { @@ -5489,7 +5493,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": { @@ -5499,7 +5503,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": { @@ -5514,13 +5518,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": { @@ -5529,13 +5533,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": { @@ -5544,7 +5548,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": { @@ -5554,7 +5558,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": { @@ -5564,7 +5568,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": { @@ -5575,43 +5579,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": { @@ -5623,7 +5627,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": { @@ -5632,7 +5636,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": { @@ -5642,7 +5646,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": { @@ -5651,7 +5655,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": { @@ -5662,7 +5666,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": { @@ -5673,37 +5677,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": { @@ -5712,7 +5716,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": { @@ -5721,7 +5725,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": { @@ -5732,25 +5736,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": { @@ -5759,7 +5763,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": { @@ -5768,25 +5772,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": { @@ -5796,19 +5800,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": { @@ -5818,7 +5822,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": { @@ -5828,13 +5832,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": { @@ -5850,19 +5854,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": { @@ -5872,7 +5876,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": { @@ -5881,25 +5885,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": { @@ -5909,7 +5913,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": { @@ -5920,7 +5924,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": { @@ -5929,13 +5933,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": { @@ -5944,7 +5948,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": { @@ -5953,13 +5957,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": { @@ -5970,19 +5974,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": { @@ -6001,7 +6005,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": { @@ -21252,9 +21256,9 @@ }, "dependencies": { "@types/node": { - "version": "10.17.26", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.26.tgz", - "integrity": "sha512-myMwkO2Cr82kirHY8uknNRHEVtn0wV3DTQfkrjx17jmkstDRZ24gNUdl8AHXVyVclTYI/bNjgTPTAWvWLqXqkw==", + "version": "10.17.43", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.43.tgz", + "integrity": "sha512-F7xV2kxZGb3seVP3UQt3msHcoDCtDi8WNO/UCzNLhRwaYVT4yJO1ndcV+vCTnY+jiAVqyLZq/VJbRE/AhwqEag==", "dev": true } } @@ -23736,21 +23740,29 @@ } }, "request-promise-core": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.3.tgz", - "integrity": "sha512-QIs2+ArIGQVp5ZYbWD5ZLCY29D5CfWizP8eWnm8FoGD1TX61veauETVQbrV60662V0oFBkrDOuaBI8XgtuyYAQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", "dev": true, "requires": { - "lodash": "^4.17.15" + "lodash": "^4.17.19" + }, + "dependencies": { + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } } }, "request-promise-native": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.8.tgz", - "integrity": "sha512-dapwLGqkHtwL5AEbfenuzjTYg35Jd6KPytsC2/TLkVMz8rm+tNt72MGUWT1RP/aYawMpN6HqbNGBQaRcBtjQMQ==", + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", + "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", "dev": true, "requires": { - "request-promise-core": "1.1.3", + "request-promise-core": "1.1.4", "stealthy-require": "^1.1.1", "tough-cookie": "^2.3.3" } @@ -24746,9 +24758,9 @@ }, "dependencies": { "@types/node": { - "version": "8.10.61", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.61.tgz", - "integrity": "sha512-l+zSbvT8TPRaCxL1l9cwHCb0tSqGAGcjPJFItGGYat5oCTiq1uQQKYg5m7AF1mgnEBzFXGLJ2LRmNjtreRX76Q==", + "version": "8.10.65", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.65.tgz", + "integrity": "sha512-xdcqtQl1g3p/49kmcj7ZixPWOcNHA1tYNz+uN0PJEcgtN6zywK74aacTnd3eFGPuBpD7kK8vowmMRkUt6jHU/Q==", "dev": true } } From 1f8efbd4f523055d2b6a46a57dc00585fbc73a6b Mon Sep 17 00:00:00 2001 From: emilio Date: Tue, 27 Oct 2020 11:08:11 +0100 Subject: [PATCH 36/38] Removed swapAdapter from the migration scripts --- deployed-contracts.json | 8 ++++---- helpers/contracts-helpers.ts | 11 ----------- helpers/types.ts | 1 - test/__setup.spec.ts | 4 ---- test/helpers/make-suite.ts | 6 ------ test/pausable-functions.spec.ts | 2 +- 6 files changed, 5 insertions(+), 27 deletions(-) diff --git a/deployed-contracts.json b/deployed-contracts.json index c924bcb9..f924b450 100644 --- a/deployed-contracts.json +++ b/deployed-contracts.json @@ -235,7 +235,7 @@ }, "WalletBalanceProvider": { "buidlerevm": { - "address": "0x2cfcA5785261fbC88EFFDd46fCFc04c22525F9e4", + "address": "0xDf73fC454FA018051D4a1509e63D11530A59DE10", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -640,7 +640,7 @@ }, "MockAToken": { "buidlerevm": { - "address": "0x392E5355a0e88Bd394F717227c752670fb3a8020", + "address": "0x3bDA11B584dDff7F66E0cFe1da1562c92B45db60", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -668,7 +668,7 @@ }, "MockStableDebtToken": { "buidlerevm": { - "address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460", + "address": "0x392E5355a0e88Bd394F717227c752670fb3a8020", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { @@ -682,7 +682,7 @@ }, "MockVariableDebtToken": { "buidlerevm": { - "address": "0xEBAB67ee3ef604D5c250A53b4b8fcbBC6ec3007C", + "address": "0x3b050AFb4ac4ACE646b31fF3639C1CD43aC31460", "deployer": "0xc783df8a850f42e7F7e57013759C285caa701eB6" }, "localhost": { diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index a53da9ca..93f0c307 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -47,7 +47,6 @@ const { export type MockTokenMap = {[symbol: string]: MintableERC20}; import {ZERO_ADDRESS} from './constants'; -import {MockSwapAdapter} from '../types/MockSwapAdapter'; import {signTypedData_v4, TypedData} from 'eth-sig-util'; import {fromRpcSig, ECDSASignature} from 'ethereumjs-util'; import {SignerWithAddress} from '../test/helpers/make-suite'; @@ -322,8 +321,6 @@ export const deployWalletBalancerProvider = async ( } return instance; }; -export const deployMockSwapAdapter = async (addressesProvider: tEthereumAddress) => - await deployContract(eContractid.MockSwapAdapter, [addressesProvider]); export const deployAaveProtocolTestHelpers = async ( addressesProvider: tEthereumAddress, @@ -549,14 +546,6 @@ export const getMockFlashLoanReceiver = async (address?: tEthereumAddress) => { ); }; -export const getMockSwapAdapter = async (address?: tEthereumAddress) => { - return await getContract( - eContractid.MockSwapAdapter, - address || - (await getDb().get(`${eContractid.MockSwapAdapter}.${BRE.network.name}`).value()).address - ); -}; - export const getLendingRateOracle = async (address?: tEthereumAddress) => { return await getContract( eContractid.LendingRateOracle, diff --git a/helpers/types.ts b/helpers/types.ts index ce5f0e2e..305ec335 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -44,7 +44,6 @@ export enum eContractid { LendingPoolCollateralManager = 'LendingPoolCollateralManager', InitializableAdminUpgradeabilityProxy = 'InitializableAdminUpgradeabilityProxy', MockFlashLoanReceiver = 'MockFlashLoanReceiver', - MockSwapAdapter = 'MockSwapAdapter', WalletBalanceProvider = 'WalletBalanceProvider', AToken = 'AToken', MockAToken = 'MockAToken', diff --git a/test/__setup.spec.ts b/test/__setup.spec.ts index 676ae52a..8a7b1e62 100644 --- a/test/__setup.spec.ts +++ b/test/__setup.spec.ts @@ -19,7 +19,6 @@ import { registerContractInJsonDb, getPairsTokenAggregator, initReserves, - deployMockSwapAdapter, deployLendingRateOracle, } from '../helpers/contracts-helpers'; import {Signer} from 'ethers'; @@ -239,9 +238,6 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const mockFlashLoanReceiver = await deployMockFlashLoanReceiver(addressesProvider.address); await insertContractAddressInDb(eContractid.MockFlashLoanReceiver, mockFlashLoanReceiver.address); - const mockSwapAdapter = await deployMockSwapAdapter(addressesProvider.address); - await insertContractAddressInDb(eContractid.MockSwapAdapter, mockSwapAdapter.address); - await deployWalletBalancerProvider(addressesProvider.address); console.timeEnd('setup'); diff --git a/test/helpers/make-suite.ts b/test/helpers/make-suite.ts index 5eb8788f..6618725f 100644 --- a/test/helpers/make-suite.ts +++ b/test/helpers/make-suite.ts @@ -9,7 +9,6 @@ import { getMintableErc20, getLendingPoolConfiguratorProxy, getPriceOracle, - getMockSwapAdapter, getLendingPoolAddressesProviderRegistry, } from '../../helpers/contracts-helpers'; import {tEthereumAddress} from '../../helpers/types'; @@ -25,7 +24,6 @@ import bignumberChai from 'chai-bignumber'; import {almostEqual} from './almost-equal'; import {PriceOracle} from '../../types/PriceOracle'; import {LendingPoolAddressesProvider} from '../../types/LendingPoolAddressesProvider'; -import {MockSwapAdapter} from '../../types/MockSwapAdapter'; import {LendingPoolAddressesProviderRegistry} from '../../types/LendingPoolAddressesProviderRegistry'; chai.use(bignumberChai()); chai.use(almostEqual()); @@ -48,7 +46,6 @@ export interface TestEnv { usdc: MintableERC20; lend: MintableERC20; addressesProvider: LendingPoolAddressesProvider; - mockSwapAdapter: MockSwapAdapter; registry: LendingPoolAddressesProviderRegistry; } @@ -73,7 +70,6 @@ const testEnv: TestEnv = { usdc: {} as MintableERC20, lend: {} as MintableERC20, addressesProvider: {} as LendingPoolAddressesProvider, - mockSwapAdapter: {} as MockSwapAdapter, registry: {} as LendingPoolAddressesProviderRegistry, } as TestEnv; @@ -134,8 +130,6 @@ export async function initializeMakeSuite() { testEnv.usdc = await getMintableErc20(usdcAddress); testEnv.lend = await getMintableErc20(lendAddress); testEnv.weth = await getMintableErc20(wethAddress); - - testEnv.mockSwapAdapter = await getMockSwapAdapter(); } export function makeSuite(name: string, tests: (testEnv: TestEnv) => void) { diff --git a/test/pausable-functions.spec.ts b/test/pausable-functions.spec.ts index cc8fb0d4..48c50ee2 100644 --- a/test/pausable-functions.spec.ts +++ b/test/pausable-functions.spec.ts @@ -275,7 +275,7 @@ makeSuite('Pausable Pool', (testEnv: TestEnv) => { }); it('SwapBorrowRateMode', async () => { - const {pool, weth, dai, usdc, users, configurator, mockSwapAdapter} = testEnv; + const {pool, weth, dai, usdc, users, configurator} = testEnv; const user = users[1]; const amountWETHToDeposit = parseEther('10'); const amountDAIToDeposit = parseEther('120'); From e88d9dc81b009a5ce5f9ce4ef9dac06aa09b7ee1 Mon Sep 17 00:00:00 2001 From: eboado Date: Tue, 27 Oct 2020 12:44:30 +0100 Subject: [PATCH 37/38] - Optimized calculateLinearInterest() on MathUtils. --- contracts/libraries/math/MathUtils.sol | 4 +--- test/helpers/utils/calculations.ts | 9 +++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/contracts/libraries/math/MathUtils.sol b/contracts/libraries/math/MathUtils.sol index 63eb0abe..5263279b 100644 --- a/contracts/libraries/math/MathUtils.sol +++ b/contracts/libraries/math/MathUtils.sol @@ -25,9 +25,7 @@ library MathUtils { //solium-disable-next-line uint256 timeDifference = block.timestamp.sub(uint256(lastUpdateTimestamp)); - uint256 timeDelta = timeDifference.wadToRay().rayDiv(SECONDS_PER_YEAR.wadToRay()); - - return rate.rayMul(timeDelta).add(WadRayMath.ray()); + return (rate.mul(timeDifference) / SECONDS_PER_YEAR).add(WadRayMath.ray()); } /** diff --git a/test/helpers/utils/calculations.ts b/test/helpers/utils/calculations.ts index 46623a62..7bffad2d 100644 --- a/test/helpers/utils/calculations.ts +++ b/test/helpers/utils/calculations.ts @@ -1153,11 +1153,12 @@ const calcLinearInterest = ( currentTimestamp: BigNumber, lastUpdateTimestamp: BigNumber ) => { - const timeDifference = currentTimestamp.minus(lastUpdateTimestamp).wadToRay(); + const timeDifference = currentTimestamp.minus(lastUpdateTimestamp); - const timeDelta = timeDifference.rayDiv(new BigNumber(ONE_YEAR).wadToRay()); - - const cumulatedInterest = rate.rayMul(timeDelta).plus(RAY); + const cumulatedInterest = rate + .multipliedBy(timeDifference) + .dividedBy(new BigNumber(ONE_YEAR)) + .plus(RAY); return cumulatedInterest; }; From 85246906e41a8515fb06d1f204ec720bc5f98e6c Mon Sep 17 00:00:00 2001 From: eboado Date: Tue, 27 Oct 2020 13:04:07 +0100 Subject: [PATCH 38/38] - Removed shadowing of totalSupply on IncentiveizedERC20 --- contracts/tokenization/IncentivizedERC20.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/tokenization/IncentivizedERC20.sol b/contracts/tokenization/IncentivizedERC20.sol index 771a8202..d97e9da2 100644 --- a/contracts/tokenization/IncentivizedERC20.sol +++ b/contracts/tokenization/IncentivizedERC20.sol @@ -181,10 +181,10 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed { _balances[recipient] = _balances[recipient].add(amount); if (address(_incentivesController) != address(0)) { - uint256 totalSupply = _totalSupply; - _incentivesController.handleAction(sender, totalSupply, oldSenderBalance); + uint256 currentTotalSupply = _totalSupply; + _incentivesController.handleAction(sender, currentTotalSupply, oldSenderBalance); if (sender != recipient) { - _incentivesController.handleAction(recipient, totalSupply, oldRecipientBalance); + _incentivesController.handleAction(recipient, currentTotalSupply, oldRecipientBalance); } } }