diff --git a/helpers/configuration.ts b/helpers/configuration.ts index ddc568d7..47d1902a 100644 --- a/helpers/configuration.ts +++ b/helpers/configuration.ts @@ -23,7 +23,8 @@ export enum ConfigNames { Aave = 'Aave', Matic = 'Matic', Amm = 'Amm', - Avalanche = 'Avalanche' + Avalanche = 'Avalanche', + RealT = 'RealT' } export const loadPoolConfig = (configName: ConfigNames): PoolConfiguration => { diff --git a/helpers/constants.ts b/helpers/constants.ts index fe743fa2..3753eb1e 100644 --- a/helpers/constants.ts +++ b/helpers/constants.ts @@ -73,5 +73,15 @@ export const MOCK_CHAINLINK_AGGREGATORS_PRICES = { STAKE: oneEther.multipliedBy('0.003620948469').toFixed(), xSUSHI: oneEther.multipliedBy('0.00913428586').toFixed(), WAVAX: oneEther.multipliedBy('0.006051936629').toFixed(), + "REALTOKEN-S-13895-SARATOGA-ST-DETROIT-MI": '12940476190476185', + "REALTOKEN-S-4380-BEACONSFIELD-ST-DETROIT-MI": '12269047619047614', + "REALTOKEN-S-17813-BRADFORD-ST-DETROIT-M": '11816666666666661', + "REALTOKEN-S-15796-HARTWELL-ST-DETROIT-MI": '12047619047619042', + "REALTOKEN-S-9717-EVERTS-ST-DETROIT-MI": '11376190476190471', + "REALTOKEN-S-19201-WESTPHALIA-ST-DETROIT-MI": '11816666666666661', + "REALTOKEN-S-19163-MITCHELL-ST-DETROIT-MI": '12257142857142852', + "REALTOKEN-S-4061-GRAND-ST-DETROIT-M": '13873809523809518', + "REALTOKEN-S-4680-BUCKINGHAM-AVE-DETROIT-MI": '11385714285714281', + "REALTOKEN-S-19311-KEYSTONE-ST-DETROIT-MI": '11804761904761900', USD: '5848466240000000', }; diff --git a/helpers/types.ts b/helpers/types.ts index a46385a8..cfc5f0ed 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -293,7 +293,7 @@ export type iAavePoolAssets = Pick< | 'xSUSHI' >; -export type iAaveRealTPoolAssets = Pick< +export type iRealTPoolAssets = Pick< iAssetsWithoutUSD, | 'DAI' | 'USDC' @@ -578,8 +578,8 @@ export interface IAvalancheConfiguration extends ICommonConfiguration { ReservesConfig: iAvalanchePoolAssets; } -export interface IAaveRealTConfiguration extends ICommonConfiguration { - ReservesConfig: iAaveRealTPoolAssets; +export interface IRealTConfiguration extends ICommonConfiguration { + ReservesConfig: iRealTPoolAssets; } export interface ITokenAddress { diff --git a/tasks/migrations/realT.mainnet.ts b/tasks/migrations/realT.mainnet.ts new file mode 100644 index 00000000..efbc5c02 --- /dev/null +++ b/tasks/migrations/realT.mainnet.ts @@ -0,0 +1,57 @@ +import { task } from 'hardhat/config'; +import { checkVerification } from '../../helpers/etherscan-verification'; +import { ConfigNames } from '../../helpers/configuration'; +import { printContracts } from '../../helpers/misc-utils'; +import { usingTenderly } from '../../helpers/tenderly-utils'; + +task('realT:mainnet', 'Deploy development enviroment') + .addFlag('verify', 'Verify contracts at Etherscan') + .addFlag('skipRegistry', 'Skip addresses provider registration at Addresses Provider Registry') + .setAction(async ({ verify, skipRegistry }, DRE) => { + const POOL_NAME = ConfigNames.RealT; + await DRE.run('set-DRE'); + + // Prevent loss of gas verifying all the needed ENVs for Etherscan verification + if (verify) { + checkVerification(); + } + + console.log('Migration started\n'); + + console.log('1. Deploy address provider'); + await DRE.run('full:deploy-address-provider', { pool: POOL_NAME, skipRegistry }); + + console.log('2. Deploy lending pool'); + await DRE.run('full:deploy-lending-pool', { pool: POOL_NAME }); + + console.log('3. Deploy oracles'); + await DRE.run('full:deploy-oracles', { pool: POOL_NAME }); + + console.log('4. Deploy Data Provider'); + await DRE.run('full:data-provider', { pool: POOL_NAME }); + + console.log('5. Deploy WETH Gateway'); + await DRE.run('full-deploy-weth-gateway', { pool: POOL_NAME }); + + console.log('6. Initialize lending pool'); + await DRE.run('full:initialize-lending-pool', { pool: POOL_NAME }); + + if (verify) { + printContracts(); + console.log('7. Veryfing contracts'); + await DRE.run('verify:general', { all: true, pool: POOL_NAME }); + + console.log('8. Veryfing aTokens and debtTokens'); + await DRE.run('verify:tokens', { pool: POOL_NAME }); + } + + if (usingTenderly()) { + const postDeployHead = DRE.tenderlyNetwork.getHead(); + const postDeployFork = DRE.tenderlyNetwork.getFork(); + console.log('Tenderly Info'); + console.log('- Head', postDeployHead); + console.log('- Fork', postDeployFork); + } + console.log('\nFinished migrations'); + printContracts(); + });