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

Create sUSDS Rate Provider on Base #254

Merged
merged 1 commit into from
Feb 4, 2025
Merged

Create sUSDS Rate Provider on Base #254

merged 1 commit into from
Feb 4, 2025

Conversation

mkflow27
Copy link
Collaborator

Fixes #233

@mkflow27 mkflow27 marked this pull request as ready for review January 31, 2025 09:53
@mkflow27 mkflow27 requested a review from brunoguerios January 31, 2025 09:54
- [ ] The Rate Provider is upgradeable (e.g., via a proxy architecture or an `onlyOwner` function that updates the price source address).

- [x] Some other portion of the price pipeline is upgradeable (e.g., the token itself, an oracle, or some piece of a larger system that tracks the price).
- upgradeable component: `SUsds` ([ethereum:0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD](https://etherscan.io/address/0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD#readProxyContract))
Copy link
Member

Choose a reason for hiding this comment

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

How did you get to these L1 addresses?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You can see that an onlyRole(DATA_PROVIDER_ROLE) can call a function that does

function _setSUSDSData(ISSROracle.SUSDSData memory nextData) internal {
    _data = nextData;

    emit SetSUSDSData(nextData);
}

The upgrader is deployed at: https://basescan.org/address/0x212871A1C235892F86cAB30E937e18c94AEd8474#code and has an l1Authority. You can investigate the refresh method there and see that it reads from the susds contract and bridges it.

Copy link
Member

@brunoguerios brunoguerios Feb 3, 2025

Choose a reason for hiding this comment

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

Wow - it was quite an effort to follow all these steps 😂

  1. Identify you needed DATA_PROVIDER_ROLE to be able to update the data
  2. Check transactions to find a grantRole to 0x212871A1C235892F86cAB30E937e18c94AEd8474
  3. See that it has an l1Authority (that shows up as EOA on Base)
  4. Check for that same address on L1 to see it has a contract implementation
  5. See that its implementation has an l2Oracle that points to the data provider of the L2

I think I got the whole flow 👍
Thanks for explaining 🙏

Copy link
Member

Choose a reason for hiding this comment

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

Ps: at first I didn't know the keccak transformation of DATA_PROVIDER_ROLE was available within the Read Contract tab, but I just learned that it's trivial to generate that using cast keccak DATA_PROVIDER_ROLE from foundry



## Conclusion
**Summary judgment: USABLE**
Copy link
Member

Choose a reason for hiding this comment

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

Should we start using USABLE/UNUSABLE instead of SAFE/UNSAFE?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think using USABLE/UNUSABLE is more appropriate wording

Copy link
Member

@MattPereira MattPereira left a comment

Choose a reason for hiding this comment

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

LGTM thanks for all the explanation surrounding the bridged rate from mainnet! 🙏

@mkflow27 mkflow27 merged commit 82dacc9 into main Feb 4, 2025
1 check passed
@brunoguerios brunoguerios deleted the mkflow27/issue233 branch February 4, 2025 13:13
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.

Create sUSDS Rate Provider on Base
3 participants