mirror of
				https://github.com/Instadapp/aave-protocol-v2.git
				synced 2024-07-29 21:47:30 +00:00 
			
		
		
		
	Merge branch 'feat/light-deployments' of github.com:aave/protocol-v2 into feat/light-deployments
This commit is contained in:
		
						commit
						4d8445c473
					
				|  | @ -19,3 +19,5 @@ services: | |||
|       TENDERLY_PROJECT: ${TENDERLY_PROJECT} | ||||
|       TENDERLY_USERNAME: ${TENDERLY_USERNAME} | ||||
|       ALCHEMY_KEY: ${ALCHEMY_KEY} | ||||
|       TENDERLY_FORK_ID: ${TENDERLY_FORK_ID} | ||||
|       TENDERLY_HEAD_ID: ${TENDERLY_HEAD_ID} | ||||
|  |  | |||
|  | @ -5,8 +5,8 @@ import { HardhatUserConfig } from 'hardhat/types'; | |||
| import { accounts } from './test-wallets.js'; | ||||
| import { eEthereumNetwork, eNetwork, ePolygonNetwork, eXDaiNetwork } from './helpers/types'; | ||||
| import { BUIDLEREVM_CHAINID, COVERAGE_CHAINID } from './helpers/buidler-constants'; | ||||
| import { NETWORKS_RPC_URL, NETWORKS_DEFAULT_GAS } from './helper-hardhat-config'; | ||||
|   | ||||
| import { NETWORKS_RPC_URL, NETWORKS_DEFAULT_GAS } from './helper-hardhat-config'; | ||||
| 
 | ||||
| require('dotenv').config(); | ||||
| 
 | ||||
| import '@nomiclabs/hardhat-ethers'; | ||||
|  | @ -94,7 +94,7 @@ const buidlerConfig: HardhatUserConfig = { | |||
|     kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42), | ||||
|     ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3), | ||||
|     main: getCommonNetworkConfig(eEthereumNetwork.main, 1), | ||||
|     tenderlyMain: getCommonNetworkConfig(eEthereumNetwork.main, 1), | ||||
|     tenderlyMain: getCommonNetworkConfig(eEthereumNetwork.tenderlyMain, 3030), | ||||
|     matic: getCommonNetworkConfig(ePolygonNetwork.matic, 137), | ||||
|     mumbai: getCommonNetworkConfig(ePolygonNetwork.mumbai, 80001), | ||||
|     xdai: getCommonNetworkConfig(eXDaiNetwork.xdai, 100), | ||||
|  |  | |||
|  | @ -1,10 +1,16 @@ | |||
| // @ts-ignore
 | ||||
| import { eEthereumNetwork, ePolygonNetwork, eXDaiNetwork, iParamsPerNetwork } from './helpers/types'; | ||||
| import { | ||||
|   eEthereumNetwork, | ||||
|   ePolygonNetwork, | ||||
|   eXDaiNetwork, | ||||
|   iParamsPerNetwork, | ||||
| } from './helpers/types'; | ||||
| 
 | ||||
| require('dotenv').config(); | ||||
| 
 | ||||
| const INFURA_KEY = process.env.INFURA_KEY || ''; | ||||
| const ALCHEMY_KEY = process.env.ALCHEMY_KEY || ''; | ||||
| const TENDERLY_FORK_ID = process.env.TENDERLY_FORK_ID || ''; | ||||
| 
 | ||||
| const GWEI = 1000 * 1000 * 1000; | ||||
| 
 | ||||
|  | @ -21,23 +27,21 @@ export const NETWORKS_RPC_URL: iParamsPerNetwork<string> = { | |||
|   [eEthereumNetwork.coverage]: 'http://localhost:8555', | ||||
|   [eEthereumNetwork.hardhat]: 'http://localhost:8545', | ||||
|   [eEthereumNetwork.buidlerevm]: 'http://localhost:8545', | ||||
|   [eEthereumNetwork.tenderlyMain]: ALCHEMY_KEY | ||||
|     ? `https://eth-mainnet.alchemyapi.io/v2/${ALCHEMY_KEY}` | ||||
|     : `https://mainnet.infura.io/v3/${INFURA_KEY}`, | ||||
|   [eEthereumNetwork.tenderlyMain]: `https://rpc.tenderly.co/fork/${TENDERLY_FORK_ID}`, | ||||
|   [ePolygonNetwork.mumbai]: 'https://rpc-mumbai.maticvigil.com', | ||||
|   [ePolygonNetwork.matic]: 'https://rpc-mainnet.matic.network', | ||||
|   [eXDaiNetwork.xdai]: 'https://rpc.xdaichain.com/', | ||||
| } | ||||
| }; | ||||
| 
 | ||||
