diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9234f27175..ef3a07a1dd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -159,7 +159,7 @@ jobs: restore-keys: | hardhat-network-fork-${{ runner.os }}- hardhat-network-fork- - - run: yarn hardhat test ./test/plugins/individual-collateral/{cbeth,aave-v3,compoundv3,stargate,lido}/*.test.ts + - run: yarn hardhat test ./test/plugins/individual-collateral/{cbeth,aave-v3,compoundv3,stargate,lido,meta-morpho}/*.test.ts env: NODE_OPTIONS: '--max-old-space-size=32768' TS_NODE_SKIP_IGNORE: true diff --git a/common/configuration.ts b/common/configuration.ts index d88ab6218a..0857a24e4d 100644 --- a/common/configuration.ts +++ b/common/configuration.ts @@ -105,6 +105,7 @@ export interface ITokens { bbUSDT?: string steakPYUSD?: string Re7WETH?: string + meUSD?: string pxETH?: string apxETH?: string @@ -514,6 +515,8 @@ export const networkConfig: { [key: string]: INetworkConfig } = { sUSDbC: '0x4c80e24119cfb836cdf0a6b53dc23f04f7e652ca', wstETH: '0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452', STG: '0xE3B53AF74a4BF62Ae5511055290838050bf764Df', + eUSD: '0xCfA3Ef56d303AE4fAabA0592388F19d7C3399FB4', + meUSD: '0xbb819D845b573B5D7C538F5b85057160cfb5f313', }, chainlinkFeeds: { DAI: '0x591e79239a7d679378ec8c847e5038150364c78f', // 0.3%, 24hr @@ -530,6 +533,7 @@ export const networkConfig: { [key: string]: INetworkConfig } = { stETHETH: '0xf586d0728a47229e747d824a939000Cf21dEF5A0', // 0.5%, 24h ETHUSD: '0x71041dddad3595F9CEd3DcCFBe3D1F4b0a16Bb70', // 0.15%, 20min wstETHstETH: '0xB88BAc61a4Ca37C43a3725912B1f472c9A5bc061', // 0.5%, 24h + eUSD: '0x9b2C948dbA5952A1f5Ab6fA16101c1392b8da1ab', // 0.5%, 24h }, GNOSIS_EASY_AUCTION: '0xb1875Feaeea32Bbb02DE83D81772e07E37A40f02', // mock COMET_REWARDS: '0x123964802e6ABabBE1Bc9547D72Ef1B69B00A6b1', diff --git a/contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol b/contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol index 59bc4adc1b..eb1f8435ff 100644 --- a/contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol +++ b/contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol @@ -10,6 +10,11 @@ import { ERC4626FiatCollateral } from "../ERC4626FiatCollateral.sol"; * Expected: {tok} != {ref}, {ref} is pegged to {target} unless defaulting, {target} == {UoA} * * For example: steakUSDC, steakPYUSD, bbUSDT + * + * Rewards need to be claimed manually, from off-chain. This can be done permissionlessly, + * by anyone, on behalf of the RToken's Backing Manager address. + * For more information: https://docs.morpho.org/rewards/tutorials/claim-rewards/ + * */ contract MetaMorphoFiatCollateral is ERC4626FiatCollateral { /// config.erc20 must be a MetaMorpho ERC4626 vault diff --git a/contracts/plugins/assets/meta-morpho/MetaMorphoSelfReferentialCollateral.sol b/contracts/plugins/assets/meta-morpho/MetaMorphoSelfReferentialCollateral.sol index d691d5d885..651ed31fdd 100644 --- a/contracts/plugins/assets/meta-morpho/MetaMorphoSelfReferentialCollateral.sol +++ b/contracts/plugins/assets/meta-morpho/MetaMorphoSelfReferentialCollateral.sol @@ -14,6 +14,11 @@ import { ERC4626FiatCollateral } from "../ERC4626FiatCollateral.sol"; * Expected: {tok} != {ref}, {ref} == {target}, {target} != {UoA} * * For example: Re7WETH + * + * Rewards will need to be claimed manually, off-chain. This can be done permissionlessly by anyone, + * on behalf of the RToken's Backing Manager address. + * For more information: https://docs.morpho.org/rewards/tutorials/claim-rewards/ + * */ contract MetaMorphoSelfReferentialCollateral is ERC4626FiatCollateral { using FixLib for uint192; diff --git a/contracts/plugins/assets/meta-morpho/README.md b/contracts/plugins/assets/meta-morpho/README.md index 10a980fc6f..e498e2d797 100644 --- a/contracts/plugins/assets/meta-morpho/README.md +++ b/contracts/plugins/assets/meta-morpho/README.md @@ -6,6 +6,23 @@ Morpho Blue is a permisionless lending protocol. At the time of this writing (Ma MetaMorpho suffers from a similar to that of the Curve volatile pools which can lose assets on admin fee claim. +## Reward claiming + +Rewards can be claimed permissionlessly by anyone from off-chain, following this detailed guide from the Morpho docs: + +https://docs.morpho.org/rewards/tutorials/claim-rewards/ + +It requires the following steps: + +1. Querying the Morpho API with the holder address: https://rewards.morpho.org/v1/users/0xADDRESS/distributions +2. Retrieving the distributor contract and sending a transaction to `claim()` the rewards with the following parameters (all obtained from the previous call): + - `account`: the holder address + - `reward`: the address of the reward token + - `claimable`: the amount of reward tokens to claim + - `proof`: the merkle proof + +It is important to note that in the case of Rtokens, rewards will need to be claimed on behalf of the Backing Manager. + ## Target tokens **USD** @@ -14,6 +31,7 @@ MetaMorpho suffers from a similar to that of the Curve volatile pools which can | Steakhouse USDC | steakUSDC| 0xBEEF01735c132Ada46AA9aA4c54623cAA92A64CB | wstETH, MORPHO | | Steakhouse PYSUD | steakPYUSD | 0xbEEF02e5E13584ab96848af90261f0C8Ee04722a | MORPHO | | Flagship USDT | bbUSDT| 0x2C25f6C25770fFEC5959D34B94Bf898865e5D6b1 | MORPHO | +| Morpho eUSD (Base) | meUSD | 0xbb819D845b573B5D7C538F5b85057160cfb5f313 | MORPHO | **ETH** diff --git a/scripts/addresses/8453-tmp-assets-collateral.json b/scripts/addresses/8453-tmp-assets-collateral.json index 4602fbd2dd..06257a8a24 100644 --- a/scripts/addresses/8453-tmp-assets-collateral.json +++ b/scripts/addresses/8453-tmp-assets-collateral.json @@ -11,7 +11,8 @@ "cbETH": "0x851B461a9744f4c9E996C03072cAB6f44Fa04d0D", "saBasUSDC": "0xC19f5d60e2Aca1174f3D5Fe189f0A69afaB76f50", "cUSDCv3": "0xf7a9D27c3B60c78c6F6e2c2d6ED6E8B94b352461", - "wstETH": "0x8b4374005291B8FCD14C4E947604b2FB3C660A73" + "wstETH": "0x8b4374005291B8FCD14C4E947604b2FB3C660A73", + "meUSD": "0x0f1e10871e6a2D3A5Aa696b85b39d61a22A9e8C3" }, "erc20s": { "COMP": "0x9e1028F5F1D5eDE59748FFceE5532509976840E0", @@ -23,6 +24,7 @@ "saBasUSDC": "0x6F6f81e5E66f503184f2202D83a79650c3285759", "STG": "0xE3B53AF74a4BF62Ae5511055290838050bf764Df", "cUSDCv3": "0x53f1Df4E5591Ae35Bf738742981669c3767241FA", - "wstETH": "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452" + "wstETH": "0xc1CBa3fCea344f92D9239c08C0568f6F2F0ee452", + "meUSD": "0xbb819D845b573B5D7C538F5b85057160cfb5f313" } -} +} \ No newline at end of file diff --git a/scripts/addresses/base-4.0.0/8453-tmp-assets-collateral.json b/scripts/addresses/base-4.0.0/8453-tmp-assets-collateral.json new file mode 100644 index 0000000000..0ed5fa273b --- /dev/null +++ b/scripts/addresses/base-4.0.0/8453-tmp-assets-collateral.json @@ -0,0 +1,9 @@ +{ + "assets": {}, + "collateral": { + "meUSD": "0x0f1e10871e6a2D3A5Aa696b85b39d61a22A9e8C3" + }, + "erc20s": { + "meUSD": "0xbb819D845b573B5D7C538F5b85057160cfb5f313" + } +} diff --git a/scripts/deploy.ts b/scripts/deploy.ts index a1347953a3..6ebcf6b561 100644 --- a/scripts/deploy.ts +++ b/scripts/deploy.ts @@ -103,6 +103,7 @@ async function main() { 'phase2-assets/collaterals/deploy_aave_v3_usdc.ts', 'phase2-assets/collaterals/deploy_lido_wsteth_collateral.ts', 'phase2-assets/collaterals/deploy_cbeth_collateral.ts', + 'phase2-assets/collaterals/deploy_morphoeUSD.ts', 'phase2-assets/assets/deploy_stg.ts' ) } else if (chainId == '42161' || chainId == '421614') { diff --git a/scripts/deployment/phase2-assets/collaterals/deploy_morphoeUSD.ts b/scripts/deployment/phase2-assets/collaterals/deploy_morphoeUSD.ts new file mode 100644 index 0000000000..b32e989573 --- /dev/null +++ b/scripts/deployment/phase2-assets/collaterals/deploy_morphoeUSD.ts @@ -0,0 +1,94 @@ +import fs from 'fs' +import hre from 'hardhat' +import { getChainId } from '../../../../common/blockchain-utils' +import { baseL2Chains, networkConfig } from '../../../../common/configuration' +import { fp } from '../../../../common/numbers' +import { expect } from 'chai' +import { CollateralStatus } from '../../../../common/constants' +import { + getDeploymentFile, + getAssetCollDeploymentFilename, + IAssetCollDeployments, + getDeploymentFilename, + fileExists, +} from '../../common' +import { + eUSD_ORACLE_TIMEOUT, + eUSD_ORACLE_ERROR, + eUSD_USD_FEED, + PRICE_TIMEOUT, + DELAY_UNTIL_DEFAULT, +} from '../../../../test/plugins/individual-collateral/meta-morpho/constants' +import { MetaMorphoFiatCollateral } from '../../../../typechain' +import { ContractFactory } from 'ethers' + +async function main() { + // ==== Read Configuration ==== + const [deployer] = await hre.ethers.getSigners() + + const chainId = await getChainId(hre) + + console.log(`Deploying Collateral to network ${hre.network.name} (${chainId}) + with burner account: ${deployer.address}`) + + if (!networkConfig[chainId]) { + throw new Error(`Missing network configuration for ${hre.network.name}`) + } + + // Get phase1 deployment + const phase1File = getDeploymentFilename(chainId) + if (!fileExists(phase1File)) { + throw new Error(`${phase1File} doesn't exist yet. Run phase 1`) + } + // Check previous step completed + const assetCollDeploymentFilename = getAssetCollDeploymentFilename(chainId) + const assetCollDeployments = getDeploymentFile(assetCollDeploymentFilename) + + const deployedCollateral: string[] = [] + + /******** Deploy MetaMorpho Morpho eUSD - meUSD **************************/ + + // Only for base + if (baseL2Chains.includes(hre.network.name)) { + const MetaMorphoFiatCollateralFactory: ContractFactory = await hre.ethers.getContractFactory( + 'MetaMorphoFiatCollateral' + ) + + const collateral = await MetaMorphoFiatCollateralFactory.connect( + deployer + ).deploy( + { + priceTimeout: PRICE_TIMEOUT.toString(), + chainlinkFeed: eUSD_USD_FEED, + oracleError: eUSD_ORACLE_ERROR.toString(), + erc20: networkConfig[chainId].tokens.meUSD, + maxTradeVolume: fp('1e6').toString(), // 17m vault + oracleTimeout: eUSD_ORACLE_TIMEOUT.toString(), + targetName: hre.ethers.utils.formatBytes32String('USD'), + defaultThreshold: eUSD_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule + delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(), + }, + fp('1e-4') // can have mild drawdowns + ) + await collateral.deployed() + + console.log(`Deployed meUSD to ${hre.network.name} (${chainId}): ${collateral.address}`) + await (await collateral.refresh()).wait() + expect(await collateral.status()).to.equal(CollateralStatus.SOUND) + + assetCollDeployments.collateral.meUSD = collateral.address + assetCollDeployments.erc20s.meUSD = networkConfig[chainId].tokens.meUSD + deployedCollateral.push(collateral.address.toString()) + + fs.writeFileSync(assetCollDeploymentFilename, JSON.stringify(assetCollDeployments, null, 2)) + + console.log(`Deployed collateral to ${hre.network.name} (${chainId}) + New deployments: ${deployedCollateral} + Deployment file: ${assetCollDeploymentFilename}`) + } +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/scripts/verification/collateral-plugins/verify_morphoeUSD.ts b/scripts/verification/collateral-plugins/verify_morphoeUSD.ts new file mode 100644 index 0000000000..aa24d45d8e --- /dev/null +++ b/scripts/verification/collateral-plugins/verify_morphoeUSD.ts @@ -0,0 +1,60 @@ +import hre from 'hardhat' +import { getChainId } from '../../../common/blockchain-utils' +import { developmentChains, networkConfig } from '../../../common/configuration' +import { fp } from '../../../common/numbers' +import { + getDeploymentFile, + getAssetCollDeploymentFilename, + IAssetCollDeployments, +} from '../../deployment/common' +import { + eUSD_ORACLE_TIMEOUT, + eUSD_ORACLE_ERROR, + eUSD_USD_FEED, + PRICE_TIMEOUT, + DELAY_UNTIL_DEFAULT, +} from '../../../test/plugins/individual-collateral/meta-morpho/constants' +import { verifyContract } from '../../deployment/utils' + +let deployments: IAssetCollDeployments + +async function main() { + // ********** Read config ********** + const chainId = await getChainId(hre) + if (!networkConfig[chainId]) { + throw new Error(`Missing network configuration for ${hre.network.name}`) + } + + if (developmentChains.includes(hre.network.name)) { + throw new Error(`Cannot verify contracts for development chain ${hre.network.name}`) + } + + const assetCollDeploymentFilename = getAssetCollDeploymentFilename(chainId) + deployments = getDeploymentFile(assetCollDeploymentFilename) + + /******** Verify meUSD **************************/ + await verifyContract( + chainId, + deployments.collateral.meUSD, + [ + { + priceTimeout: PRICE_TIMEOUT.toString(), + chainlinkFeed: eUSD_USD_FEED, + oracleError: eUSD_ORACLE_ERROR.toString(), + erc20: networkConfig[chainId].tokens.meUSD, + maxTradeVolume: fp('1e6').toString(), + oracleTimeout: eUSD_ORACLE_TIMEOUT.toString(), + targetName: hre.ethers.utils.formatBytes32String('USD'), + defaultThreshold: eUSD_ORACLE_ERROR.add(fp('0.01')).toString(), // +1% buffer rule + delayUntilDefault: DELAY_UNTIL_DEFAULT.toString(), + }, + fp('1e-4'), // can have small drawdowns + ], + 'contracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.sol:MetaMorphoFiatCollateral' + ) +} + +main().catch((error) => { + console.error(error) + process.exitCode = 1 +}) diff --git a/scripts/verify_etherscan.ts b/scripts/verify_etherscan.ts index a448a9ee8f..82b1ab3e9b 100644 --- a/scripts/verify_etherscan.ts +++ b/scripts/verify_etherscan.ts @@ -89,6 +89,7 @@ async function main() { 'collateral-plugins/verify_aave_v3_usdc.ts', 'collateral-plugins/verify_wsteth.ts', 'collateral-plugins/verify_cbeth.ts', + 'collateral-plugins/verify_morphoeUSD.ts', 'assets/verify_stg.ts' ) } else if (chainId == '42161' || chainId == '421614') { diff --git a/test/plugins/individual-collateral/meta-morpho/MetaMorphoFiatCollateral.test.ts b/test/plugins/individual-collateral/meta-morpho/MetaMorphoFiatCollateral.test.ts index d99f599ade..f8138befb4 100644 --- a/test/plugins/individual-collateral/meta-morpho/MetaMorphoFiatCollateral.test.ts +++ b/test/plugins/individual-collateral/meta-morpho/MetaMorphoFiatCollateral.test.ts @@ -1,4 +1,3 @@ -import { networkConfig } from '#/common/configuration' import { bn, fp } from '#/common/numbers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { MockV3Aggregator } from '@typechain/MockV3Aggregator' @@ -15,19 +14,30 @@ import { MAX_UINT192 } from '#/common/constants' import { DELAY_UNTIL_DEFAULT, FORK_BLOCK, + STEAKPYUSD, + STEAKUSDC, + BBUSDT, + PYUSD_USD_FEED, PYUSD_ORACLE_ERROR, PYUSD_ORACLE_TIMEOUT, + USDT_USD_FEED, USDT_ORACLE_TIMEOUT, USDT_ORACLE_ERROR, + USDC_USD_FEED, USDC_ORACLE_TIMEOUT, USDC_ORACLE_ERROR, + eUSD_USD_FEED, + eUSD_ORACLE_TIMEOUT, + eUSD_ORACLE_ERROR, PRICE_TIMEOUT, + MEUSD, } from './constants' import { mintCollateralTo } from './mintCollateralTo' interface MAFiatCollateralOpts extends CollateralOpts { defaultPrice?: BigNumberish defaultRefPerTok?: BigNumberish + forkNetwork?: string } const makeFiatCollateralTestSuite = ( @@ -167,6 +177,7 @@ const makeFiatCollateralTestSuite = ( itChecksNonZeroDefaultThreshold: it, itHasRevenueHiding: it, resetFork: getResetFork(FORK_BLOCK), + targetNetwork: defaultCollateralOpts.forkNetwork, collateralName, chainlinkDefaultAnswer: defaultCollateralOpts.defaultPrice!, itIsPricedByPeg: true, @@ -180,7 +191,8 @@ const makeOpts = ( vault: string, chainlinkFeed: string, oracleTimeout: BigNumber, - oracleError: BigNumber + oracleError: BigNumber, + forkNetwork: string ): MAFiatCollateralOpts => { return { targetName: ethers.utils.formatBytes32String('USD'), @@ -195,22 +207,28 @@ const makeOpts = ( defaultRefPerTok: fp('1'), erc20: vault, chainlinkFeed, + forkNetwork, } } /* Run the test suite */ -const { tokens, chainlinkFeeds } = networkConfig[31337] + makeFiatCollateralTestSuite( 'MetaMorphoFiatCollateral - steakUSDC', - makeOpts(tokens.steakUSDC!, chainlinkFeeds.USDC!, USDC_ORACLE_TIMEOUT, USDC_ORACLE_ERROR) + makeOpts(STEAKUSDC, USDC_USD_FEED, USDC_ORACLE_TIMEOUT, USDC_ORACLE_ERROR, 'mainnet') ) makeFiatCollateralTestSuite( 'MetaMorphoFiatCollateral - steakPYUSD', - makeOpts(tokens.steakPYUSD!, chainlinkFeeds.pyUSD!, PYUSD_ORACLE_TIMEOUT, PYUSD_ORACLE_ERROR) + makeOpts(STEAKPYUSD, PYUSD_USD_FEED, PYUSD_ORACLE_TIMEOUT, PYUSD_ORACLE_ERROR, 'mainnet') ) makeFiatCollateralTestSuite( 'MetaMorphoFiatCollateral - bbUSDT', - makeOpts(tokens.bbUSDT!, chainlinkFeeds.USDT!, USDT_ORACLE_TIMEOUT, USDT_ORACLE_ERROR) + makeOpts(BBUSDT, USDT_USD_FEED, USDT_ORACLE_TIMEOUT, USDT_ORACLE_ERROR, 'mainnet') +) + +makeFiatCollateralTestSuite( + 'MetaMorphoFiatCollateral - meUSD', + makeOpts(MEUSD, eUSD_USD_FEED, eUSD_ORACLE_TIMEOUT, eUSD_ORACLE_ERROR, 'base') ) diff --git a/test/plugins/individual-collateral/meta-morpho/MetaMorphoSelfReferentialCollateral.test.ts b/test/plugins/individual-collateral/meta-morpho/MetaMorphoSelfReferentialCollateral.test.ts index 85c684e8d6..d243ec85aa 100644 --- a/test/plugins/individual-collateral/meta-morpho/MetaMorphoSelfReferentialCollateral.test.ts +++ b/test/plugins/individual-collateral/meta-morpho/MetaMorphoSelfReferentialCollateral.test.ts @@ -1,4 +1,3 @@ -import { networkConfig } from '#/common/configuration' import { bn, fp } from '#/common/numbers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { MockV3Aggregator } from '@typechain/MockV3Aggregator' @@ -18,12 +17,16 @@ import { ETH_ORACLE_ERROR, ETH_ORACLE_TIMEOUT, PRICE_TIMEOUT, + RE7WETH, + ETH_USD_FEED, + forkNetwork, } from './constants' import { mintCollateralTo } from './mintCollateralTo' interface MAFiatCollateralOpts extends CollateralOpts { defaultPrice?: BigNumberish defaultRefPerTok?: BigNumberish + forkNetwork?: string } const makeFiatCollateralTestSuite = ( @@ -170,6 +173,7 @@ const makeFiatCollateralTestSuite = ( itChecksNonZeroDefaultThreshold: it.skip, itHasRevenueHiding: it, resetFork: getResetFork(FORK_BLOCK), + targetNetwork: defaultCollateralOpts.forkNetwork, collateralName, chainlinkDefaultAnswer: defaultCollateralOpts.defaultPrice!, itIsPricedByPeg: true, @@ -183,7 +187,8 @@ const makeOpts = ( vault: string, chainlinkFeed: string, oracleTimeout: BigNumber, - oracleError: BigNumber + oracleError: BigNumber, + forkNetwork: string ): MAFiatCollateralOpts => { return { targetName: ethers.utils.formatBytes32String('ETH'), @@ -198,14 +203,14 @@ const makeOpts = ( defaultRefPerTok: fp('1'), erc20: vault, chainlinkFeed, + forkNetwork, } } /* Run the test suite */ -const { tokens, chainlinkFeeds } = networkConfig[31337] makeFiatCollateralTestSuite( 'MetaMorphoSelfReferentialCollateral - Re7WETH', - makeOpts(tokens.Re7WETH!, chainlinkFeeds.ETH!, ETH_ORACLE_TIMEOUT, ETH_ORACLE_ERROR) + makeOpts(RE7WETH, ETH_USD_FEED, ETH_ORACLE_TIMEOUT, ETH_ORACLE_ERROR, 'mainnet') ) diff --git a/test/plugins/individual-collateral/meta-morpho/constants.ts b/test/plugins/individual-collateral/meta-morpho/constants.ts index ec71a3b347..7e1e5caa9e 100644 --- a/test/plugins/individual-collateral/meta-morpho/constants.ts +++ b/test/plugins/individual-collateral/meta-morpho/constants.ts @@ -1,30 +1,66 @@ import { bn, fp } from '../../../../common/numbers' import { networkConfig } from '../../../../common/configuration' +import { useEnv } from '#/utils/env' -// Mainnet Addresses +export const forkNetwork = useEnv('FORK_NETWORK') ?? 'mainnet' +let chainId + +switch (forkNetwork) { + case 'mainnet': + chainId = '1' + break + case 'base': + chainId = '8453' + break + case 'arbitrum': + chainId = '42161' + break + default: + chainId = '1' + break +} + +// Addresses + +export const STEAKUSDC = networkConfig[chainId].tokens.steakUSDC! +export const STEAKPYUSD = networkConfig[chainId].tokens.steakPYUSD! +export const BBUSDT = networkConfig[chainId].tokens.bbUSDT! +export const RE7WETH = networkConfig[chainId].tokens.Re7WETH! +export const MEUSD = networkConfig[chainId].tokens.meUSD! // USDC -export const USDC_USD_FEED = networkConfig['1'].chainlinkFeeds.USDC! +export const USDC_USD_FEED = networkConfig[chainId].chainlinkFeeds.USDC! export const USDC_ORACLE_TIMEOUT = bn('86400') export const USDC_ORACLE_ERROR = fp('0.0025') // PYUSD -export const PYUSD_USD_FEED = networkConfig['1'].chainlinkFeeds.pyUSD! +export const PYUSD_USD_FEED = networkConfig[chainId].chainlinkFeeds.pyUSD! export const PYUSD_ORACLE_TIMEOUT = bn('86400') export const PYUSD_ORACLE_ERROR = fp('0.003') // USDT -export const USDT_USD_FEED = networkConfig['1'].chainlinkFeeds.USDT! +export const USDT_USD_FEED = networkConfig[chainId].chainlinkFeeds.USDT! export const USDT_ORACLE_TIMEOUT = bn('86400') export const USDT_ORACLE_ERROR = fp('0.0025') // ETH -export const ETH_USD_FEED = networkConfig['1'].chainlinkFeeds.ETH! +export const ETH_USD_FEED = networkConfig[chainId].chainlinkFeeds.ETH! export const ETH_ORACLE_TIMEOUT = bn('3600') export const ETH_ORACLE_ERROR = fp('0.005') +// eUSD +export const eUSD_USD_FEED = networkConfig[chainId].chainlinkFeeds.eUSD! +export const eUSD_ORACLE_TIMEOUT = bn('86400') +export const eUSD_ORACLE_ERROR = fp('0.005') + // General export const PRICE_TIMEOUT = bn(604800) // 1 week export const DELAY_UNTIL_DEFAULT = bn(86400) -export const FORK_BLOCK = 19463181 +const FORK_BLOCKS: { [key: string]: number } = { + '1': 19463181, + '8453': 20454200, + '42161': 193157126, // not used +} + +export const FORK_BLOCK = FORK_BLOCKS[chainId] diff --git a/test/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts b/test/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts index 099a9fbf8f..5d5318e23f 100644 --- a/test/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts +++ b/test/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts @@ -10,6 +10,7 @@ export const whales: { [key: string]: string } = { [networkConfig['31337'].tokens.steakPYUSD!]: '0x7E4B4DC22111B84594d9b7707A8DCFFd793D477A', [networkConfig['31337'].tokens.bbUSDT!]: '0xc8E3C36a72B9AA4Af0a057eb4A11e1AFC16465bB', [networkConfig['31337'].tokens.Re7WETH!]: '0xd553294B42bdFEb49D8f5A64E8B2D3A65fc673A9', + [networkConfig['8453'].tokens.meUSD!]: '0xF02ea73c7A3057649f09899aaE1606712758bE8b', } /**