Skip to content

Optimism testnet deployment#710

Merged
kevincheng96 merged 13 commits intosilver/optimism-deploymentfrom
silver/optimism-deployment-testnet
Apr 5, 2023
Merged

Optimism testnet deployment#710
kevincheng96 merged 13 commits intosilver/optimism-deploymentfrom
silver/optimism-deployment-testnet

Conversation

@scott-silver
Copy link
Copy Markdown
Contributor

@scott-silver scott-silver commented Mar 8, 2023

This PR creates the deploy script for deploying Comet on Optimism-Goerli. Most of the supported assets will be existing ones Optimism-Goerli that can be bridged over from their Goerli counterparts. The only ERC20 that we clone is OP, only because the OP on testnet is not source-able (there is no public faucet).

This PR also includes various fixes to get scenarios for Optimism working E2E.

@jflatow jflatow force-pushed the silver/optimism-deployment branch from 37f15fb to 6695f95 Compare March 8, 2023 19:12
@jflatow jflatow force-pushed the silver/optimism-deployment-testnet branch 2 times, most recently from 4832a27 to 9121419 Compare March 8, 2023 19:27
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment branch from c33bd5f to 85703cf Compare March 16, 2023 20:38
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch from 9121419 to f56bddd Compare March 16, 2023 22:09
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment branch from 85703cf to 476908a Compare March 21, 2023 18:25
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch 2 times, most recently from 5c34177 to fcde1d6 Compare March 21, 2023 18:33
},
"assets": {
"OP": {
"priceFeed": "0xE882831E58eec48B7f304482771F67e6b846733D",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We use the APE / USD price feed because there is no OP / USD price feed on Optimism-Goerli. Shouldn't a big deal.

Comment on lines +27 to +42
const USDC = await deploymentManager.existing(
'USDC',
'0x7E07E15D2a87A24492740D16f5bdF58c16db0c4E',
'optimism-goerli'
);
const WETH = await deploymentManager.existing(
'WETH',
'0x4200000000000000000000000000000000000006',
'optimism-goerli'
);
const WBTC = await deploymentManager.existing(
'WBTC',
'0xe0a592353e81a94Db6E3226fD4A99F881751776a',
'optimism-goerli',
'contracts/ERC20.sol:ERC20'
);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

USDC and WBTC are assets bridged from goerli. The goerli USDC is used in our goerli cUSDCv3 market, but the goerli WBTC is different from the one we use there (we cloned our own). But looks like there's a faucet for WBTC on goerli so should be fine.

},

// Canonical L2 WBTC is not verified on Etherscan
'0xe0a592353e81a94db6e3226fd4a99f881751776a': {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The WBTC on Optimism-Goerli is not verified, so we use this trick to get the artifacts locally.

'WBTC',
'0xe0a592353e81a94Db6E3226fD4A99F881751776a',
'optimism-goerli',
'contracts/ERC20.sol:ERC20'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I added an extra optional param to dm.existing to pass in an artifact for contracts that aren't verified on Etherscan.

address: string,
deployArgs: any[],
fromNetwork = 'mainnet',
fromNetwork = 'mainnet', // XXX maybe we should default to the network of the deployment manager
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on this? It always feels weird when we don't specify this arg and it pulls from mainnet even though that is usually not the intention.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or just make this arg required without a default value.

@scott-silver
Copy link
Copy Markdown
Contributor Author

I can't approve since I opened the original PR, but this looks good to me

@kevincheng96 kevincheng96 changed the title [DRAFT] WIP Optimism testnet deploy Optimism testnet deployment Mar 22, 2023
@kevincheng96 kevincheng96 added the deployment This PR contains a new deployment label Mar 22, 2023
@kevincheng96 kevincheng96 marked this pull request as ready for review March 22, 2023 21:50
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch from 6ca8d8f to 3ff7466 Compare March 31, 2023 23:46
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment branch from 476908a to 3362bdf Compare March 31, 2023 23:48
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch from 3ff7466 to 09b1f81 Compare March 31, 2023 23:48
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment branch from 3362bdf to c41ed35 Compare April 4, 2023 17:07
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch from 09b1f81 to c920060 Compare April 4, 2023 17:16
kevincheng96 and others added 4 commits April 4, 2023 10:27
* Add logs when executing a bridged proposal

* Add new regex to custom error checker

* Use separate Etherscan API key for optimism

* Add USDC whale for optimism-goerli

* Add revert error message for WETH

* More scenario fixes

* Fix remaining scenario errors

* Add case for optimism-goerli to createCrossChainProposal

* Add optimism etherscan key to forge test job
…ls (#728)

We deploy Comet to Optimism-Goerli and update the roots in this PR. This PR also improves the deploy step by allowing us to recover the `VerifyArgs` if a deploy job fails mid-deploy. This also includes a fix for verifying contracts in Optimism-Goerli.

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Jared Flatow <jflatow@gmail.com>
@kevincheng96 kevincheng96 force-pushed the silver/optimism-deployment-testnet branch from c920060 to b3f9345 Compare April 4, 2023 17:29
@kevincheng96
Copy link
Copy Markdown
Contributor

kevincheng96 commented Apr 5, 2023

Re-deployed the contracts because the Timelock on the old set of contracts were not using testnet parameters, so they had a much longer delay. The min settable delay was half a day.

Re-deployed in this job https://github.com/compound-finance/comet/actions/runs/4613396364/jobs/8155329637

This PR creates the Optimism-Goerli migration script for launching cUSDCv3. This PR also updates the Optimism message-passing bridge relayer logic in our scenarios so we can test token bridging using scenarios.

Proposal 70 created and executed: https://goerli.etherscan.io/tx/0x6defeea621b4778cfab509ea5ed5ce2ed4da78535dc75e787312b78413e88aaf

Execution of proposal on Optimism Goerli: https://goerli-optimism.etherscan.io/tx/0x465b0e6863afeb1640336b6843b4b03ce51a13b01cae51f04638cd4054a41392

---------

Co-authored-by: GitHub Actions Bot <>
@kevincheng96
Copy link
Copy Markdown
Contributor

Should be ready to merge into #613 now.

Copy link
Copy Markdown
Contributor

@jflatow jflatow left a comment

Choose a reason for hiding this comment

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

💪

@kevincheng96 kevincheng96 merged commit 83d054c into silver/optimism-deployment Apr 5, 2023
@kevincheng96 kevincheng96 deleted the silver/optimism-deployment-testnet branch April 5, 2023 18:21
@kevincheng96 kevincheng96 mentioned this pull request Apr 5, 2023
18 tasks
kevincheng96 added a commit that referenced this pull request May 22, 2023
* Optimism testnet deploy

* WIP

* Allow `existing` to merge into a proxy and use for optimism-goerli

* Fix cross-chain scenario by passing in gasLimit from the L1 txn

* Update deploy and bump hardhat

* Fix Optimism scenarios (#721)

* Add logs when executing a bridged proposal

* Add new regex to custom error checker

* Use separate Etherscan API key for optimism

* Add USDC whale for optimism-goerli

* Add revert error message for WETH

* More scenario fixes

* Fix remaining scenario errors

* Add case for optimism-goerli to createCrossChainProposal

* Add optimism etherscan key to forge test job

* Update collateral assets and deploy script

* Update WBTC supply cap decimals

* Deploy Comet to Optimism-Goerli and upload VerifyArgs when deploy fails (#728)

We deploy Comet to Optimism-Goerli and update the roots in this PR. This PR also improves the deploy step by allowing us to recover the `VerifyArgs` if a deploy job fails mid-deploy. This also includes a fix for verifying contracts in Optimism-Goerli.

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Jared Flatow <jflatow@gmail.com>

* Update timelock constructor params in deploy script

* Remove roots for re-deploy

* Modified deployment roots from GitHub Actions

* Optimism-Goerli proposal (#726)

This PR creates the Optimism-Goerli migration script for launching cUSDCv3. This PR also updates the Optimism message-passing bridge relayer logic in our scenarios so we can test token bridging using scenarios.

Proposal 70 created and executed: https://goerli.etherscan.io/tx/0x6defeea621b4778cfab509ea5ed5ce2ed4da78535dc75e787312b78413e88aaf

Execution of proposal on Optimism Goerli: https://goerli-optimism.etherscan.io/tx/0x465b0e6863afeb1640336b6843b4b03ce51a13b01cae51f04638cd4054a41392

---------

Co-authored-by: GitHub Actions Bot <>

---------

Co-authored-by: Jared Flatow <jflatow@gmail.com>
Co-authored-by: kevincheng96 <kevincheng96@hotmail.com>
Co-authored-by: GitHub Actions Bot <>
kevincheng96 added a commit that referenced this pull request Jun 1, 2023
* Optimism testnet deploy

* WIP

* Allow `existing` to merge into a proxy and use for optimism-goerli

* Fix cross-chain scenario by passing in gasLimit from the L1 txn

* Update deploy and bump hardhat

* Fix Optimism scenarios (#721)

* Add logs when executing a bridged proposal

* Add new regex to custom error checker

* Use separate Etherscan API key for optimism

* Add USDC whale for optimism-goerli

* Add revert error message for WETH

* More scenario fixes

* Fix remaining scenario errors

* Add case for optimism-goerli to createCrossChainProposal

* Add optimism etherscan key to forge test job

* Update collateral assets and deploy script

* Update WBTC supply cap decimals

* Deploy Comet to Optimism-Goerli and upload VerifyArgs when deploy fails (#728)

We deploy Comet to Optimism-Goerli and update the roots in this PR. This PR also improves the deploy step by allowing us to recover the `VerifyArgs` if a deploy job fails mid-deploy. This also includes a fix for verifying contracts in Optimism-Goerli.

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Jared Flatow <jflatow@gmail.com>

* Update timelock constructor params in deploy script

* Remove roots for re-deploy

* Modified deployment roots from GitHub Actions

* Optimism-Goerli proposal (#726)

This PR creates the Optimism-Goerli migration script for launching cUSDCv3. This PR also updates the Optimism message-passing bridge relayer logic in our scenarios so we can test token bridging using scenarios.

Proposal 70 created and executed: https://goerli.etherscan.io/tx/0x6defeea621b4778cfab509ea5ed5ce2ed4da78535dc75e787312b78413e88aaf

Execution of proposal on Optimism Goerli: https://goerli-optimism.etherscan.io/tx/0x465b0e6863afeb1640336b6843b4b03ce51a13b01cae51f04638cd4054a41392

---------

Co-authored-by: GitHub Actions Bot <>

---------

Co-authored-by: Jared Flatow <jflatow@gmail.com>
Co-authored-by: kevincheng96 <kevincheng96@hotmail.com>
Co-authored-by: GitHub Actions Bot <>
kevincheng96 added a commit that referenced this pull request Jun 1, 2023
* Optimism Deployment

base configuration.json

add optimism values to etherscan.ts

relations

base relayPolygonMessage

add isBridgeProposal

rename to relayOptimismMessage

add optimismL1CrossDomainMessenger to mainnet/usdc deploy

partial relayOptimismMessage impl

relayOptimismMessage impl cont'd

optimism deploy script

complete relayOptimismMessage impl

bump supply caps

rename iface

applyL1ToL2Alias helper

bridge receiver contract

add crossDomainMessenger arg to constructor in deplooy.ts

add scenario, matchesDeployment helper

reuse CROSS_DOMAIN_MESSENGER

lint

update Github Actions

update asset information

* Incorporate Optimism audit feedback (#699)

update comment in Optimism deploy script

update Bulker path

I for Interface

Optimism deployment misc fixes (#701)

* WETH whale

* add optimismL1CrossDomainManager to roots

* Optimism testnet deployment (#710)

* Optimism testnet deploy

* WIP

* Allow `existing` to merge into a proxy and use for optimism-goerli

* Fix cross-chain scenario by passing in gasLimit from the L1 txn

* Update deploy and bump hardhat

* Fix Optimism scenarios (#721)

* Add logs when executing a bridged proposal

* Add new regex to custom error checker

* Use separate Etherscan API key for optimism

* Add USDC whale for optimism-goerli

* Add revert error message for WETH

* More scenario fixes

* Fix remaining scenario errors

* Add case for optimism-goerli to createCrossChainProposal

* Add optimism etherscan key to forge test job

* Update collateral assets and deploy script

* Update WBTC supply cap decimals

* Deploy Comet to Optimism-Goerli and upload VerifyArgs when deploy fails (#728)

We deploy Comet to Optimism-Goerli and update the roots in this PR. This PR also improves the deploy step by allowing us to recover the `VerifyArgs` if a deploy job fails mid-deploy. This also includes a fix for verifying contracts in Optimism-Goerli.

---------

Co-authored-by: GitHub Actions Bot <>
Co-authored-by: Jared Flatow <jflatow@gmail.com>

* Update timelock constructor params in deploy script

* Remove roots for re-deploy

* Modified deployment roots from GitHub Actions

* Optimism-Goerli proposal (#726)

This PR creates the Optimism-Goerli migration script for launching cUSDCv3. This PR also updates the Optimism message-passing bridge relayer logic in our scenarios so we can test token bridging using scenarios.

Proposal 70 created and executed: https://goerli.etherscan.io/tx/0x6defeea621b4778cfab509ea5ed5ce2ed4da78535dc75e787312b78413e88aaf

Execution of proposal on Optimism Goerli: https://goerli-optimism.etherscan.io/tx/0x465b0e6863afeb1640336b6843b4b03ce51a13b01cae51f04638cd4054a41392

---------

Co-authored-by: GitHub Actions Bot <>

---------

Co-authored-by: Jared Flatow <jflatow@gmail.com>
Co-authored-by: kevincheng96 <kevincheng96@hotmail.com>
Co-authored-by: GitHub Actions Bot <>

* Fix comment

* Support Base Goerli

* Address feedback for Base Goerli

* Remove all codepaths related to Optimism Mainnet

* Add cbETH as collateral asset and set supply caps to 0 for deploy

* Formatting

* Re-order asset configuration because WETH being the first asset breaks the bulker scenario

* Modified deployment roots from GitHub Actions

* Update configuration for pause guardian and supply caps; check diffState in proposal

* Modified migration from GitHub Actions

---------

Co-authored-by: Scott Silver <scott@compound.finance>
Co-authored-by: Jared Flatow <jflatow@gmail.com>
Co-authored-by: GitHub Actions Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deployment This PR contains a new deployment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants