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

Base Market Deployments #110

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Base Market Deployments #110

wants to merge 8 commits into from

Conversation

junkim012
Copy link
Collaborator

@junkim012 junkim012 commented Jul 1, 2024

Overview

  • For deploying the weETH/WETH market on base.
  • The SpotOracle reads from the Chainlink weETH marker price oracle denominated in ETH.
  • The ReserveOracle reads from the Chainlink weETH exchange rate oracle denominated in WETH.
  • Tests were added to previous abstract test contracts for SpotOracle and ReserveOracle.

TODOs

  • Deployment scripts for weETH/WETH
  • WeEthWethSpotOracle and WeEthWethReserveOracle that uses Base feeds and checks for Base sequencer downtime via Chainlink.
  • Tests for all new contracts.

Important Changes

  • The WeEthWethSpotOracle also checks if the sequencer is down.

  • The UniswapFlashloanBalancerSwap contract used to always assume that the base asset of the IonPool it is being used on is mainnet WETH, imported from the Constants.sol file.

    • To make this work for base deployment, the contract was modified to use the BASE variable set from ionPool.underlying() which in the base deployment will be the base WETH.
  • Optimizer to 200 to avoid contract size limit violation

  • 98e624e

    • New commit that changes the strategy contracts to take in WETH address as a constructor arg instead of a constant.

@junkim012 junkim012 closed this Jul 1, 2024
@junkim012 junkim012 reopened this Jul 1, 2024
@junkim012 junkim012 requested review from CarsonCase and jpick713 July 1, 2024 20:17
Copy link

openzeppelin-code bot commented Jul 1, 2024

weETH/WETH Base Market Deployment

Generated at commit: d1204b5a83b20db2b366ea894d9b6bee6094a104

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
12
40
56
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

Copy link

@jpick713 jpick713 left a comment

Choose a reason for hiding this comment

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

lgtm, just maybe review the sequencer feed checks

src/Constants.sol Show resolved Hide resolved
junkim012 added 3 commits July 3, 2024 01:35
…hereum mainnet WETH address.

test: refactor tests to enable fork rpc overrides
@junkim012 junkim012 requested a review from jpick713 July 3, 2024 06:06
Copy link

@CarsonCase CarsonCase left a comment

Choose a reason for hiding this comment

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

Looking good, just a little confusion in the _getUnderlying() function in test/helpers/handlers/IonHandlerForkBase.sol as it uses the mainnet WETH. Overall the differing WETH addresses are quite confusing and it may be worth using an immutable value in the handlers and passing it in as a config value

Choose a reason for hiding this comment

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

Do you think it would be worth making weth an immutable value and passing the address in as a constructor arg?

I think it's a bit dangerous leaving this to be hardcoded when deploying on BASE vs other networks

Choose a reason for hiding this comment

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

I tried looking into if Uniswap has a WETH() function too, and unfortunately in V3 it does not

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The IonHandlerBase now takes in weth as a constructor arg to set it as an immutable.

test/helpers/handlers/IonHandlerForkBase.sol Show resolved Hide resolved
…d of importing the mainnet WETH address as a constant
@junkim012 junkim012 requested review from CarsonCase and jpick713 July 3, 2024 23:40
@junkim012 junkim012 changed the title weETH/WETH Base Market Deployment Base Market Deployments Jul 23, 2024
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