Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy and initialize native USDC market on Arbitrum #769

Merged
merged 51 commits into from
Sep 12, 2023

Conversation

cwang25
Copy link
Contributor

@cwang25 cwang25 commented Jun 22, 2023

This PR introduces the deployment for USDC Native on Arbitrum as well as the proposal to initialize the market there.

This PR also rename existing usdc to usdc.e to distinguish from bridged usdc and native usdc

Note: when this PR only has deploy scripts (when migration PR hasn't merged into this PR yet), the scenario will fail as the existing market has already transfer ownership to the timelock, thus the scenario tests will fail for not being able to upgrade the comet. But it will be resolved after migration PR is in place, which will upgrade the contracts via DAO's proposal.)

Reference: https://github.com/compound-finance/comet/pull/769/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

TODO:

  • deploy arbitrum native USDC instance
  • run market initialization proposal
  • run attestation script to mint native USDC on Arbitrum

@cwang25 cwang25 marked this pull request as ready for review June 22, 2023 19:12
src/deploy/index.ts Outdated Show resolved Hide resolved
@kevincheng96
Copy link
Contributor

Great work so far 👏

@cwang25 cwang25 changed the title Arbitrum deploy and migration for usdc native Deploy usdc native market to Arbitrum Jul 19, 2023
cwang25 pushed a commit that referenced this pull request Jul 20, 2023
kevincheng96 added a commit that referenced this pull request Jul 21, 2023
* Deploy Arbitrum goerli for usdc native (#778)

* initial gen

* remove files

* rename directory

* add scenario

* upadte deploy script

* renamde to usdc.n

* added relations for scenario test

* add scenario test to CI

* add migration scrtips, but just changed the USDC reference address

* update migration script

* since it's native, we shouldn't need usdc bridge things in migration

* try to fix the liquidator scenario errors

* intent

* change those to be 0 initially

* FINALLY scneario passed :D

* don't re-deploy bulker

* set a number in configuration to make bulker tests pass

* set configuration to 0 supply cap for initialization, although it will fail the bulker test

* update liquidity pool to use the one with better liquidity

* after new pool use better liquidity, now able to bump up the volume

* remove v2 rewards config step, crank down borrowMin

* update migration description

* remove trailing newline

* ok need to referencing existing rewards in deploy script to share the rewards'

* naming changes

* added cctp contracts address to roots and update relayArbitrummessage

* add l2 cctp

* depositForBurn() to use CCTP to send native USDC to arbitrum comet

* finally relayArbitrum works with CCTP

* format

* update to turn off bridge market's reward speed

* fix scenarios and slightly reduced volume in liquidator scenarios (somehow during testing the pool the bot uses to flashloan have been withdrew and don't have full liquidity to cover tests

* now it has just enough liquidity to pass the test, reverted the liquidation scenario back to usual amount

* address comments: remove network prefixes, move contract import from deploy to migration scripts, move relay specific contracts to relay script

* remove network prefixes, and rename bridgeComet to usdceComet

* rename/refactor usdc -> usdc.e, and usdc.n -> usdc. Also rename deplyoment name for  to  and  to

* luckily by the time of testing now Jul 6th 1:40PM PST, we have enough liquidity in the uniswap USDC.e:USDC pool to cover the unchanged volume liquidation scenarios test

* rename usdc.n to usdc

* make yarn lint happy

* rename bridged version to .e to match with mainnet

* ported changes to testnet

* update on workflow

* hmm the error is gone

* change default supply reward speed on new comet to be 0

* move migration steps out of this branch

* add readme.md to corner cases when deploy new market on the chain with an existing market already

* add line

* removed USDC in relations

* update version to unblock deploy workerflow for now

* use dummy requested_network id

* try arbitrum goerli network id right away

* change a bit on how it locates the hardhat config base

* remove hardcoded network chain-id

* no more manual wallet project id input

* use env.GOV_NETWORK

* GOV_NETWORK got some errors :[

* try this seacrest with fixes

* try new seacrest :D

* Modified deployment roots from GitHub Actions

* Migrate Arbitrum Goerli Native usdc (#779)

* migration scripts commits

* set supply and borrow speeds to be non zero

* add diff check

* add diff checker

* added comments on checks

* now scenario run is passing, but with the cost of removing linea's contract addresses from goerli/roots.json

* add linea back, but scenario run will fail. But it's not related to arbitrum-goerli

* Upgrade git action to use new seacrest (#782)

* upgrade git action to use new seacrest

* Fix unverified Linea Goerli contract issue (#787)

* addressed comments

* first initial working version of CCTP attestation script to help check with circle attestation status to mint native USDC to destination

* attestation script with sending txn on user behalf

* fix lint

* fix lint

* Modified migration from GitHub Actions

---------

Co-authored-by: Kevin Cheng <[email protected]>
Co-authored-by: GitHub Actions Bot <>

* removed asdf config file that should've been ignored

* add native usdc whale for arbitrum goerli

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Kevin Cheng <[email protected]>

* revert some mixed up changes when extracted from #769

* fix name

* update reference path

* fix lint

* Update hardhat.config.ts

Co-authored-by: Kevin Cheng <[email protected]>

* Update hardhat.config.ts

Co-authored-by: Kevin Cheng <[email protected]>

* fix error

---------

Co-authored-by: Kevin Cheng <[email protected]>
Copy link
Contributor

@kevincheng96 kevincheng96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! This should be ready to be deployed once we see there's no big issues with scenario testing.

@cwang25
Copy link
Contributor Author

cwang25 commented Aug 16, 2023

⛑️ and I deployed comet to arbitrum via Deploy Market (https://github.com/compound-finance/comet/actions/runs/5884462049/job/15959206776)

The commit 427bbf5 is commited by the workflow.

* Revert "move migration files to separate PR, and keep this original one to be 'deploy' PR"

This reverts commit f1f9808.

* update configurate to meet with the feedback from testnet

* fix scenario test error and udpate migration to meet the latest official market list and prepare for the official launch

* update speed to 10COMP/day and update migration description

* uncommented state change verify, since comet has been deployed

* 10/86400 is irrationale number so it is 0.000115740740740 to be the closest value that falls within e15 limit

* fix migrations

* fix typo

* update description

* Modified migration from GitHub Actions

* Update deployments/arbitrum/usdc/migrations/1686953660_configurate_and_ens.ts

Co-authored-by: Kevin Cheng <[email protected]>

* removed comments

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Kevin Cheng <[email protected]>
@kevincheng96 kevincheng96 changed the title Deploy usdc native market to Arbitrum Deploy and initialize native USDC market on Arbitrum Aug 29, 2023
@cwang25 cwang25 merged commit 22cf923 into main Sep 12, 2023
23 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants