From c2ea22a41a1c0a8ce4d754d27ad95b66ebc6edeb Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 8 Apr 2025 17:44:15 +0300 Subject: [PATCH 1/7] feat: migrations --- ...3442_add_deusd_and_sdusd_as_collaterals.ts | 202 ++++++++++++++++++ deployments/mainnet/usdc/relations.ts | 8 + ...3450_add_deusd_and_sdusd_as_collaterals.ts | 202 ++++++++++++++++++ ...3447_add_deusd_and_sdusd_as_collaterals.ts | 202 ++++++++++++++++++ deployments/mainnet/usdt/relations.ts | 8 + .../liquidateUnderwaterBorrowers.ts | 21 +- 6 files changed, 632 insertions(+), 11 deletions(-) create mode 100644 deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts create mode 100644 deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts create mode 100644 deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts diff --git a/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts new file mode 100644 index 000000000..c9707e665 --- /dev/null +++ b/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts @@ -0,0 +1,202 @@ +import { expect } from 'chai'; +import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; +import { migration } from '../../../../plugins/deployment_manager/Migration'; +import { exp, proposal } from '../../../../src/deploy'; + +const DEUSD_ADDRESS = '0x15700B564Ca08D9439C58cA5053166E8317aa138'; +const SDEUSD_ADDRESS = '0x5C5b196aBE0d54485975D1Ec29617D42D9198326'; +const DEUSD_TO_USD_PRICE_FEED = '0x471a6299C027Bd81ed4D66069dc510Bd0569f4F8'; + +let newPriceFeedAddress: string; + +export default migration('1744113442_add_deusd_and_sdusd_as_collaterals', { + async prepare(deploymentManager: DeploymentManager) { + const sdeUSDMultiplicativePriceFeed = await deploymentManager.deploy( + 'sdeUSD:priceFeed', + 'pricefeeds/PriceFeedWith4626Support.sol', + [ + SDEUSD_ADDRESS, // sdeUSD / deUSD price feed + DEUSD_TO_USD_PRICE_FEED, // deUSD / USD price feed + 8, // decimals + 'sdeUSD / USD price feed', // description + ], + true + ); + return { sdeUSDPriceFeedAddress: sdeUSDMultiplicativePriceFeed.address }; + }, + + async enact(deploymentManager: DeploymentManager, _, { sdeUSDPriceFeedAddress }) { + + const trace = deploymentManager.tracer(); + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDPriceFeed = await deploymentManager.existing( + 'deUSD:priceFeed', + DEUSD_TO_USD_PRICE_FEED, + 'mainnet' + ); + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDPriceFeed = await deploymentManager.existing( + 'sdeUSD:priceFeed', + sdeUSDPriceFeedAddress, + 'mainnet' + ); + + newPriceFeedAddress = sdeUSDPriceFeedAddress; + + const { + governor, + comet, + cometAdmin, + configurator, + } = await deploymentManager.getContracts(); + + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: deUSDPriceFeed.address, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(8_000_000, 18) + }; + + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: sdeUSDPriceFeed.address, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(5_000_000, 18) + }; + + const mainnetActions = [ + // 1. Add deUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, deUSDAssetConfig], + }, + // 2. Add sdeUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, sdeUSDAssetConfig], + }, + // 3. Deploy and upgrade to a new version of Comet + { + contract: cometAdmin, + signature: 'deployAndUpgradeTo(address,address)', + args: [configurator.address, comet.address], + }, + ]; + + const description = '# Add deUSD and sdeUSD as collateral into cUSDCv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDCv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDC market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const txn = await deploymentManager.retry(async () => + trace( + await governor.propose(...(await proposal(mainnetActions, description))) + ) + ); + + const event = txn.events.find( + (event) => event.event === 'ProposalCreated' + ); + const [proposalId] = event.args; + trace(`Created proposal ${proposalId}.`); + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const { comet, configurator } = await deploymentManager.getContracts(); + + const deUSDAssetIndex = Number(await comet.numAssets()) - 2; + const sdeUSDAssetIndex = Number(await comet.numAssets()) - 1; + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: DEUSD_TO_USD_PRICE_FEED, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(8_000_000, 18), + }; + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: newPriceFeedAddress, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(5_000_000, 18), + }; + + // 1. Compare deUSD asset config with Comet and Configurator asset info + const cometDeUSDAssetInfo = await comet.getAssetInfoByAddress(DEUSD_ADDRESS); + expect(deUSDAssetIndex).to.be.equal(cometDeUSDAssetInfo.offset); + expect(deUSDAssetConfig.asset).to.be.equal(cometDeUSDAssetInfo.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(cometDeUSDAssetInfo.priceFeed); + expect(exp(1, deUSDAssetConfig.decimals)).to.be.equal(cometDeUSDAssetInfo.scale); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometDeUSDAssetInfo.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometDeUSDAssetInfo.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(cometDeUSDAssetInfo.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(cometDeUSDAssetInfo.supplyCap); + + const configuratorDeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[deUSDAssetIndex]; + expect(deUSDAssetConfig.asset).to.be.equal(configuratorDeUSDAssetConfig.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(configuratorDeUSDAssetConfig.priceFeed); + expect(deUSDAssetConfig.decimals).to.be.equal(configuratorDeUSDAssetConfig.decimals); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(configuratorDeUSDAssetConfig.supplyCap); + + // 2. Compare sdeUSD asset config with Comet and Configurator asset info + const cometSdeUSDAssetInfo = await comet.getAssetInfoByAddress(SDEUSD_ADDRESS); + expect(sdeUSDAssetIndex).to.be.equal(cometSdeUSDAssetInfo.offset); + expect(sdeUSDAssetConfig.asset).to.be.equal(cometSdeUSDAssetInfo.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(cometSdeUSDAssetInfo.priceFeed); + expect(exp(1, sdeUSDAssetConfig.decimals)).to.be.equal(cometSdeUSDAssetInfo.scale); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(cometSdeUSDAssetInfo.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(cometSdeUSDAssetInfo.supplyCap); + + const configuratorSdeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[sdeUSDAssetIndex]; + expect(sdeUSDAssetConfig.asset).to.be.equal(configuratorSdeUSDAssetConfig.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(configuratorSdeUSDAssetConfig.priceFeed); + expect(sdeUSDAssetConfig.decimals).to.be.equal(configuratorSdeUSDAssetConfig.decimals); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(configuratorSdeUSDAssetConfig.supplyCap); + }, +}); \ No newline at end of file diff --git a/deployments/mainnet/usdc/relations.ts b/deployments/mainnet/usdc/relations.ts index 726cc85d7..2515ded64 100644 --- a/deployments/mainnet/usdc/relations.ts +++ b/deployments/mainnet/usdc/relations.ts @@ -14,6 +14,14 @@ export default { 'AppProxyUpgradeable': { artifact: 'contracts/ERC20.sol:ERC20', }, + 'ERC1967Proxy': { + artifact: 'contracts/ERC20.sol:ERC20', + delegates: { + field: { + slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' + } + } + }, fxRoot: { relations: { stateSender: { diff --git a/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts new file mode 100644 index 000000000..11d6fc710 --- /dev/null +++ b/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts @@ -0,0 +1,202 @@ +import { expect } from 'chai'; +import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; +import { migration } from '../../../../plugins/deployment_manager/Migration'; +import { exp, proposal } from '../../../../src/deploy'; + +const DEUSD_ADDRESS = '0x15700B564Ca08D9439C58cA5053166E8317aa138'; +const SDEUSD_ADDRESS = '0x5C5b196aBE0d54485975D1Ec29617D42D9198326'; +const DEUSD_TO_USD_PRICE_FEED = '0x471a6299C027Bd81ed4D66069dc510Bd0569f4F8'; + +let newPriceFeedAddress: string; + +export default migration('1744113450_add_deusd_and_sdusd_as_collaterals', { + async prepare(deploymentManager: DeploymentManager) { + const sdeUSDMultiplicativePriceFeed = await deploymentManager.deploy( + 'sdeUSD:priceFeed', + 'pricefeeds/PriceFeedWith4626Support.sol', + [ + SDEUSD_ADDRESS, // sdeUSD / deUSD price feed + DEUSD_TO_USD_PRICE_FEED, // deUSD / USD price feed + 8, // decimals + 'sdeUSD / USD price feed', // description + ], + true + ); + return { sdeUSDPriceFeedAddress: sdeUSDMultiplicativePriceFeed.address }; + }, + + async enact(deploymentManager: DeploymentManager, _, { sdeUSDPriceFeedAddress }) { + + const trace = deploymentManager.tracer(); + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDPriceFeed = await deploymentManager.existing( + 'deUSD:priceFeed', + DEUSD_TO_USD_PRICE_FEED, + 'mainnet' + ); + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDPriceFeed = await deploymentManager.existing( + 'sdeUSD:priceFeed', + sdeUSDPriceFeedAddress, + 'mainnet' + ); + + newPriceFeedAddress = sdeUSDPriceFeedAddress; + + const { + governor, + comet, + cometAdmin, + configurator, + } = await deploymentManager.getContracts(); + + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: deUSDPriceFeed.address, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.94, 18), + supplyCap: exp(8_000_000, 18) + }; + + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: sdeUSDPriceFeed.address, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.94, 18), + supplyCap: exp(5_000_000, 18) + }; + + const mainnetActions = [ + // 1. Add deUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, deUSDAssetConfig], + }, + // 2. Add sdeUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, sdeUSDAssetConfig], + }, + // 3. Deploy and upgrade to a new version of Comet + { + contract: cometAdmin, + signature: 'deployAndUpgradeTo(address,address)', + args: [configurator.address, comet.address], + }, + ]; + + const description = '# Add deUSD and sdeUSD as collateral into cUSDSv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDSv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDS market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const txn = await deploymentManager.retry(async () => + trace( + await governor.propose(...(await proposal(mainnetActions, description))) + ) + ); + + const event = txn.events.find( + (event) => event.event === 'ProposalCreated' + ); + const [proposalId] = event.args; + trace(`Created proposal ${proposalId}.`); + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const { comet, configurator } = await deploymentManager.getContracts(); + + const deUSDAssetIndex = Number(await comet.numAssets()) - 2; + const sdeUSDAssetIndex = Number(await comet.numAssets()) - 1; + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: DEUSD_TO_USD_PRICE_FEED, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.94, 18), + supplyCap: exp(8_000_000, 18), + }; + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: newPriceFeedAddress, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.94, 18), + supplyCap: exp(5_000_000, 18), + }; + + // 1. Compare deUSD asset config with Comet and Configurator asset info + const cometDeUSDAssetInfo = await comet.getAssetInfoByAddress(DEUSD_ADDRESS); + expect(deUSDAssetIndex).to.be.equal(cometDeUSDAssetInfo.offset); + expect(deUSDAssetConfig.asset).to.be.equal(cometDeUSDAssetInfo.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(cometDeUSDAssetInfo.priceFeed); + expect(exp(1, deUSDAssetConfig.decimals)).to.be.equal(cometDeUSDAssetInfo.scale); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometDeUSDAssetInfo.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometDeUSDAssetInfo.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(cometDeUSDAssetInfo.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(cometDeUSDAssetInfo.supplyCap); + + const configuratorDeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[deUSDAssetIndex]; + expect(deUSDAssetConfig.asset).to.be.equal(configuratorDeUSDAssetConfig.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(configuratorDeUSDAssetConfig.priceFeed); + expect(deUSDAssetConfig.decimals).to.be.equal(configuratorDeUSDAssetConfig.decimals); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(configuratorDeUSDAssetConfig.supplyCap); + + // 2. Compare sdeUSD asset config with Comet and Configurator asset info + const cometSdeUSDAssetInfo = await comet.getAssetInfoByAddress(SDEUSD_ADDRESS); + expect(sdeUSDAssetIndex).to.be.equal(cometSdeUSDAssetInfo.offset); + expect(sdeUSDAssetConfig.asset).to.be.equal(cometSdeUSDAssetInfo.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(cometSdeUSDAssetInfo.priceFeed); + expect(exp(1, sdeUSDAssetConfig.decimals)).to.be.equal(cometSdeUSDAssetInfo.scale); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(cometSdeUSDAssetInfo.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(cometSdeUSDAssetInfo.supplyCap); + + const configuratorSdeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[sdeUSDAssetIndex]; + expect(sdeUSDAssetConfig.asset).to.be.equal(configuratorSdeUSDAssetConfig.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(configuratorSdeUSDAssetConfig.priceFeed); + expect(sdeUSDAssetConfig.decimals).to.be.equal(configuratorSdeUSDAssetConfig.decimals); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(configuratorSdeUSDAssetConfig.supplyCap); + }, +}); diff --git a/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts new file mode 100644 index 000000000..bd66d2ad2 --- /dev/null +++ b/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts @@ -0,0 +1,202 @@ +import { expect } from 'chai'; +import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; +import { migration } from '../../../../plugins/deployment_manager/Migration'; +import { exp, proposal } from '../../../../src/deploy'; + +const DEUSD_ADDRESS = '0x15700B564Ca08D9439C58cA5053166E8317aa138'; +const SDEUSD_ADDRESS = '0x5C5b196aBE0d54485975D1Ec29617D42D9198326'; +const DEUSD_TO_USD_PRICE_FEED = '0x471a6299C027Bd81ed4D66069dc510Bd0569f4F8'; + +let newPriceFeedAddress: string; + +export default migration('1744113447_add_deusd_and_sdusd_as_collaterals', { + async prepare(deploymentManager: DeploymentManager) { + const sdeUSDMultiplicativePriceFeed = await deploymentManager.deploy( + 'sdeUSD:priceFeed', + 'pricefeeds/PriceFeedWith4626Support.sol', + [ + SDEUSD_ADDRESS, // sdeUSD / deUSD price feed + DEUSD_TO_USD_PRICE_FEED, // deUSD / USD price feed + 8, // decimals + 'sdeUSD / USD price feed', // description + ], + true + ); + return { sdeUSDPriceFeedAddress: sdeUSDMultiplicativePriceFeed.address }; + }, + + async enact(deploymentManager: DeploymentManager, _, { sdeUSDPriceFeedAddress }) { + + const trace = deploymentManager.tracer(); + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDPriceFeed = await deploymentManager.existing( + 'deUSD:priceFeed', + DEUSD_TO_USD_PRICE_FEED, + 'mainnet' + ); + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDPriceFeed = await deploymentManager.existing( + 'sdeUSD:priceFeed', + sdeUSDPriceFeedAddress, + 'mainnet' + ); + + newPriceFeedAddress = sdeUSDPriceFeedAddress; + + const { + governor, + comet, + cometAdmin, + configurator, + } = await deploymentManager.getContracts(); + + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: deUSDPriceFeed.address, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(8_000_000, 18) + }; + + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: sdeUSDPriceFeed.address, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(5_000_000, 18) + }; + + const mainnetActions = [ + // 1. Add deUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, deUSDAssetConfig], + }, + // 2. Add sdeUSD as asset + { + contract: configurator, + signature: 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + args: [comet.address, sdeUSDAssetConfig], + }, + // 3. Deploy and upgrade to a new version of Comet + { + contract: cometAdmin, + signature: 'deployAndUpgradeTo(address,address)', + args: [configurator.address, comet.address], + }, + ]; + + const description = '# Add deUSD and sdeUSD as collateral into cUSDTv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDTv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const txn = await deploymentManager.retry(async () => + trace( + await governor.propose(...(await proposal(mainnetActions, description))) + ) + ); + + const event = txn.events.find( + (event) => event.event === 'ProposalCreated' + ); + const [proposalId] = event.args; + trace(`Created proposal ${proposalId}.`); + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const { comet, configurator } = await deploymentManager.getContracts(); + + const deUSDAssetIndex = Number(await comet.numAssets()) - 2; + const sdeUSDAssetIndex = Number(await comet.numAssets()) - 1; + + const deUSD = await deploymentManager.existing( + 'deUSD', + DEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const deUSDAssetConfig = { + asset: deUSD.address, + priceFeed: DEUSD_TO_USD_PRICE_FEED, + decimals: await deUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(8_000_000, 18), + }; + + const sdeUSD = await deploymentManager.existing( + 'sdeUSD', + SDEUSD_ADDRESS, + 'mainnet', + 'contracts/ERC20.sol:ERC20' + ); + const sdeUSDAssetConfig = { + asset: sdeUSD.address, + priceFeed: newPriceFeedAddress, + decimals: await sdeUSD.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.96, 18), + supplyCap: exp(5_000_000, 18), + }; + + // 1. Compare deUSD asset config with Comet and Configurator asset info + const cometDeUSDAssetInfo = await comet.getAssetInfoByAddress(DEUSD_ADDRESS); + expect(deUSDAssetIndex).to.be.equal(cometDeUSDAssetInfo.offset); + expect(deUSDAssetConfig.asset).to.be.equal(cometDeUSDAssetInfo.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(cometDeUSDAssetInfo.priceFeed); + expect(exp(1, deUSDAssetConfig.decimals)).to.be.equal(cometDeUSDAssetInfo.scale); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometDeUSDAssetInfo.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometDeUSDAssetInfo.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(cometDeUSDAssetInfo.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(cometDeUSDAssetInfo.supplyCap); + + const configuratorDeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[deUSDAssetIndex]; + expect(deUSDAssetConfig.asset).to.be.equal(configuratorDeUSDAssetConfig.asset); + expect(deUSDAssetConfig.priceFeed).to.be.equal(configuratorDeUSDAssetConfig.priceFeed); + expect(deUSDAssetConfig.decimals).to.be.equal(configuratorDeUSDAssetConfig.decimals); + expect(deUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.borrowCollateralFactor); + expect(deUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidateCollateralFactor); + expect(deUSDAssetConfig.liquidationFactor).to.be.equal(configuratorDeUSDAssetConfig.liquidationFactor); + expect(deUSDAssetConfig.supplyCap).to.be.equal(configuratorDeUSDAssetConfig.supplyCap); + + // 2. Compare sdeUSD asset config with Comet and Configurator asset info + const cometSdeUSDAssetInfo = await comet.getAssetInfoByAddress(SDEUSD_ADDRESS); + expect(sdeUSDAssetIndex).to.be.equal(cometSdeUSDAssetInfo.offset); + expect(sdeUSDAssetConfig.asset).to.be.equal(cometSdeUSDAssetInfo.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(cometSdeUSDAssetInfo.priceFeed); + expect(exp(1, sdeUSDAssetConfig.decimals)).to.be.equal(cometSdeUSDAssetInfo.scale); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(cometSdeUSDAssetInfo.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(cometSdeUSDAssetInfo.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(cometSdeUSDAssetInfo.supplyCap); + + const configuratorSdeUSDAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[sdeUSDAssetIndex]; + expect(sdeUSDAssetConfig.asset).to.be.equal(configuratorSdeUSDAssetConfig.asset); + expect(sdeUSDAssetConfig.priceFeed).to.be.equal(configuratorSdeUSDAssetConfig.priceFeed); + expect(sdeUSDAssetConfig.decimals).to.be.equal(configuratorSdeUSDAssetConfig.decimals); + expect(sdeUSDAssetConfig.borrowCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.borrowCollateralFactor); + expect(sdeUSDAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidateCollateralFactor); + expect(sdeUSDAssetConfig.liquidationFactor).to.be.equal(configuratorSdeUSDAssetConfig.liquidationFactor); + expect(sdeUSDAssetConfig.supplyCap).to.be.equal(configuratorSdeUSDAssetConfig.supplyCap); + }, +}); diff --git a/deployments/mainnet/usdt/relations.ts b/deployments/mainnet/usdt/relations.ts index 3bc07940d..6ed54e744 100644 --- a/deployments/mainnet/usdt/relations.ts +++ b/deployments/mainnet/usdt/relations.ts @@ -36,4 +36,12 @@ export default { } } }, + UUPSProxy: { + artifact: 'contracts/ERC20.sol:ERC20', + delegates: { + field: { + slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' + } + } + }, }; \ No newline at end of file diff --git a/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts b/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts index 735b00b89..f1426c627 100644 --- a/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts +++ b/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts @@ -104,8 +104,7 @@ export const flashLoanPools = { tokenAddress: addresses.mainnet.WETH9, poolFee: 500 }, - } -}, + }, polygon: { usdc: { tokenAddress: addresses.polygon.BOB, @@ -431,15 +430,15 @@ async function attemptLiquidationViaOnChainLiquidator( number, number ] = [ - comet.address, - targetAddresses, - assets, - poolConfigs, - maxAmountsToPurchase, - flashLoanPoolTokenAddress, - flashLoanPoolFee, - liquidationThreshold - ]; + comet.address, + targetAddresses, + assets, + poolConfigs, + maxAmountsToPurchase, + flashLoanPoolTokenAddress, + flashLoanPoolFee, + liquidationThreshold + ]; const txn = await liquidator.populateTransaction.absorbAndArbitrage( ...args, From e676ecf6aa938e373d571e22d28588ea363bb567 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 8 Apr 2025 18:01:21 +0300 Subject: [PATCH 2/7] fix: linter --- scenario/utils/index.ts | 6 +++--- src/deploy/index.ts | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scenario/utils/index.ts b/scenario/utils/index.ts index b8848f1de..76f54b590 100644 --- a/scenario/utils/index.ts +++ b/scenario/utils/index.ts @@ -511,9 +511,9 @@ async function testnetPropose( const governor = await dm.getContractOrThrow('governor'); const testnetGovernor = new Contract( governor.address, [ - 'function propose(address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) external returns (uint256 proposalId)', - 'event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description)' - ], governor.signer + 'function propose(address[] memory targets, uint256[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) external returns (uint256 proposalId)', + 'event ProposalCreated(uint256 proposalId, address proposer, address[] targets, uint256[] values, string[] signatures, bytes[] calldatas, uint256 startBlock, uint256 endBlock, string description)' + ], governor.signer ); return testnetGovernor.connect(proposer).propose( diff --git a/src/deploy/index.ts b/src/deploy/index.ts index 273e99507..cfa08d2b7 100644 --- a/src/deploy/index.ts +++ b/src/deploy/index.ts @@ -174,22 +174,24 @@ export async function calldata(req: Promise): Promise { const targets = [], values = [], + signatures = [], calldatas = []; for (const action of actions) { if (action['contract']) { const { contract, value, signature, args } = action as ContractAction; targets.push(contract.address); values.push(value ?? 0); - calldatas.push(utils.id(signature).slice(0, 10) + (await calldata(contract.populateTransaction[signature](...args))).slice(2)); + signatures.push(signature); + calldatas.push(await calldata(contract.populateTransaction[signature](...args))); } else { const { target, value, signature, calldata } = action as TargetAction; targets.push(target); values.push(value ?? 0); - calldatas.push(utils.id(signature).slice(0, 10) + calldata.slice(2)); + signatures.push(signature); + calldatas.push(calldata); } } return [targets, values, signatures, calldatas, description]; - } export async function proposal(actions: ProposalAction[], description: string): Promise { From 53487405b6f6dc058c13757dbb5083864707c6c1 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 8 Apr 2025 20:27:54 +0300 Subject: [PATCH 3/7] fix: pr link --- .../migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts | 2 +- .../migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts | 2 +- .../migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts index c9707e665..64e5a5f35 100644 --- a/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts +++ b/deployments/mainnet/usdc/migrations/1744113442_add_deusd_and_sdusd_as_collaterals.ts @@ -103,7 +103,7 @@ export default migration('1744113442_add_deusd_and_sdusd_as_collaterals', { }, ]; - const description = '# Add deUSD and sdeUSD as collateral into cUSDCv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDCv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDC market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const description = '# Add deUSD and sdeUSD as collateral into cUSDCv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDCv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDC market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/981) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; const txn = await deploymentManager.retry(async () => trace( await governor.propose(...(await proposal(mainnetActions, description))) diff --git a/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts index 11d6fc710..7a01acdcd 100644 --- a/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts +++ b/deployments/mainnet/usds/migrations/1744113450_add_deusd_and_sdusd_as_collaterals.ts @@ -103,7 +103,7 @@ export default migration('1744113450_add_deusd_and_sdusd_as_collaterals', { }, ]; - const description = '# Add deUSD and sdeUSD as collateral into cUSDSv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDSv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDS market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const description = '# Add deUSD and sdeUSD as collateral into cUSDSv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDSv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDS market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/981) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; const txn = await deploymentManager.retry(async () => trace( await governor.propose(...(await proposal(mainnetActions, description))) diff --git a/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts b/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts index bd66d2ad2..4fc4b2f41 100644 --- a/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts +++ b/deployments/mainnet/usdt/migrations/1744113447_add_deusd_and_sdusd_as_collaterals.ts @@ -103,7 +103,7 @@ export default migration('1744113447_add_deusd_and_sdusd_as_collaterals', { }, ]; - const description = '# Add deUSD and sdeUSD as collateral into cUSDTv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDTv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/<>) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; + const description = '# Add deUSD and sdeUSD as collateral into cUSDTv3 on Mainnet\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add sdeUSD and deUSD into cUSDTv3 on Ethereum network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Ethereum. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based on the [recommendations from Gauntlet](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112/6).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/981) and [forum discussion](https://www.comp.xyz/t/add-collateral-deusd-sdeusd-staked-on-usdc-usds-usdt-on-mainnet/6112).\n\n\n## Proposal Actions\n\nThe first action adds deUSD asset as collateral with corresponding configurations.\n\nThe second action adds sdeUSD asset as collateral with corresponding configurations.\n\nThe third action deploys and upgrades Comet to a new version.'; const txn = await deploymentManager.retry(async () => trace( await governor.propose(...(await proposal(mainnetActions, description))) From 2b64c938798e83c83a0a79580f06e9e94cac2d58 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 17 Apr 2025 14:56:41 +0300 Subject: [PATCH 4/7] fix: add sFRAX whale --- src/deploy/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/deploy/index.ts b/src/deploy/index.ts index 8f32eaf59..4f372e755 100644 --- a/src/deploy/index.ts +++ b/src/deploy/index.ts @@ -103,6 +103,7 @@ export const WHALES = { '0x3b3501f6778Bfc56526cF2aC33b78b2fDBE4bc73', // solvBTC.BBN whale '0x8bc93498b861fd98277c3b51d240e7E56E48F23c', // solvBTC.BBN whale '0xD5cf704dC17403343965b4F9cd4D7B5e9b20CC52', // solvBTC.BBN whale + '0x34C0bD5877A5Ee7099D0f5688D65F4bB9158BDE2', // sFRAX whale ], polygon: [ '0xF977814e90dA44bFA03b6295A0616a897441aceC', // USDT whale From d43a477143bf0d52d5859037f01ec96cd3c6a7e9 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 17 Apr 2025 15:24:06 +0300 Subject: [PATCH 5/7] fix --- .github/workflows/deploy-market.yaml | 4 ++-- .github/workflows/enact-migration.yaml | 6 +++--- .github/workflows/prepare-migration.yaml | 5 +++-- .github/workflows/run-contract-linter.yaml | 2 +- .github/workflows/run-coverage.yaml | 2 +- .github/workflows/run-eslint.yaml | 2 +- .github/workflows/run-gas-profiler.yaml | 2 +- .github/workflows/run-scenarios.yaml | 2 +- .github/workflows/run-semgrep.yaml | 2 +- .github/workflows/run-unit-tests.yaml | 2 +- hardhat.config.ts | 4 ++-- 11 files changed, 17 insertions(+), 16 deletions(-) diff --git a/.github/workflows/deploy-market.yaml b/.github/workflows/deploy-market.yaml index be77edd57..29b9e614d 100644 --- a/.github/workflows/deploy-market.yaml +++ b/.github/workflows/deploy-market.yaml @@ -41,7 +41,7 @@ jobs: OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }} MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }} SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} UNICHAIN_QUICKNODE_KEY: ${{ secrets.UNICHAIN_QUICKNODE_KEY }} steps: - name: Seacrest @@ -49,7 +49,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' diff --git a/.github/workflows/enact-migration.yaml b/.github/workflows/enact-migration.yaml index 55c66cff0..74b4444db 100644 --- a/.github/workflows/enact-migration.yaml +++ b/.github/workflows/enact-migration.yaml @@ -58,7 +58,7 @@ jobs: OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }} MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }} SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} UNICHAIN_QUICKNODE_KEY: ${{ secrets.UNICHAIN_QUICKNODE_KEY }} GOV_NETWORK: ${{ secrets.GOV_NETWORK }} steps: @@ -78,7 +78,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' @@ -87,7 +87,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ env.GOV_NETWORK }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" port: 8685 if: github.event.inputs.eth_pk == '' && env.GOV_NETWORK != '' && github.event.inputs.impersonateAccount == '' diff --git a/.github/workflows/prepare-migration.yaml b/.github/workflows/prepare-migration.yaml index 1f2a332ba..b625c9a7d 100644 --- a/.github/workflows/prepare-migration.yaml +++ b/.github/workflows/prepare-migration.yaml @@ -37,7 +37,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} @@ -45,13 +45,14 @@ jobs: OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }} MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }} SCROLLSCAN_KEY: ${{ secrets.SCROLLSCAN_KEY }} + UNICHAIN_QUICKNODE_KEY: ${{ secrets.UNICHAIN_QUICKNODE_KEY }} steps: - name: Seacrest uses: hayesgm/seacrest@af229b0a00b73cb6fa9940a836a62fa3b918fd77 with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' diff --git a/.github/workflows/run-contract-linter.yaml b/.github/workflows/run-contract-linter.yaml index a94bfeef0..6b78a255b 100644 --- a/.github/workflows/run-contract-linter.yaml +++ b/.github/workflows/run-contract-linter.yaml @@ -11,7 +11,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-coverage.yaml b/.github/workflows/run-coverage.yaml index 886768715..197a99660 100644 --- a/.github/workflows/run-coverage.yaml +++ b/.github/workflows/run-coverage.yaml @@ -13,7 +13,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-eslint.yaml b/.github/workflows/run-eslint.yaml index 69863b0a7..f3518c21a 100644 --- a/.github/workflows/run-eslint.yaml +++ b/.github/workflows/run-eslint.yaml @@ -11,7 +11,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-gas-profiler.yaml b/.github/workflows/run-gas-profiler.yaml index 5fedfbcde..b986dad80 100644 --- a/.github/workflows/run-gas-profiler.yaml +++ b/.github/workflows/run-gas-profiler.yaml @@ -12,7 +12,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-scenarios.yaml b/.github/workflows/run-scenarios.yaml index 33c10d9d8..9b239a48a 100644 --- a/.github/workflows/run-scenarios.yaml +++ b/.github/workflows/run-scenarios.yaml @@ -14,7 +14,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} diff --git a/.github/workflows/run-semgrep.yaml b/.github/workflows/run-semgrep.yaml index 63d35a09e..433522f48 100644 --- a/.github/workflows/run-semgrep.yaml +++ b/.github/workflows/run-semgrep.yaml @@ -18,7 +18,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }} MANTLESCAN_KEY: ${{ secrets.MANTLESCAN_KEY }} diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/run-unit-tests.yaml index c9d2bd8df..0574accdf 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/run-unit-tests.yaml @@ -11,7 +11,7 @@ jobs: SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} ANKR_KEY: ${{ secrets.ANKR_KEY }} - TENDERLY_KEY_RONIN: ${{ secrets.TENDERLY_KEY_RONIN }} + _TENDERLY_KEY_RONIN: ${{ secrets._TENDERLY_KEY_RONIN }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/hardhat.config.ts b/hardhat.config.ts index 99630a677..0ddfb95db 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -62,7 +62,7 @@ const { MANTLESCAN_KEY, SCROLLSCAN_KEY, ANKR_KEY, - //TENDERLY_KEY_RONIN, + //_TENDERLY_KEY_RONIN, MNEMONIC = 'myth like bonus scare over problem client lizard pioneer submit female collect', REPORT_GAS = 'false', NETWORK_PROVIDER = '', @@ -123,7 +123,7 @@ const networkConfigs: NetworkConfig[] = [ { network: 'ronin', chainId: 2020, - //url: `https://ronin.gateway.tenderly.co/${TENDERLY_KEY_RONIN}`, + //url: `https://ronin.gateway.tenderly.co/${_TENDERLY_KEY_RONIN}`, url: 'https://ronin.lgns.net/rpc', }, { From 28415669c11f4fe02bbea6d60329b19e50a6dce9 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 17 Apr 2025 15:40:51 +0300 Subject: [PATCH 6/7] fix: replace infura with ankr --- .github/workflows/deploy-market.yaml | 2 +- .github/workflows/enact-migration.yaml | 4 ++-- .github/workflows/prepare-migration.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-market.yaml b/.github/workflows/deploy-market.yaml index 29b9e614d..0da18551c 100644 --- a/.github/workflows/deploy-market.yaml +++ b/.github/workflows/deploy-market.yaml @@ -49,7 +49,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://rpc.ankr.com/mantle/${ANKR_KEY}\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://rpc.ankr.com/eth/${ANKR_KEY}\",\"sepolia\":\"https://rpc.ankr.com/eth_sepolia/${ANKR_KEY}\",\"polygon\":\"https://rpc.ankr.com/polygon/${ANKR_KEY}\",\"arbitrum\":\"https://rpc.ankr.com/arbitrum/${ANKR_KEY}\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' diff --git a/.github/workflows/enact-migration.yaml b/.github/workflows/enact-migration.yaml index 74b4444db..68291a14a 100644 --- a/.github/workflows/enact-migration.yaml +++ b/.github/workflows/enact-migration.yaml @@ -78,7 +78,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://rpc.ankr.com/mantle/${ANKR_KEY}\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://rpc.ankr.com/eth/${ANKR_KEY}\",\"sepolia\":\"https://rpc.ankr.com/eth_sepolia/${ANKR_KEY}\",\"polygon\":\"https://rpc.ankr.com/polygon/${ANKR_KEY}\",\"arbitrum\":\"https://rpc.ankr.com/arbitrum/${ANKR_KEY}\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' @@ -87,7 +87,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ env.GOV_NETWORK }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://rpc.ankr.com/mantle/${ANKR_KEY}\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://rpc.ankr.com/eth/${ANKR_KEY}\",\"sepolia\":\"https://rpc.ankr.com/eth_sepolia/${ANKR_KEY}\",\"polygon\":\"https://rpc.ankr.com/polygon/${ANKR_KEY}\",\"arbitrum\":\"https://rpc.ankr.com/arbitrum/${ANKR_KEY}\"}')[env.GOV_NETWORK] }}" port: 8685 if: github.event.inputs.eth_pk == '' && env.GOV_NETWORK != '' && github.event.inputs.impersonateAccount == '' diff --git a/.github/workflows/prepare-migration.yaml b/.github/workflows/prepare-migration.yaml index b625c9a7d..376a8805c 100644 --- a/.github/workflows/prepare-migration.yaml +++ b/.github/workflows/prepare-migration.yaml @@ -52,7 +52,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"ronin\":\"https://ronin.gateway.tenderly.co/$_TENDERLY_KEY_RONIN\",\"unichain\":\"https://multi-boldest-patina.unichain-mainnet.quiknode.pro/${UNICHAIN_QUICKNODE_KEY}\",\"mantle\":\"https://rpc.ankr.com/mantle/${ANKR_KEY}\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://rpc.ankr.com/eth/${ANKR_KEY}\",\"sepolia\":\"https://rpc.ankr.com/eth_sepolia/${ANKR_KEY}\",\"polygon\":\"https://rpc.ankr.com/polygon/${ANKR_KEY}\",\"arbitrum\":\"https://rpc.ankr.com/arbitrum/${ANKR_KEY}\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' From 30fa7ff3ceca391ed0e5e9e90dbb47beaef5c777 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 17 Apr 2025 16:58:12 +0300 Subject: [PATCH 7/7] fix: liquidation test --- scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts b/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts index f1426c627..7eb638bbc 100644 --- a/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts +++ b/scripts/liquidation_bot/liquidateUnderwaterBorrowers.ts @@ -471,7 +471,10 @@ async function attemptLiquidationViaOnChainLiquidator( } async function getUniqueAddresses(comet: CometInterface): Promise> { - const withdrawEvents = await comet.queryFilter(comet.filters.Withdraw()); + const endBlock = await hre.ethers.provider.getBlockNumber(); + const maxBlockRange = 90000; // Adjust based on provider limits + const startBlock = endBlock - maxBlockRange; + const withdrawEvents = await comet.queryFilter(comet.filters.Withdraw(), startBlock, endBlock); return new Set(withdrawEvents.map(event => event.args.src)); }