feat: Revised Avalanche configs. Add UiPoolDataProvider helper to deployment scripts.

This commit is contained in:
karotjal 2021-09-20 10:59:13 +02:00
parent a7a54b51ae
commit 242850241f
5 changed files with 22 additions and 31 deletions

View File

@ -147,19 +147,19 @@ export const CommonsConfig: ICommonConfiguration = {
[eAvalancheNetwork.fuji]: '',
},
WETH: {
[eAvalancheNetwork.avalanche]: '0xf20d962a6c8f70c731bd838a3a388D7d48fA6e15', // WETH Address
[eAvalancheNetwork.fuji]: '0x3b8b3fc85ccA720809Af2dA4B58cF4ce84bcbdd0', // MintableERC20 WETH
[eAvalancheNetwork.avalanche]: '',
[eAvalancheNetwork.fuji]: '',
},
WrappedNativeToken: {
[eAvalancheNetwork.avalanche]: '0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7', // Official WAVAX
[eAvalancheNetwork.fuji]: '0xd00ae08403B9bbb9124bB305C09058E32C39A48c', // Official WAVAX
},
ReserveFactorTreasuryAddress: {
[eAvalancheNetwork.avalanche]: '0xBDEE917d2BDE529eDEc5b20e0B770F56EDFE8e74', // Not Final, only for test purposes
[eAvalancheNetwork.fuji]: '0xB45F5C501A22288dfdb897e5f73E189597e09288', // Self-controlled EOA
[eAvalancheNetwork.avalanche]: '', // TO BE DEPLOYED
[eAvalancheNetwork.fuji]: '0xB45F5C501A22288dfdb897e5f73E189597e09288', // Self-controlled EOA for testing
},
IncentivesController: {
[eAvalancheNetwork.avalanche]: ZERO_ADDRESS, // Not final, no incentives proxy for test purposes
[eAvalancheNetwork.fuji]: '0xa1EF206fb9a8D8186157FC817fCddcC47727ED55', // WAVAX Incentives Controller
[eAvalancheNetwork.avalanche]: '0x01D83Fe6A10D2f2B7AF17034343746188272cAc9',
[eAvalancheNetwork.fuji]: '0xa1EF206fb9a8D8186157FC817fCddcC47727ED55',
},
};

View File

@ -1,10 +1,4 @@
import { oneRay, ZERO_ADDRESS } from '../../helpers/constants';
import {
IAaveConfiguration,
eEthereumNetwork,
eAvalancheNetwork,
IAvalancheConfiguration,
} from '../../helpers/types';
import { eAvalancheNetwork, IAvalancheConfiguration } from '../../helpers/types';
import { CommonsConfig } from './commons';
import {

View File

@ -3,15 +3,10 @@ import { getParamPerNetwork } from '../../helpers/contracts-helpers';
import {
deployLendingPoolCollateralManager,
deployWalletBalancerProvider,
deployWETHGateway,
authorizeWETHGateway,
deployUiPoolDataProvider,
} from '../../helpers/contracts-deployments';
import {
loadPoolConfig,
ConfigNames,
getWethAddress,
getTreasuryAddress,
} from '../../helpers/configuration';
import { loadPoolConfig, ConfigNames, getTreasuryAddress } from '../../helpers/configuration';
import { getWETHGateway } from '../../helpers/contracts-getters';
import { eNetwork, ICommonConfiguration } from '../../helpers/types';
import { notFalsyOrZeroAddress, waitForTx } from '../../helpers/misc-utils';
@ -50,6 +45,8 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
const testHelpers = await getAaveProtocolDataProvider();
const admin = await addressesProvider.getPoolAdmin();
const oracle = await addressesProvider.getPriceOracle();
if (!reserveAssets) {
throw 'Reserve assets is undefined. Check ReserveAssets configuration at config directory';
}
@ -103,6 +100,12 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.')
await deployWalletBalancerProvider(verify);
const uiPoolDataProvider = await deployUiPoolDataProvider(
[incentivesController, oracle],
verify
);
console.log('UiPoolDataProvider deployed at:', uiPoolDataProvider.address);
const lendingPoolAddress = await addressesProvider.getLendingPool();
let gateWay = getParamPerNetwork(WethGateway, network);

View File

@ -1,11 +1,9 @@
import { error } from 'console';
import { zeroAddress } from 'ethereumjs-util';
import { task } from 'hardhat/config';
import {
loadPoolConfig,
ConfigNames,
getWethAddress,
getTreasuryAddress,
getWrappedNativeTokenAddress,
} from '../../helpers/configuration';
import { ZERO_ADDRESS } from '../../helpers/constants';
import {
@ -53,7 +51,8 @@ task('verify:general', 'Verify contracts at Etherscan')
: await getLendingPoolAddressesProviderRegistry();
const lendingPoolAddress = await addressesProvider.getLendingPool();
const lendingPoolConfiguratorAddress = await addressesProvider.getLendingPoolConfigurator(); //getLendingPoolConfiguratorProxy();
const lendingPoolCollateralManagerAddress = await addressesProvider.getLendingPoolCollateralManager();
const lendingPoolCollateralManagerAddress =
await addressesProvider.getLendingPoolCollateralManager();
const lendingPoolProxy = await getProxy(lendingPoolAddress);
const lendingPoolConfiguratorProxy = await getProxy(lendingPoolConfiguratorAddress);
@ -132,7 +131,7 @@ task('verify:general', 'Verify contracts at Etherscan')
// WETHGateway
console.log('\n- Verifying WETHGateway...\n');
await verifyContract(eContractid.WETHGateway, wethGateway, [
await getWethAddress(poolConfig),
await getWrappedNativeTokenAddress(poolConfig),
]);
}
// Lending Pool proxy

View File

@ -1,10 +1,5 @@
import { task } from 'hardhat/config';
import {
loadPoolConfig,
ConfigNames,
getWethAddress,
getTreasuryAddress,
} from '../../helpers/configuration';
import { loadPoolConfig, ConfigNames, getTreasuryAddress } from '../../helpers/configuration';
import { ZERO_ADDRESS } from '../../helpers/constants';
import {
getAddressById,