mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'master' into '155-use-the-delegationawareatoken-for-the-uni-deployment'
# Conflicts: # tasks/full/5_initialize.ts
This commit is contained in:
commit
6e7567c842
|
@ -1,8 +1,8 @@
|
|||
stages:
|
||||
- test
|
||||
- checks
|
||||
|
||||
test:
|
||||
stage: test
|
||||
stage: checks
|
||||
tags:
|
||||
- aave-build-runner
|
||||
before_script:
|
||||
|
@ -12,3 +12,15 @@ test:
|
|||
after_script:
|
||||
- docker-compose -f docker-compose.test.yml run contracts-env npm run ci:clean
|
||||
- docker-compose -f docker-compose.test.yml down
|
||||
|
||||
deploy-mainnet-fork:
|
||||
stage: checks
|
||||
tags:
|
||||
- aave-build-runner
|
||||
before_script:
|
||||
- docker-compose -f docker-compose.test.yml build
|
||||
script:
|
||||
- docker-compose -f docker-compose.test.yml run contracts-env npm run aave:fork:main
|
||||
after_script:
|
||||
- docker-compose -f docker-compose.test.yml run contracts-env npm run ci:clean
|
||||
- docker-compose -f docker-compose.test.yml down
|
||||
|
|
|
@ -24,13 +24,8 @@ contract WalletBalanceProvider {
|
|||
using SafeERC20 for IERC20;
|
||||
using ReserveConfiguration for ReserveConfiguration.Map;
|
||||
|
||||
ILendingPoolAddressesProvider internal immutable _provider;
|
||||
address constant MOCK_ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
|
||||
|
||||
constructor(ILendingPoolAddressesProvider provider) public {
|
||||
_provider = provider;
|
||||
}
|
||||
|
||||
/**
|
||||
@dev Fallback function, don't accept any ETH
|
||||
**/
|
||||
|
@ -80,12 +75,12 @@ contract WalletBalanceProvider {
|
|||
/**
|
||||
@dev provides balances of user wallet for all reserves available on the pool
|
||||
*/
|
||||
function getUserWalletBalances(address user)
|
||||
function getUserWalletBalances(address provider, address user)
|
||||
external
|
||||
view
|
||||
returns (address[] memory, uint256[] memory)
|
||||
{
|
||||
ILendingPool pool = ILendingPool(_provider.getLendingPool());
|
||||
ILendingPool pool = ILendingPool(ILendingPoolAddressesProvider(provider).getLendingPool());
|
||||
|
||||
address[] memory reserves = pool.getReservesList();
|
||||
address[] memory reservesWithEth = new address[](reserves.length + 1);
|
||||
|
|
|
@ -4,4 +4,6 @@ services:
|
|||
build:
|
||||
context: ./
|
||||
dockerfile: ./Dockerfile_test
|
||||
command: npm run test
|
||||
environment:
|
||||
- MNEMONIC
|
||||
- ALCHEMY_KEY
|
||||
|
|
|
@ -244,14 +244,11 @@ export const deployMockFlashLoanReceiver = async (
|
|||
verify
|
||||
);
|
||||
|
||||
export const deployWalletBalancerProvider = async (
|
||||
addressesProvider: tEthereumAddress,
|
||||
verify?: boolean
|
||||
) =>
|
||||
export const deployWalletBalancerProvider = async (verify?: boolean) =>
|
||||
withSaveAndVerify(
|
||||
await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(addressesProvider),
|
||||
await new WalletBalanceProviderFactory(await getFirstSigner()).deploy(),
|
||||
eContractid.WalletBalanceProvider,
|
||||
[addressesProvider],
|
||||
[],
|
||||
verify
|
||||
);
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
mockFlashLoanReceiver.address
|
||||
);
|
||||
|
||||
await deployWalletBalancerProvider(addressesProvider.address, verify);
|
||||
await deployWalletBalancerProvider(verify);
|
||||
|
||||
await insertContractAddressInDb(eContractid.AaveProtocolDataProvider, testHelpers.address);
|
||||
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {deployWalletBalancerProvider} from '../../helpers/contracts-deployments';
|
||||
import { task } from 'hardhat/config';
|
||||
import { deployWalletBalancerProvider } from '../../helpers/contracts-deployments';
|
||||
|
||||
import {getLendingPoolAddressesProvider} from '../../helpers/contracts-getters';
|
||||
import { getLendingPoolAddressesProvider } from '../../helpers/contracts-getters';
|
||||
|
||||
task('dev:wallet-balance-provider', 'Initialize lending pool configuration.')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
.setAction(async ({ verify }, localBRE) => {
|
||||
await localBRE.run('set-DRE');
|
||||
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
await deployWalletBalancerProvider(addressesProvider.address, verify);
|
||||
await deployWalletBalancerProvider(verify);
|
||||
});
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import {task} from 'hardhat/config';
|
||||
import {deployAaveProtocolDataProvider} from '../../helpers/contracts-deployments';
|
||||
import {exit} from 'process';
|
||||
import {getLendingPoolAddressesProvider} from '../../helpers/contracts-getters';
|
||||
import { task } from 'hardhat/config';
|
||||
import { deployAaveProtocolDataProvider } from '../../helpers/contracts-deployments';
|
||||
import { exit } from 'process';
|
||||
import { getLendingPoolAddressesProvider } from '../../helpers/contracts-getters';
|
||||
|
||||
task('full:data-provider', 'Initialize lending pool configuration.')
|
||||
.addFlag('verify', 'Verify contracts at Etherscan')
|
||||
.setAction(async ({verify}, localBRE) => {
|
||||
.setAction(async ({ verify }, localBRE) => {
|
||||
try {
|
||||
await localBRE.run('set-DRE');
|
||||
|
|
@ -15,7 +15,10 @@ import {
|
|||
enableReservesAsCollateralByHelper,
|
||||
} from '../../helpers/init-helpers';
|
||||
import { exit } from 'process';
|
||||
import { getLendingPoolAddressesProvider } from '../../helpers/contracts-getters';
|
||||
import {
|
||||
getAaveProtocolDataProvider,
|
||||
getLendingPoolAddressesProvider,
|
||||
} from '../../helpers/contracts-getters';
|
||||
import { ZERO_ADDRESS } from '../../helpers/constants';
|
||||
|
||||
task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
||||
|
@ -32,7 +35,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
|
||||
const addressesProvider = await getLendingPoolAddressesProvider();
|
||||
|
||||
const testHelpers = await deployAaveProtocolDataProvider(addressesProvider.address, verify);
|
||||
const testHelpers = await getAaveProtocolDataProvider();
|
||||
|
||||
const admin = await addressesProvider.getPoolAdmin();
|
||||
if (!reserveAssets) {
|
||||
|
@ -48,7 +51,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
|
|||
await addressesProvider.setLendingPoolCollateralManager(collateralManager.address)
|
||||
);
|
||||
|
||||
await deployWalletBalancerProvider(addressesProvider.address, verify);
|
||||
await deployWalletBalancerProvider(verify);
|
||||
|
||||
const wethAddress = await getWethAddress(poolConfig);
|
||||
const lendingPoolAddress = await addressesProvider.getLendingPool();
|
||||
|
|
|
@ -226,7 +226,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => {
|
|||
const mockFlashLoanReceiver = await deployMockFlashLoanReceiver(addressesProvider.address);
|
||||
await insertContractAddressInDb(eContractid.MockFlashLoanReceiver, mockFlashLoanReceiver.address);
|
||||
|
||||
await deployWalletBalancerProvider(addressesProvider.address);
|
||||
await deployWalletBalancerProvider();
|
||||
|
||||
await deployWETHGateway([mockTokens.WETH.address, lendingPoolAddress]);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user