Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
ee65afb
current dev
MishaShWoof Jul 25, 2025
7e08ec9
fix: working dev
MishaShWoof Jul 25, 2025
2bb3587
fix: scenarios
MishaShWoof Jul 28, 2025
9f5564c
fix
MishaShWoof Jul 28, 2025
88fe803
fix
MishaShWoof Jul 28, 2025
8b5ee76
Update index.ts
MishaShWoof Jul 28, 2025
700a4c6
Update DeploymentManager.ts
MishaShWoof Jul 29, 2025
4cbf863
fix: unit tests
MishaShWoof Aug 14, 2025
2bc2dbf
fix: working linea scenarios and prepare workflow fix
MishaShWoof Aug 20, 2025
0313418
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Sep 16, 2025
688d515
fix: remove linea markets from dev
MishaShWoof Sep 16, 2025
df8d724
fix: remove localhost deployment
MishaShWoof Sep 19, 2025
0001bd6
fix: unify import
MishaShWoof Sep 22, 2025
d04a40d
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Sep 25, 2025
2621df6
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Nov 11, 2025
aceaf43
fixes from recent prs
MishaShWoof Nov 11, 2025
3f9caef
fix: change base rpc
MishaShWoof Nov 12, 2025
68f6aab
fix: change rpc
MishaShWoof Nov 14, 2025
d2801ea
fix: replace ankr with quicknode
MishaShWoof Nov 17, 2025
001b60c
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Nov 24, 2025
38a9d9e
fix: working tests
MishaShWoof Nov 24, 2025
525e5a8
fix: working forge test
MishaShWoof Nov 24, 2025
d73df39
Update run-forge-tests.yaml
MishaShWoof Nov 24, 2025
640d956
Update run-forge-tests.yaml
MishaShWoof Nov 24, 2025
49ac136
Update run-scenarios.yaml
MishaShWoof Nov 27, 2025
a16813a
fix: env in scenario
MishaShWoof Nov 27, 2025
0407aa6
fix: use different keys for etherscan
MishaShWoof Nov 27, 2025
1a368d4
fix: strict order
MishaShWoof Nov 27, 2025
a34434f
fix: pass the prepared state
MishaShWoof Nov 27, 2025
9d6c077
fix: remove matrix
MishaShWoof Nov 27, 2025
58ed478
fix: pass node modules
MishaShWoof Nov 27, 2025
0e67e92
fix: add contracts to cache before scenario run
MishaShWoof Nov 28, 2025
bc0871e
fix: cache path fix
MishaShWoof Nov 28, 2025
5f4fc6f
fix: use hidden files
MishaShWoof Nov 28, 2025
5a77147
fix: fuji
MishaShWoof Nov 28, 2025
b287ff2
feat: rotate apikeys and some arbitrum fixes
MishaShWoof Dec 2, 2025
070fda2
Merge pull request #279 from woof-software/speed-up-scenarios
MishaShWoof Dec 3, 2025
98e6783
fix: working arbitrum scenarios
MishaShWoof Dec 3, 2025
b2b05a2
fix: teth symbol fix
MishaShWoof Dec 3, 2025
a0fdad7
fix: add debug for spider
MishaShWoof Dec 3, 2025
0cf69cd
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Dec 22, 2025
e7f8ce6
fix: ronin and forge test fixes
MishaShWoof Dec 22, 2025
b3456da
fix: working arbitrum scenarios
MishaShWoof Dec 24, 2025
8b2ea24
new fixes
MishaShWoof Feb 23, 2026
73cb01d
fix
MishaShWoof Feb 23, 2026
7d4a913
fix: precision fix
MishaShWoof Feb 23, 2026
f3ebdba
fix: change scroll rpc
MishaShWoof Apr 9, 2026
ccc4855
fix: update relations and cctp addresses
MishaShWoof Apr 24, 2026
e5144db
fix
MishaShWoof Apr 24, 2026
c980175
fix: handle max gaslimit per tx
MishaShWoof May 1, 2026
750ede2
fix: slither
MishaShWoof May 1, 2026
e02ba0d
fix: change capo branch
MishaShWoof May 13, 2026
e18d7a8
fix: supply and withdraw scenario fixes
MishaShWoof May 19, 2026
a9747c9
feat: recent proposals
MishaShWoof May 21, 2026
c1c411a
fix: speed up gas tests
MishaShWoof May 21, 2026
2c7d198
fix: set enacted to true
MishaShWoof May 21, 2026
7b738e5
fix: remove redundant migrations
MishaShWoof May 22, 2026
eadf6f4
fix: undo delition
MishaShWoof May 22, 2026
feef68f
Merge branch 'main' of github.com:woof-software/comet into develop
MishaShWoof Jun 1, 2026
8bea7de
Next Develop Update (#433)
MishaShWoof Jun 1, 2026
e24f281
fix: remove Comet.sol, drop Sepolia and Fuji deployments, and update …
MishaShWoof Jun 1, 2026
877935b
fix: remove deleted param from deploy scripts
MishaShWoof Jun 1, 2026
f4d74bd
Delete ScrollComet.sol
MishaShWoof Jun 1, 2026
38e68d9
fix: revert multichain proposal simulation from develop
VladyslavBudiukWOOF Jun 8, 2026
5ffdf17
feat: Migration
MishaShWoof Jun 22, 2026
07142ff
fix: Skip useless scenario
MishaShWoof Jun 22, 2026
cb35ad6
fix: Update description
MishaShWoof Jun 22, 2026
f276264
fix: Use existing price feed
MishaShWoof Jun 22, 2026
54f02f5
fix: rename
MishaShWoof Jun 22, 2026
665d17d
fix: Working tenderly params
MishaShWoof Jun 22, 2026
d7315dd
fix: Set bcf to 0
MishaShWoof Jul 1, 2026
0c2a044
chore: Update scenario and whale config
MishaShWoof Jul 1, 2026
c28379e
Merge branch 'main' of github.com:woof-software/comet into woof-softw…
MishaShWoof Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
211 changes: 211 additions & 0 deletions deployments/polygon/usdc/migrations/1782122727_deprecate_maticx.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
import { expect } from 'chai';
import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager';
import { migration } from '../../../../plugins/deployment_manager/Migration';
import { calldata, proposal } from '../../../../src/deploy';
import { utils, Contract } from 'ethers';


let minPricePriceFeed: string;

const USDC_COMET = '0xF25212E676D1F7F89Cd72fFEe66158f541246445';
const USDT_COMET = '0xaeB318360f27748Acb200CE616E389A6C9409a07';

export default migration('1782122727_deprecate_maticx', {
async prepare() {
return {};
},

async enact(deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager) {

const trace = deploymentManager.tracer();

const {
configurator,
bridgeReceiver,
cometAdmin,
MaticX,
'stMATIC:priceFeed': stMaticPriceFeed
} = await deploymentManager.getContracts();
minPricePriceFeed = stMaticPriceFeed.address;

const {
governor,
fxRoot
} = await govDeploymentManager.getContracts();

const updateMaticXBorrowCollateralFactorCalldataUsdc = await calldata(
configurator.populateTransaction.updateAssetBorrowCollateralFactor(
USDC_COMET,
MaticX.address,
0
)
);

const updateMaticXPriceFeedCalldataUsdc = await calldata(
configurator.populateTransaction.updateAssetPriceFeed(
USDC_COMET,
MaticX.address,
minPricePriceFeed
)
);

const updateMaticXSupplyCapCalldataUsdc = await calldata(
configurator.populateTransaction.updateAssetSupplyCap(
USDC_COMET,
MaticX.address,
0
)
);

const deployAndUpgradeToCalldataUsdc = await calldata(
cometAdmin.populateTransaction.deployAndUpgradeTo(
configurator.address,
USDC_COMET
)
);

const updateMaticXBorrowCollateralFactorCalldataUsdt = await calldata(
configurator.populateTransaction.updateAssetBorrowCollateralFactor(
USDT_COMET,
MaticX.address,
0
)
);

const updateMaticXPriceFeedCalldataUsdt = await calldata(
configurator.populateTransaction.updateAssetPriceFeed(
USDT_COMET,
MaticX.address,
minPricePriceFeed
)
);

const updateMaticXSupplyCapCalldataUsdt = await calldata(
configurator.populateTransaction.updateAssetSupplyCap(
USDT_COMET,
MaticX.address,
0
)
);

const deployAndUpgradeToCalldataUsdt = await calldata(
cometAdmin.populateTransaction.deployAndUpgradeTo(
configurator.address,
USDT_COMET
)
);

const l2ProposalData = utils.defaultAbiCoder.encode(
['address[]', 'uint256[]', 'string[]', 'bytes[]'],
[
[
configurator.address, configurator.address, configurator.address, cometAdmin.address,
configurator.address, configurator.address, configurator.address, cometAdmin.address,
],
[
0, 0, 0, 0,
0, 0, 0, 0,
],
[
'updateAssetBorrowCollateralFactor(address,address,uint64)', 'updateAssetPriceFeed(address,address,address)', 'updateAssetSupplyCap(address,address,uint128)', 'deployAndUpgradeTo(address,address)',
'updateAssetBorrowCollateralFactor(address,address,uint64)', 'updateAssetPriceFeed(address,address,address)', 'updateAssetSupplyCap(address,address,uint128)', 'deployAndUpgradeTo(address,address)',
],
[
updateMaticXBorrowCollateralFactorCalldataUsdc, updateMaticXPriceFeedCalldataUsdc, updateMaticXSupplyCapCalldataUsdc, deployAndUpgradeToCalldataUsdc,
updateMaticXBorrowCollateralFactorCalldataUsdt, updateMaticXPriceFeedCalldataUsdt, updateMaticXSupplyCapCalldataUsdt, deployAndUpgradeToCalldataUsdt,
],
]
);

const mainnetActions = [
// 1. Set Comet configuration and deployAndUpgradeTo new Comet on Polygon.
{
contract: fxRoot,
signature: 'sendMessageToChild(address,bytes)',
args: [bridgeReceiver.address, l2ProposalData],
},
];

const description = `# Deprecate MaticX in cUSDCv3 and cUSDTv3 on Polygon

## Proposal summary

Woof proposes to deprecate MaticX as collateral in cUSDCv3 and cUSDTv3 on Polygon by updating its price feed to a constant price feed with a price of 1 wei, setting its supply cap to 0, and setting its borrow collateral factor to 0.

Further detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/1136) and [forum discussion](<>).

## Proposal actions

The first action updates MaticX price feed to the constant price feed with a price of 1 wei, sets its supply cap to 0, and sets its borrow collateral factor to 0. This sends the encoded 'updateAssetBorrowCollateralFactor', 'updateAssetPriceFeed', 'updateAssetSupplyCap' and 'deployAndUpgradeTo' calls across the bridge to the governance receiver for both cUSDCv3 and cUSDTv3 on Polygon.
`;

const txn = await deploymentManager.retry(async () =>
trace(
await governor.propose(...(await proposal(mainnetActions, description)))
), 0, 300_000
);
const event = txn.events.find(
(event: { event: string }) => event.event === 'ProposalCreated'
);
const [proposalId] = event.args;
trace(`Created proposal ${proposalId}.`);
},

async enacted(): Promise<boolean> {
return false;
},

async verify(deploymentManager: DeploymentManager) {
const { configurator, MaticX } = await deploymentManager.getContracts();

// USDC
const usdcComet = new Contract(
USDC_COMET,
[
'function getAssetInfoByAddress(address) external view returns(tuple(uint8 offset, address asset, address priceFeed, uint64 scale, uint64 borrowCollateralFactor, uint64 liquidateCollateralFactor, uint64 liquidationFactor, uint128 supplyCap))',
'function getPrice(address priceFeed) view returns (uint256)',
],
await deploymentManager.getSigner()
);

const maticXIndexInUsdcComet = await configurator.getAssetIndex(usdcComet.address, MaticX.address);

const maticXInUsdcCometInfo = await usdcComet.getAssetInfoByAddress(MaticX.address);
const maticXInUsdcConfiguratorInfo = (await configurator.getConfiguration(usdcComet.address)).assetConfigs[maticXIndexInUsdcComet];

expect(maticXInUsdcCometInfo.priceFeed).to.eq(minPricePriceFeed);
expect(maticXInUsdcConfiguratorInfo.priceFeed).to.eq(minPricePriceFeed);
expect(await usdcComet.getPrice(minPricePriceFeed)).to.equal(1);

expect(maticXInUsdcCometInfo.supplyCap).to.eq(0);
expect(maticXInUsdcConfiguratorInfo.supplyCap).to.eq(0);

expect(maticXInUsdcCometInfo.borrowCollateralFactor).to.eq(0);
expect(maticXInUsdcConfiguratorInfo.borrowCollateralFactor).to.eq(0);

// USDT
const usdtComet = new Contract(
USDT_COMET,
[
'function getAssetInfoByAddress(address) external view returns(tuple(uint8 offset, address asset, address priceFeed, uint64 scale, uint64 borrowCollateralFactor, uint64 liquidateCollateralFactor, uint64 liquidationFactor, uint128 supplyCap))',
'function getPrice(address priceFeed) view returns (uint256)',
],
await deploymentManager.getSigner()
);

const maticXIndexInUsdtComet = await configurator.getAssetIndex(usdtComet.address, MaticX.address);

const maticXInUsdtCometInfo = await usdtComet.getAssetInfoByAddress(MaticX.address);
const maticXInUsdtConfiguratorInfo = (await configurator.getConfiguration(usdtComet.address)).assetConfigs[maticXIndexInUsdtComet];

expect(maticXInUsdtCometInfo.priceFeed).to.eq(minPricePriceFeed);
expect(maticXInUsdtConfiguratorInfo.priceFeed).to.eq(minPricePriceFeed);
expect(await usdtComet.getPrice(minPricePriceFeed)).to.equal(1);

expect(maticXInUsdtCometInfo.supplyCap).to.eq(0);
expect(maticXInUsdtConfiguratorInfo.supplyCap).to.eq(0);

expect(maticXInUsdtCometInfo.borrowCollateralFactor).to.eq(0);
expect(maticXInUsdtConfiguratorInfo.borrowCollateralFactor).to.eq(0);
},
});
Loading