Increase amount of collaterals in Comet

Objectives

cWETHv3 Comet on Mainnet is getting close to the limit of collaterals and the changes we propose will fix that issue, and won’t have any effect on the rest of the protocol, since they only target one function in the Comet contract. Increasing the amount of collaterals directly in Comet is not possible, because the contract size reached maximum.

Solution

We propose to make some changes to how collateral’s addresses are stored in the Comet contract and for this we need to make some changes:

  1. Deploy new contract - AssetListFactory which will deploy new AssetList for each new Comet.
  2. AssetList contract will store the packed values for each asset in the Comet, it serves only one purpose: to store and return stored information, thus for new Comet or new inclusion in the Comet new AssetList has to be deployed.
  3. Remove packed asset values from the contract since it will be stored in the AssetList contract.
  4. Change the getAssetInfo function in the Comet to call the AssetList contract and return the result.

Scope of work

  1. Smart contract changes
  2. Create/update tests
  3. Update scenarios
  4. Create migration for on-chain proposal

Terms

Development will take from 2.5 to 3.5 weeks. The timeline does not include audit time.

Concerns

The timeline can slightly change due to update scenarios and deployment of additional smart contracts.

CTA

Looking forward to receiving feedback from the community.

3 Likes

24 collaterals initiative

Proposal - Compound

The initiative was renamed the 24-collaterals initiative. This is a protocol update, that unifies the version of Comet with the support of 24 collaterals in one market.

Delivery 1
Delivery 2

This forum post reflects the update of USDC/USDT/USDS markets on Mainnet.

Actions

  1. Run Slither. Fails. :x:. Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  2. Forge test. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  3. Gas Profiler. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  4. Scan. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  5. Scenario. :white_check_mark: Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  6. Unit tests. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  7. Eslint. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  8. Contract linter. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@d3522dc · GitHub
  9. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@d8ac7a5 · GitHub
  10. Enact migration - Enact Migration · woof-software/comet@370f22a · GitHub
3 Likes

Proposal 392 Review

OpenZeppelin reviewed proposal 392, compared deployed code to the scope of the Comet Asset Extension Migration Audit, and simulated enactment of the proposal. The following issues were identified:

  1. Unaudited Changes

The proposal was submitted to governance with unaudited changes. We confirmed those changes address and only address the report issues of the Comet Asset Extension Migration Audit.

  1. Incorrect Link

The link to “deploy market GitHub action run” found in the proposal actually links to the proposal instead.

1 Like

OpenZeppelin team provided the internal review for USDC/USDT/USDS migration on the previous week. By the deployment time, we fixed all the pointed issues in the report. To not waste time due to the governor update we decided to push the proposal. When we pushed the proposal, we received internal feedback, that everything seemed fine. If you have some concerns and we need to cancel the proposal, we will do it.

2 Likes

This post clarifies the continuous deployment of 24 collaterals. In this iteration, we deployed proposals to update WETH/wstETH on Mainnet, Optimism network, and Mantle network.

The networks that are required to be updated are Scroll, Arbitrum, and Base (not including the USDS market).

Assumption

  1. The PR is huge enough. This was made to speed up delivery and audit not to divide scope into small pieces.
  2. This PR already pushed a proposal to update USDC/USDT/USDS markets on Mainnet
  3. Due to the last Governor update, we updated the process of pushing proposals, however contracts and migration were not changed

PR with all the changes including 24 collaterals update - Сomet with extended asset list by MishaShWoof · Pull Request #904 · compound-finance/comet · GitHub

Common Actions

  1. Run Slither. Fails. :x:. Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  2. Forge test. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  3. Gas Profiler. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  4. Scan. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  5. Unit tests. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  6. Eslint. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  7. Contract linter. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@0707d18 · GitHub

WETH/wstETH on Mainnet Actions

  1. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@0707d18 · GitHub
  2. Enact. Success.:white_check_mark: Enact Migration · woof-software/comet@0707d18 · GitHub
  3. Scenario. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  4. Proposal - Tally | Compound | Update WETH and wstETH Comets on Mainnet to support more collaterals

cometFactoryWithExtendedAssetList - 0xBa8F83ffFC7097CBcD89fe323D31753CfaC33867
newCometExtWETH - 0x16F3532e6AF45A2C51B6C77b1267cEF34A9cf3B3
newCometExtWstETH - 0x055E53F50B84FD91c4Be367220EFD36c3d091E1f
AssetListFactory - 0xEA2a6E7B41505d62d404F927F991Edc9E45883c2

Optimism Actions

  1. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@0707d18 · GitHub
  2. Enact. Success.:white_check_mark:Enact Migration · woof-software/comet@0707d18 · GitHub
  3. Scenario. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  4. Proposal - Tally | Compound | Update USDC, USDT and WETH Comets on Optimism to support more collaterals

cometFactoryWithExtendedAssetList - 0xd187F938348AA245E2104be8D849ea6d8d23f434
newCometExtUSDC - 0xadF7aD4Dd000Ea75667A3CDf65F3D3b7f1e9F02E
newCometExtUSDT - 0xdFb81f0EbFDfdd90143f5deBD1cd016b677d1585
newCometExtWETH - 0xc4aaFC9F0c52FDDa0fed972c55B136bD07552ad0
AssetListFactory - 0x2f7439252da796ab9a93f7e478e70ded43db5b89

Mantle Actions

  1. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@0707d18 · GitHub
  2. Enact. Success.:white_check_mark:Enact Migration · woof-software/comet@0707d18 · GitHub
  3. Scenario. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@0707d18 · GitHub
  4. Proposal - https://www.tally.xyz/gov/compound/proposal/398

cometFactoryWithExtendedAssetList - 0x292f807158B74cff1Bf584FA1E336AC30098C0F0
newCometExtUSDe - 0xe181D7e0D62dA9e575Fa043D8e681EbC7109acD3
AssetListFactory - 0x0dAf7A2772C84A82D1D46a4b628151e6D7F5b202

This document clarifies the continuous deployment of 24 collaterals. In this iteration, we deployed proposals to update Scroll, Arbitrum, and Base (not including the USDS market).

Assumption

  1. The PR is huge enough. This was made to speed up delivery and audit not to divide scope into small pieces.
  2. This PR already pushed a proposal to update Mainnet, Optimism, and Mantle.
  3. Due to the last Governor update, we updated the process of pushing proposals, however contracts and migration were not changed

PR with all the changes including 24 collaterals update - Сomet with extended asset list by MishaShWoof · Pull Request #904 · compound-finance/comet · GitHub

Common Actions

Actions

  1. Run Slither. Fails. :x:. Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  2. Forge test. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  3. Gas Profiler. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  4. Scan. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  5. Unit tests. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  6. Eslint. Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub
  7. Contract linter. Success.:white_check_mark: Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub

Scroll Actions

  1. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@a82a1b0 · GitHub
    2 . Enact. Success.:white_check_mark: Enact Migration · woof-software/comet@f0db6dd · GitHub
  2. Scenario. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub

Proposal - Tally | Compound | Update USDC Comet on Scroll to support more collaterals

cometFactoryWithExtendedAssetList - CometFactoryWithExtendedAssetList | Address 0x6f7d514bbd4aff3bcd1140b7344b32f063dee486 | Scrollscan
newCometExtUSDC - CometExtAssetList | Address 0x5ec955a4c15b195a4af9a61f7155f6fe3c1a0656 | Scrollscan
AssetListFactory - AssetListFactory | Address 0x5404872d8f2e24b230ec9b9ec64e3855f637fb93 | Scrollscan

Base Actions

  1. Prepare. Success.:white_check_mark: Prepare Migration · woof-software/comet@acd8af0 · GitHub
    2 . Enact. Success.:white_check_mark:Enact Migration · woof-software/comet@acd8af0 · GitHub
  2. Scenario. Success.:white_check_mark:Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub

Proposal - Tally | Compound | Update AERO, USDC, WETH and USDbC Comets on Base to support more collaterals

cometFactoryWithExtendedAssetList - 0x3D0bb1ccaB520A66e607822fC55BC921738fAFE3 (from USDS deployment)
newCometExtAERO -0xDd18688Bb75Af704f3Fb1183e459C4d4D41132D9
newCometExtUSDC - 0x220Da2686dC870aC0A97498A1845e610d2f13431
newCometExtUSDbC - 0x0E383794EaaA6Cf7Ffb2C8AD5BEbbBC5CB0F0A7b
newCometExtWETH - 0xbd4CfC08d64a848A9116A92Cd06D2f2bDC0a2505
AssetListFactory - 0x995e394b8b2437ac8ce61ee0bc610d617962b214 (from USDS deployment)

Arbitrum Actions

  1. Prepare. Success.:white_check_mark: - Prepare Migration · woof-software/comet@acd8af0 · GitHub
    2 . Enact. Success. [Should be run by delegator] - Enact Migration · woof-software/comet@acd8af0 · GitHub
  2. Scenario. Success.:white_check_mark: - Сomet with extended asset list · woof-software/comet@a82a1b0 · GitHub

Proposal - TBD

cometFactoryWithExtendedAssetList - 0x7dE363b6Bf0a892B94a1Cd0C9DF76826bFC14228
newCometExtUSDC - 0x95DeDD64b551F05E9f59a101a519B024b6b116E7
newCometExtUSDT - 0x271A200023c9512d37149dfbb62bf0F62a8D4680
newCometExtWETH - 0x0be923b1716115d742E35Fa359d415598c50510F
newCometExtUSDCe - 0x5D409e56D886231aDAf00c8775665AD0f9897b56
AssetListFactory - 0x17867848406f185cec6ba91142b15086f7399d85