-
Notifications
You must be signed in to change notification settings - Fork 0
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 WETH market on Optimism #18
base: main
Are you sure you want to change the base?
Conversation
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) { | ||
priceFeedA = priceFeedA_; | ||
priceFeedB = priceFeedB_; | ||
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals(); | ||
priceFeedAScalling = signed256(10 ** (priceFeedADecimals)); | ||
|
||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
priceFeedScale = int256(10 ** decimals); | ||
} |
Check warning
Code scanning / Semgrep OSS
There're no sanity checks for the constructor argument description_. Warning
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) { | ||
priceFeedA = priceFeedA_; | ||
priceFeedB = priceFeedB_; | ||
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals(); | ||
priceFeedAScalling = signed256(10 ** (priceFeedADecimals)); | ||
|
||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
priceFeedScale = int256(10 ** decimals); | ||
} |
Check warning
Code scanning / Semgrep OSS
There're no sanity checks for the constructor argument priceFeedA_. Warning
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) { | ||
priceFeedA = priceFeedA_; | ||
priceFeedB = priceFeedB_; | ||
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals(); | ||
priceFeedAScalling = signed256(10 ** (priceFeedADecimals)); | ||
|
||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
priceFeedScale = int256(10 ** decimals); | ||
} |
Check warning
Code scanning / Semgrep OSS
There're no sanity checks for the constructor argument priceFeedB_. Warning
constructor(address priceFeedA_, address priceFeedB_, uint8 decimals_, string memory description_) { | ||
priceFeedA = priceFeedA_; | ||
priceFeedB = priceFeedB_; | ||
uint8 priceFeedADecimals = AggregatorV3Interface(priceFeedA_).decimals(); | ||
priceFeedAScalling = signed256(10 ** (priceFeedADecimals)); | ||
|
||
if (decimals_ > 18) revert BadDecimals(); | ||
decimals = decimals_; | ||
description = description_; | ||
priceFeedScale = int256(10 ** decimals); | ||
} |
Check warning
Code scanning / Semgrep OSS
Consider making costructor payable to save gas. Warning
const ENSTextRecordKey = 'v3-official-markets'; | ||
const opCOMPAddress = '0x7e7d4467112689329f7E06571eD0E8CbAd4910eE'; | ||
|
||
const wethAmountToBridge = exp(500, 18); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
figure out from Gauntlet
|
||
const description = '# Initialize cWETHv3 on Optimism\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes deployment of Compound III to the Optimism network. This proposal takes the governance steps recommended and necessary to initialize a Compound III WETH market on Optimism; upon execution, cWETHv3 will be ready for use. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/add-market-eth-on-optimism/5274/5).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/865), [deploy market GitHub action run]() and [forum discussion](https://www.comp.xyz/t/add-market-eth-on-optimism/5274).\n\n\n## Proposal Actions\n\nThe first action sends mainnet ETH to Arbitrum’s Timelock in order to transfer it to the new Comet and thus seed the market reserves.\n\nThe second proposal action sets the Comet configuration and deploys a new Comet implementation on Optimism. This sends the encoded `setFactory`, `setConfiguration`, `deployAndUpgradeTo` calls across the bridge to the governance receiver on Optimism. It also calls `setRewardConfig` on the Optimism rewards contract, to establish Optimism’s bridged version of COMP as the reward token for the deployment and set the initial supply speed to be 4 COMP/day and borrow speed to be 3 COMP/day. Also it wraps received ETH and transfers it to the new Comet.\n\nThe third action updates the ENS TXT record `v3-official-markets` on `v3-additional-grants.compound-community-licenses.eth`, updating the official markets JSON to include the new Arbitrum cUSDCv3 market.'; | ||
const txn = await govDeploymentManager.retry(async () =>{ | ||
// console.log('in TXN', actions) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
No description provided.