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

OETH L2 Base plugin #1223

Closed
wants to merge 7 commits into from
Closed

Conversation

clement-ux
Copy link

  • OETH plugin and tests for L2 Base.

@tbrent tbrent changed the base branch from master to 4.0.0 November 6, 2024 09:32
@tbrent tbrent marked this pull request as ready for review November 6, 2024 09:39
@tbrent tbrent closed this Nov 6, 2024
This was referenced Nov 6, 2024

/// @return {ref/tok} Quantity of whole reference units per whole collateral tokens
/// {superOETHb/wsuperOETHb}
function underlyingRefPerTok() public view override returns (uint192) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

could delete this function entirely if you change the inheritance to ERC4626FiatCollateral

{
// {tar/tok}
// {ETH/wsuperOETHb}
uint192 targetPerTok = _safeWrap(targetPerTokChainlinkFeed.price()) / 1e18;
Copy link
Collaborator

@tbrent tbrent Nov 6, 2024

Choose a reason for hiding this comment

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

nit: should probably move the paren outside the 1e18 to minimize overflow risk


/// @param config.chainlinkFeed - ignored
/// @param config.oracleTimeout - ignored
/// @param config.oracleError {1} Should be the oracle error for UoA/tok
Copy link
Collaborator

Choose a reason for hiding this comment

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

this should be the combined oracle error I think, since it is applied post-product

Copy link
Author

Choose a reason for hiding this comment

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

Nice catch, indeed. I remove the comment then 👍

wsuperOETHb_ETH: bn(86400),
ETH_USD: bn(1200),
}
export const BASE_ORACLE_ERROR = combinedError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

what are these 3 errors being added? I was only expecting 2 of them, one per oracle

Copy link
Author

Choose a reason for hiding this comment

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

Thanks, adjusted 👍


// {tar/ref} = {tar/tok} / {ref/tok} Get current market peg
// ETH/superOETHb = ETH/wsuperOETHb / superOETHb/wsuperOETHb
pegPrice = targetPerTok.div(underlyingRefPerTok());
Copy link
Collaborator

Choose a reason for hiding this comment

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

could do pegPrice = FIX_ONE if these are both operating on the same underlying information

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.

2 participants