Conversation
4510c34 to
40cb1d8
Compare
51cecd7 to
3033151
Compare
5643713 to
37f15fb
Compare
37f15fb to
6695f95
Compare
| return `0x${(BigInt(address) + offset).toString(16)}`; | ||
| } | ||
|
|
||
| export default async function relayOptimismMessage( |
There was a problem hiding this comment.
In order to test the Optimism proposal (that we will eventually write), we need to add token bridging to this function like the Polygon relayer.
kevincheng96
left a comment
There was a problem hiding this comment.
Awesome work on this!
| "indexScale": "1e15", | ||
| "baseSupplySpeed": "0e15", | ||
| "baseBorrowSpeed": "0e15", | ||
| "baseMinForRewards": "1000000e6" |
There was a problem hiding this comment.
Think we'll lower this to 10,000.
| "OP": { | ||
| "address": "0x4200000000000000000000000000000000000042", | ||
| "priceFeed": "0x0D276FC14719f9292D5C1eA2198673d1f4269246", | ||
| "decimals": "18", | ||
| "borrowCF": 0.65, | ||
| "liquidateCF": 0.70, | ||
| "liquidationFactor": 0.93, | ||
| "supplyCap": "0e18" | ||
| }, | ||
| "WETH": { | ||
| "address": "0x4200000000000000000000000000000000000006", | ||
| "priceFeed": "0x13e3Ee699D1909E989722E753853AE30b17e08c5", | ||
| "decimals": "18", | ||
| "borrowCF": 0.775, | ||
| "liquidateCF": 0.825, | ||
| "liquidationFactor": 0.95, | ||
| "supplyCap": "0e18" | ||
| }, | ||
| "WBTC": { | ||
| "address": "0x68f180fcCe6836688e9084f035309E29Bf0A2095", | ||
| "priceFeed": "0x718A5788b89454aAE3A028AE9c111A29Be6c2a6F", | ||
| "decimals": "8", | ||
| "borrowCF": 0.70, | ||
| "liquidateCF": 0.75, | ||
| "liquidationFactor": 0.95, | ||
| "supplyCap": "0e18" | ||
| } |
There was a problem hiding this comment.
Just a note that we still need to get risk parameters from Gauntlet.
|
|
||
| const secondsPerDay = 24 * 60 * 60; | ||
|
|
||
| const CROSS_DOMAIN_MESSENGER = "0x4200000000000000000000000000000000000007"; |
| const secondsPerDay = 24 * 60 * 60; | ||
|
|
||
| const CROSS_DOMAIN_MESSENGER = "0x4200000000000000000000000000000000000007"; | ||
| const MAINNET_TIMELOCK = '0x6d903f6003cca6255d85cca4d3b5e5146dc33925'; |
There was a problem hiding this comment.
You can pull this in using dm.fromDep.
| 2 * secondsPerDay, // delay | ||
| 14 * secondsPerDay, // grace period | ||
| 2 * secondsPerDay, // minimum delay | ||
| 30 * secondsPerDay // maxiumum delay |
There was a problem hiding this comment.
Think we should use the same values as we did for the Polygon deploy. And we could name the constants the same as we did there (DAY/HOUR).
| // Deploy Bulker | ||
| const bulker = await deploymentManager.deploy( | ||
| 'bulker', | ||
| 'bulkers/BaseBulker.sol', |
There was a problem hiding this comment.
We might want to use the MainnetTimelock to have wstETH support since I think Lido is making a push on Optimism. We could also switch the Bulker when/if we do a ETH deploy.
scenario/utils/isBridgeProposal.ts
Outdated
| case 'optimism': { | ||
| const governor = await governanceDeploymentManager.getContractOrThrow('governor'); | ||
| const optimismL1CrossDomainMessenger = await governanceDeploymentManager.getContractOrThrow('optimismL1CrossDomainMessenger'); | ||
| const { targets } = await governor.getActions(openProposal.id); | ||
| return targets.includes(optimismL1CrossDomainMessenger.address); | ||
| } |
There was a problem hiding this comment.
We should also support token bridging, which would call into the L1StandardBridge.
| // listen on events on the OptimismL1CrossDomainMessenger | ||
| const sentMessageListenerPromise = new Promise((resolve, reject) => { | ||
| const filter = { | ||
| address: optimismL1CrossDomainMessenger.address, | ||
| topics: [functionIdentifier('SentMessage(address,address,bytes,uint256,uint256)')] | ||
| }; | ||
|
|
||
| governanceDeploymentManager.hre.ethers.provider.on(filter, (log) => { | ||
| resolve(log); | ||
| }); | ||
|
|
||
| setTimeout(() => { | ||
| reject(new Error('OptimismL1CrossDomainMessenger.SentMessage event listener timed out')); | ||
| }, EVENT_LISTENER_TIMEOUT); | ||
| }); |
There was a problem hiding this comment.
We can use ethers.provider.getLogs to avoid the complexities of setting up our own listener with a timeout. Similar to how we do it for relaying Polygon messages.
There was a problem hiding this comment.
agreed; the Polygon version is much improved over this iteration. we should rework this to incorporate those improvements
| return `0x${(BigInt(address) + offset).toString(16)}`; | ||
| } | ||
|
|
||
| export default async function relayOptimismMessage( |
|
Here's our PR for adding COMP to Optimism (only to Optimism-goerli for now, we still have to deploy the token on Optimism mainnet): ethereum-optimism/ethereum-optimism.github.io#294 |
scenario/GovernanceScenario.ts
Outdated
|
|
||
| const sendMessageCalldata = utils.defaultAbiCoder.encode( | ||
| ['address', 'bytes', 'uint32'], | ||
| [bridgeReceiver.address, l2ProposalData, 1000000] |
There was a problem hiding this comment.
We need to be careful about calculating the gasLimit param and make sure that it's sufficient for the L2 txn. Also, I wonder what happens if the gasLimit we set is too low. Logically, the L2 transaction would fail but I don't see it covered in the docs.
85703cf to
476908a
Compare
3362bdf to
c41ed35
Compare
|
Merged the testnet branch #710 into this branch since testnet has been deployed and initialized and is ready to be used. |
| "rewardTokenAddress": "0x6AF3cb766D6cd37449bfD321D961A61B0515c1BC", | ||
| "assets": { | ||
| "OP": { | ||
| "priceFeed": "0xE882831E58eec48B7f304482771F67e6b846733D", |
There was a problem hiding this comment.
Trying to populating infos into c3-api to start supporting optimism. But it seems we're missing OP's address here 🤔 ? Is it '0x4200000000000000000000000000000000000042' ?
(Just checked on testnet, it seems it's also this address, but wanted to double check :) )
There was a problem hiding this comment.
Yes "0x4200000000000000000000000000000000000042" is the official address for OP on both Optimism testnet and mainnet. However, on testnet, we've deployed our own OP token because there doesn't seem to be a public faucet for it and it would make using the testnet easier if we controlled the token supply. Our testnet OP token address is "0x32719c5e2e35909C8f42167315445e349e749E05".
Btw, if you are unsure which addresses we use on each chain for each deployment, you can use Spider to programmatically pull in all the relevant addresses for a deployment. See https://github.com/compound-finance/comet/tree/main#spider
There was a problem hiding this comment.
Got it thank you so much!! 🙏
|
|
||
| const secondsPerDay = 24 * 60 * 60; | ||
|
|
||
| const GOERLI_TIMELOCK = '0x8Fa336EB4bF58Cfc508dEA1B0aeC7336f55B1399'; |
There was a problem hiding this comment.
Curious if local timelock on optimism-goerli should be 'https://goerli-optimism.etherscan.io/address/0x4c8011724f2ece7b6ce4b13c90fe5036c9e1eb2d' instead of 0x8Fa336EB4bF58Cfc508dEA1B0aeC7336f55B1399 ? 🤔
Went to check 0x8Fa336EB4bF58Cfc508dEA1B0aeC7336f55B1399, but it got empty address.
There was a problem hiding this comment.
So this is the Ethereum Goerli timelock, not the Optimism Goerli timelock 😃
We hardcode it here because it is provided as a constructor arg to the BridgeReceiver, which needs to know what L1 contract messages should be coming from.
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
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 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 <>
c91bffc to
290aa30
Compare
Work-in-progress Optimism deployment
deployhard-code the newmainnet/USDCrootOptimism/USDCrootsrewardTokenAddresspauseGuardian