| export const NETWORKS_DEFAULT_GAS: iParamsPerNetwork<number> = { | ||||
|   [eEthereumNetwork.kovan]: 65 * GWEI , | ||||
|   [eEthereumNetwork.ropsten]: 65 * GWEI , | ||||
|   [eEthereumNetwork.main]: 65 * GWEI , | ||||
|   [eEthereumNetwork.coverage]: 65 * GWEI , | ||||
|   [eEthereumNetwork.hardhat]: 65 * GWEI , | ||||
|   [eEthereumNetwork.buidlerevm]: 65 * GWEI , | ||||
|   [eEthereumNetwork.tenderlyMain]: 65 * GWEI , | ||||
|   [ePolygonNetwork.mumbai]: 1 * GWEI , | ||||
|   [ePolygonNetwork.matic]: 2 * GWEI , | ||||
|   [eEthereumNetwork.kovan]: 65 * GWEI, | ||||
|   [eEthereumNetwork.ropsten]: 65 * GWEI, | ||||
|   [eEthereumNetwork.main]: 65 * GWEI, | ||||
|   [eEthereumNetwork.coverage]: 65 * GWEI, | ||||
|   [eEthereumNetwork.hardhat]: 65 * GWEI, | ||||
|   [eEthereumNetwork.buidlerevm]: 65 * GWEI, | ||||
|   [eEthereumNetwork.tenderlyMain]: 0.01 * GWEI, | ||||
|   [ePolygonNetwork.mumbai]: 1 * GWEI, | ||||
|   [ePolygonNetwork.matic]: 2 * GWEI, | ||||
|   [eXDaiNetwork.xdai]: 1 * GWEI, | ||||
| } | ||||
| }; | ||||
|  |  | |||
|  | @ -99,11 +99,14 @@ export const withSaveAndVerify = async <ContractType extends Contract>( | |||
|   await waitForTx(instance.deployTransaction); | ||||
|   await registerContractInJsonDb(id, instance); | ||||
|   if (usingTenderly()) { | ||||
|     console.log('doing verify of', id); | ||||
|     console.log(); | ||||
|     console.log('Doing Tenderly contract verification of', id); | ||||
|     await (DRE as any).tenderlyRPC.verify({ | ||||
|       name: id, | ||||
|       address: instance.address, | ||||
|     }); | ||||
|     console.log(`Verified ${id} at Tenderly!`); | ||||
|     console.log(); | ||||
|   } | ||||
|   if (verify) { | ||||
|     await verifyContract(instance.address, args); | ||||
|  |  | |||
|  | @ -1,5 +1,11 @@ | |||
| import BigNumber from 'bignumber.js'; | ||||
| import { oneEther, oneRay, RAY, ZERO_ADDRESS, MOCK_CHAINLINK_AGGREGATORS_PRICES } from '../../helpers/constants'; | ||||
| import { | ||||
|   oneEther, | ||||
|   oneRay, | ||||
|   RAY, | ||||
|   ZERO_ADDRESS, | ||||
|   MOCK_CHAINLINK_AGGREGATORS_PRICES, | ||||
| } from '../../helpers/constants'; | ||||
| import { ICommonConfiguration, eEthereumNetwork } from '../../helpers/types'; | ||||
| 
 | ||||
| // ----------------
 | ||||
|  | @ -54,7 +60,7 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|     UniWBTCWETH: { | ||||
|       borrowRate: oneRay.multipliedBy(0.05).toFixed(), | ||||
|     }, | ||||
|     UniAAVEWETH:{ | ||||
|     UniAAVEWETH: { | ||||
|       borrowRate: oneRay.multipliedBy(0.05).toFixed(), | ||||
|     }, | ||||
|     UniBATWETH: { | ||||
|  | @ -95,7 +101,7 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|     }, | ||||
|     BptBALWETH: { | ||||
|       borrowRate: oneRay.multipliedBy(0.05).toFixed(), | ||||
|     } | ||||
|     }, | ||||
|   }, | ||||
|   // ----------------
 | ||||
|   // COMMON PROTOCOL ADDRESSES ACROSS POOLS
 | ||||
|  | @ -132,7 +138,8 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|     [eEthereumNetwork.buidlerevm]: '', | ||||
|     [eEthereumNetwork.tenderlyMain]: '0x52D306e36E3B6B02c153d0266ff0f85d18BCD413', | ||||
|   }, | ||||
|   ProviderRegistryOwner: { // DEPLOYED WITH CORRECT ADDRESS 
 | ||||
|   ProviderRegistryOwner: { | ||||
|     // DEPLOYED WITH CORRECT ADDRESS
 | ||||
|     [eEthereumNetwork.kovan]: '0x85e4A467343c0dc4aDAB74Af84448D9c45D8ae6F', | ||||
|     [eEthereumNetwork.ropsten]: '', | ||||
|     [eEthereumNetwork.main]: '0xbd723fc4f1d737dcfc48a07fe7336766d34cad5f', | ||||
|  | @ -144,8 +151,8 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|   LendingRateOracle: { | ||||
|     [eEthereumNetwork.coverage]: '', | ||||
|     [eEthereumNetwork.hardhat]: '', | ||||
|     [eEthereumNetwork.buidlerevm]: '',// Updated to match Kovan deployment
 | ||||
|     [eEthereumNetwork.kovan]: '0xd00Bd28FAdDa9d5658D1D4e0c151973146C7A533',//'0xE48F95873855bfd97BF89572DDf5cBC44D9c545b'
 | ||||
|     [eEthereumNetwork.buidlerevm]: '', // Updated to match Kovan deployment
 | ||||
|     [eEthereumNetwork.kovan]: '0xd00Bd28FAdDa9d5658D1D4e0c151973146C7A533', //'0xE48F95873855bfd97BF89572DDf5cBC44D9c545b'
 | ||||
|     [eEthereumNetwork.ropsten]: '0x05dcca805a6562c1bdd0423768754acb6993241b', | ||||
|     [eEthereumNetwork.main]: '', //'0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D',  // Need to re-deploy because of onlyOwner
 | ||||
|     [eEthereumNetwork.tenderlyMain]: '0x8A32f49FFbA88aba6EFF96F45D8BD1D4b3f35c7D', | ||||
|  | @ -201,7 +208,7 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|     [eEthereumNetwork.buidlerevm]: '', | ||||
|     [eEthereumNetwork.kovan]: '0x8fb777d67e9945e2c01936e319057f9d41d559e6', // Need to re-deploy because of onlyOwner
 | ||||
|     [eEthereumNetwork.ropsten]: ZERO_ADDRESS, | ||||
|     [eEthereumNetwork.main]: '',//'0xA50ba011c48153De246E5192C8f9258A2ba79Ca9',  // Need to re-deploy because of onlyOwner
 | ||||
|     [eEthereumNetwork.main]: '', //'0xA50ba011c48153De246E5192C8f9258A2ba79Ca9',  // Need to re-deploy because of onlyOwner
 | ||||
|     [eEthereumNetwork.tenderlyMain]: '0xA50ba011c48153De246E5192C8f9258A2ba79Ca9', | ||||
|   }, | ||||
|   FallbackOracle: { | ||||
|  | @ -221,9 +228,9 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|       USDT: '0x0bF499444525a23E7Bb61997539725cA2e928138', | ||||
|       WBTC: '0xF7904a295A029a3aBDFFB6F12755974a958C7C25', | ||||
|       USDC: '0x64EaC61A2DFda2c3Fa04eED49AA33D021AeC8838', | ||||
|       DAI:'0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541', | ||||
|       UniDAIWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',   // Mock oracles
 | ||||
|       UniWBTCWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F',   | ||||
|       DAI: '0x22B58f1EbEDfCA50feF632bD73368b2FdA96D541', | ||||
|       UniDAIWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', // Mock oracles
 | ||||
|       UniWBTCWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', | ||||
|       UniAAVEWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', | ||||
|       UniBATWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', | ||||
|       UniDAIUSDC: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', | ||||
|  | @ -240,52 +247,51 @@ export const CommonsConfig: ICommonConfiguration = { | |||
|       BptBALWETH: '0x5699302154A020FB1DE2B1d39f4c73785A235d8F', | ||||
|       USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', | ||||
|     }, | ||||
|     [eEthereumNetwork.ropsten]: { | ||||
|     }, | ||||
|     [eEthereumNetwork.ropsten]: {}, | ||||
|     [eEthereumNetwork.main]: { | ||||
|       USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', | ||||
|       WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', | ||||
|       USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', | ||||
|       DAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', | ||||
|       DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', | ||||
|       UniDAIWETH: '0xf4071801C4421Db7e63DaC15B9432e50C44a7F42', | ||||
|       UniWBTCWETH: ZERO_ADDRESS, | ||||
|       UniAAVEWETH: ZERO_ADDRESS, | ||||
|       UniBATWETH: ZERO_ADDRESS, | ||||
|       UniDAIUSDC: ZERO_ADDRESS, | ||||
|       UniCRVWETH: ZERO_ADDRESS, | ||||
|       UniLINKWETH: ZERO_ADDRESS, | ||||
|       UniMKRWETH: ZERO_ADDRESS, | ||||
|       UniRENWETH: ZERO_ADDRESS, | ||||
|       UniSNXWETH: ZERO_ADDRESS, | ||||
|       UniUNIWETH: ZERO_ADDRESS, | ||||
|       UniUSDCWETH: ZERO_ADDRESS, | ||||
|       UniWBTCUSDC: ZERO_ADDRESS, | ||||
|       UniYFIWETH: ZERO_ADDRESS, | ||||
|       BptWBTCWETH: ZERO_ADDRESS, | ||||
|       BptBALWETH: ZERO_ADDRESS, | ||||
|       UniWBTCWETH: '0x55EF7F1226507cFd846DE009C2f097c2211b6Fb8', | ||||
|       UniAAVEWETH: '0x5671387d56eAB334A2D65d6D0BB4D907898C7abA', | ||||
|       UniBATWETH: '0xA61ca04DF33B72b235a8A28CfB535bb7A5271B70', | ||||
|       UniDAIUSDC: '0xFd8dFc92B030e6BA957336e9f08C2a711e19069A', | ||||
|       UniCRVWETH: '0xd4D344D076256Fdf806375983b2cab2Db52FD506', | ||||
|       UniLINKWETH: '0x8C0e5df19B998F06e57A1Db1a38232F7590abe4b', | ||||
|       UniMKRWETH: '0x92f2A28fE33E0b6Ea218057EEe004E3B2B6de45d', | ||||
|       UniRENWETH: '0xFc0398b247107138dB494395600fB0d075b72C9A', | ||||
|       UniSNXWETH: '0xF5CB13c859383B5fb070bd111Cae7a900c00BA07', | ||||
|       UniUNIWETH: '0xE50e47E37DCF55dE1c5F2c32d346BB52064f7CE6', | ||||
|       UniUSDCWETH: '0xBE6ac123799572c98eFdE48895465AB392534AFD', | ||||
|       UniWBTCUSDC: '0xd6b8b08a0d13994A5f4a1949F4870DE57e9B40d9', | ||||
|       UniYFIWETH: '0x94daB35789f05f54224F6851921160DE21318072', | ||||
|       BptWBTCWETH: '0x4a2731c9f3B4355922c676f9b538278D79C299C5', | ||||
|       BptBALWETH: '0xD9400999f38E1877a6dDDb0090A327F19257f9AE', | ||||
|       USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', | ||||
|     }, | ||||
|     [eEthereumNetwork.tenderlyMain]: { | ||||
|       USDT: '0xEe9F2375b4bdF6387aa8265dD4FB8F16512A1d46', | ||||
|       WBTC: '0xdeb288F737066589598e9214E782fa5A8eD689e8', | ||||
|       USDC: '0x986b5E1e1755e3C2440e960477f25201B0a8bbD4', | ||||
|       DAI:'0x773616E4d11A78F511299002da57A0a94577F1f4', | ||||
|       UniDAIWETH: ZERO_ADDRESS, | ||||
|       UniWBTCWETH: ZERO_ADDRESS, | ||||
|       UniAAVEWETH: ZERO_ADDRESS, | ||||
|       UniBATWETH: ZERO_ADDRESS, | ||||
|       UniDAIUSDC: ZERO_ADDRESS, | ||||
|       UniCRVWETH: ZERO_ADDRESS, | ||||
|       UniLINKWETH: ZERO_ADDRESS, | ||||
|       UniMKRWETH: ZERO_ADDRESS, | ||||
|       UniRENWETH: ZERO_ADDRESS, | ||||
|       UniSNXWETH: ZERO_ADDRESS, | ||||
|       UniUNIWETH: ZERO_ADDRESS, | ||||
|       UniUSDCWETH: ZERO_ADDRESS, | ||||
|       UniWBTCUSDC: ZERO_ADDRESS, | ||||
|       UniYFIWETH: ZERO_ADDRESS, | ||||
|       BptWBTCWETH: ZERO_ADDRESS, | ||||
|       BptBALWETH: ZERO_ADDRESS, | ||||
|       DAI: '0x773616E4d11A78F511299002da57A0a94577F1f4', | ||||
|       UniDAIWETH: '0xf4071801C4421Db7e63DaC15B9432e50C44a7F42', | ||||
|       UniWBTCWETH: '0x55EF7F1226507cFd846DE009C2f097c2211b6Fb8', | ||||
|       UniAAVEWETH: '0x5671387d56eAB334A2D65d6D0BB4D907898C7abA', | ||||
|       UniBATWETH: '0xA61ca04DF33B72b235a8A28CfB535bb7A5271B70', | ||||
|       UniDAIUSDC: '0xFd8dFc92B030e6BA957336e9f08C2a711e19069A', | ||||
|       UniCRVWETH: '0xd4D344D076256Fdf806375983b2cab2Db52FD506', | ||||
|       UniLINKWETH: '0x8C0e5df19B998F06e57A1Db1a38232F7590abe4b', | ||||
|       UniMKRWETH: '0x92f2A28fE33E0b6Ea218057EEe004E3B2B6de45d', | ||||
|       UniRENWETH: '0xFc0398b247107138dB494395600fB0d075b72C9A', | ||||
|       UniSNXWETH: '0xF5CB13c859383B5fb070bd111Cae7a900c00BA07', | ||||
|       UniUNIWETH: '0xE50e47E37DCF55dE1c5F2c32d346BB52064f7CE6', | ||||
|       UniUSDCWETH: '0xBE6ac123799572c98eFdE48895465AB392534AFD', | ||||
|       UniWBTCUSDC: '0xd6b8b08a0d13994A5f4a1949F4870DE57e9B40d9', | ||||
|       UniYFIWETH: '0x94daB35789f05f54224F6851921160DE21318072', | ||||
|       BptWBTCWETH: '0x4a2731c9f3B4355922c676f9b538278D79C299C5', | ||||
|       BptBALWETH: '0xD9400999f38E1877a6dDDb0090A327F19257f9AE', | ||||
|       USD: '0x9326BFA02ADD2366b30bacB125260Af641031331', | ||||
|     }, | ||||
|   }, | ||||
|  |  | |||
|  | @ -50,6 +50,7 @@ | |||
|     "aave:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- aave:mainnet", | ||||
|     "aave:fork:main": "npm run compile && MAINNET_FORK=true hardhat aave:mainnet", | ||||
|     "amm:fork:main": "npm run compile && MAINNET_FORK=true hardhat amm:mainnet", | ||||
|     "amm:fork:main:tenderly": "npm run compile && npm run hardhat:tenderly-main -- amm:mainnet", | ||||
|     "aave:main:full:migration": "npm run compile && npm run hardhat:main -- aave:mainnet --verify", | ||||
|     "aave:main:full:initialize": "npm run compile && MAINNET_FORK=true full:initialize-tokens --pool Aave", | ||||
|     "amm:main:full:migration": "npm run compile && npm run hardhat:main -- amm:mainnet --verify", | ||||
|  | @ -88,7 +89,7 @@ | |||
|     "@nomiclabs/hardhat-ethers": "^2.0.0", | ||||
|     "@nomiclabs/hardhat-waffle": "^2.0.0", | ||||
|     "@openzeppelin/contracts": "3.1.0", | ||||
|     "@tenderly/hardhat-tenderly": "^1.1.0-beta.3", | ||||
|     "@tenderly/hardhat-tenderly": "^1.1.0-beta.4", | ||||
|     "@typechain/ethers-v4": "1.0.0", | ||||
|     "@typechain/ethers-v5": "^2.0.0", | ||||
|     "@typechain/truffle-v4": "2.0.2", | ||||
|  |  | |||
|  | @ -64,13 +64,7 @@ task( | |||
|       const firstAccount = await getFirstSigner(); | ||||
|       await firstAccount.sendTransaction({ value: parseEther('10'), to: providerRegistryOwner }); | ||||
|     } else { | ||||
|       signer = await getFirstSigner(); | ||||
|       const deployerAddress = await signer.getAddress(); | ||||
|       if (providerRegistryOwner !== (await signer.getAddress())) { | ||||
|         throw Error( | ||||
|           `Current signer is not provider registry owner. \nCurrent deployer address: ${deployerAddress} \nExpected address: ${poolConfig.ProviderRegistryOwner}` | ||||
|         ); | ||||
|       } | ||||
|       signer = DRE.ethers.provider.getSigner(providerRegistryOwner); | ||||
|     } | ||||
|     // 1. Address Provider Registry instance
 | ||||
|     const addressesProviderRegistry = ( | ||||
|  |  | |||
|  | @ -50,7 +50,11 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') | |||
| 
 | ||||
|       let aaveOracle: AaveOracle; | ||||
|       if (notFalsyOrZeroAddress(aaveOracleAddress)) { | ||||
|         aaveOracle = await getAaveOracle(aaveOracleAddress); | ||||
|         aaveOracle = await await getAaveOracle(aaveOracleAddress); | ||||
|         const owner = await aaveOracle.owner(); | ||||
|         const signer = DRE.ethers.provider.getSigner(owner); | ||||
| 
 | ||||
|         aaveOracle = await (await getAaveOracle(aaveOracleAddress)).connect(signer); | ||||
|         await waitForTx(await aaveOracle.setAssetSources(tokens, aggregators)); | ||||
|       } else { | ||||
|         aaveOracle = await deployAaveOracle( | ||||
|  | @ -59,11 +63,14 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') | |||
|         ); | ||||
|       } | ||||
| 
 | ||||
|       const lendingRateOracle = notFalsyOrZeroAddress(lendingRateOracleAddress) | ||||
|       let lendingRateOracle = notFalsyOrZeroAddress(lendingRateOracleAddress) | ||||
|         ? await getLendingRateOracle(lendingRateOracleAddress) | ||||
|         : await deployLendingRateOracle(verify); | ||||
|       const { USD, ...tokensAddressesWithoutUsd } = tokensToWatch; | ||||
| 
 | ||||
|       lendingRateOracle = lendingRateOracle.connect( | ||||
|         DRE.ethers.provider.getSigner(await lendingRateOracle.owner()) | ||||
|       ); | ||||
|       // This must be done any time a new market is created I believe
 | ||||
|       //if (!lendingRateOracleAddress) {
 | ||||
|       await setInitialMarketRatesInRatesOracleByHelper( | ||||
|  |  | |||
|  | @ -46,7 +46,10 @@ task('aave:mainnet', 'Deploy development enviroment') | |||
| 
 | ||||
|     if (usingTenderly()) { | ||||
|       const postDeployHead = DRE.tenderlyRPC.getHead(); | ||||
|       console.log('Tenderly UUID', postDeployHead); | ||||
|       const postDeployFork = DRE.tenderlyRPC.getFork(); | ||||
|       console.log('Tenderly Info'); | ||||
|       console.log('- Head', postDeployHead); | ||||
|       console.log('- Fork', postDeployFork); | ||||
|     } | ||||
|     console.log('\nFinished migrations'); | ||||
|     printContracts(); | ||||
|  |  | |||
|  | @ -46,7 +46,10 @@ task('amm:mainnet', 'Deploy development enviroment') | |||
| 
 | ||||
|     if (usingTenderly()) { | ||||
|       const postDeployHead = DRE.tenderlyRPC.getHead(); | ||||
|       console.log('Tenderly UUID', postDeployHead); | ||||
|       const postDeployFork = DRE.tenderlyRPC.getFork(); | ||||
|       console.log('Tenderly Info'); | ||||
|       console.log('- Head', postDeployHead); | ||||
|       console.log('- Fork', postDeployFork); | ||||
|     } | ||||
|     console.log('\nFinished migrations'); | ||||
|     printContracts(); | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ task('matic:mainnet', 'Deploy development enviroment') | |||
|     await DRE.run('full:deploy-address-provider', { pool: POOL_NAME }); | ||||
| 
 | ||||
|     console.log('2. Deploy lending pool'); | ||||
|     await DRE.run('full:deploy-lending-pool', { pool: POOL_NAME}); | ||||
|     await DRE.run('full:deploy-lending-pool', { pool: POOL_NAME }); | ||||
| 
 | ||||
|     console.log('3. Deploy oracles'); | ||||
|     await DRE.run('full:deploy-oracles', { pool: POOL_NAME }); | ||||
|  | @ -43,7 +43,10 @@ task('matic:mainnet', 'Deploy development enviroment') | |||
| 
 | ||||
|     if (usingTenderly()) { | ||||
|       const postDeployHead = DRE.tenderlyRPC.getHead(); | ||||
|       console.log('Tenderly UUID', postDeployHead); | ||||
|       const postDeployFork = DRE.tenderlyRPC.getFork(); | ||||
|       console.log('Tenderly Info'); | ||||
|       console.log('- Head', postDeployHead); | ||||
|       console.log('- Fork', postDeployFork); | ||||
|     } | ||||
|     console.log('\nFinished migrations'); | ||||
|     printContracts(); | ||||
|  |  | |||
|  | @ -60,13 +60,7 @@ task('full:initialize-tokens', 'Initialize lending pool configuration.') | |||
|         const balance = await signer.getBalance(); | ||||
|         console.log('signer balance', formatEther(balance)); | ||||
|       } else { | ||||
|         signer = await getFirstSigner(); | ||||
|         const deployerAddress = await signer.getAddress(); | ||||
|         if (providerRegistryOwner !== (await signer.getAddress())) { | ||||
|           throw Error( | ||||
|             `Current signer is not provider registry owner. \nCurrent deployer address: ${deployerAddress} \nExpected address: ${poolConfig.ProviderRegistryOwner}` | ||||
|           ); | ||||
|         } | ||||
|         signer = DRE.ethers.provider.getSigner(providerRegistryOwner); | ||||
|       } | ||||
| 
 | ||||
|       // Init unitilialized reserves
 | ||||
|  |  | |||
|  | @ -3,6 +3,8 @@ import { DRE, setDRE } from '../../helpers/misc-utils'; | |||
| import { EthereumNetworkNames } from '../../helpers/types'; | ||||
| import { usingTenderly } from '../../helpers/tenderly-utils'; | ||||
| import { HardhatRuntimeEnvironment } from 'hardhat/types'; | ||||
| import { getFirstSigner } from '../../helpers/contracts-getters'; | ||||
| import { formatEther } from 'ethers/lib/utils'; | ||||
| 
 | ||||
| task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).setAction( | ||||
|   async (_, _DRE) => { | ||||
|  | @ -14,10 +16,24 @@ task(`set-DRE`, `Inits the DRE, to have access to all the plugins' objects`).set | |||
|       process.env.TENDERLY === 'true' | ||||
|     ) { | ||||
|       console.log('- Setting up Tenderly provider'); | ||||
|       await _DRE.tenderlyRPC.initializeFork(); | ||||
|       console.log('- Initialized Tenderly fork'); | ||||
|       if (process.env.TENDERLY_FORK_ID && process.env.TENDERLY_HEAD_ID) { | ||||
|         console.log('- Connecting to a Tenderly Fork'); | ||||
|         _DRE.tenderlyRPC.setFork(process.env.TENDERLY_FORK_ID); | ||||
|         _DRE.tenderlyRPC.setHead(process.env.TENDERLY_HEAD_ID); | ||||
|       } else { | ||||
|         console.log('- Creating a new Tenderly Fork'); | ||||
|         await _DRE.tenderlyRPC.initializeFork(); | ||||
|       } | ||||
|       const provider = new _DRE.ethers.providers.Web3Provider(_DRE.tenderlyRPC as any); | ||||
|       _DRE.ethers.provider = provider; | ||||
|       console.log('- Initialized Tenderly fork:'); | ||||
|       console.log('  - Fork: ', _DRE.tenderlyRPC.getFork()); | ||||
|       console.log('  - Head: ', _DRE.tenderlyRPC.getHead()); | ||||
|       console.log('  - First account:', await (await _DRE.ethers.getSigners())[0].getAddress()); | ||||
|       console.log( | ||||
|         '  - Balance:', | ||||
|         formatEther(await (await _DRE.ethers.getSigners())[0].getBalance()) | ||||
|       ); | ||||
|     } | ||||
| 
 | ||||
|     setDRE(_DRE); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 The3D
						The3D