-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conversation
- [ ] 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)) |
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.
How did you get to these L1 addresses?
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.
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.
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.
Wow - it was quite an effort to follow all these steps 😂
- Identify you needed DATA_PROVIDER_ROLE to be able to update the data
- Check transactions to find a
grantRole
to0x212871A1C235892F86cAB30E937e18c94AEd8474
- See that it has an l1Authority (that shows up as EOA on Base)
- Check for that same address on L1 to see it has a contract implementation
- 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 🙏
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.
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** |
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.
Should we start using USABLE
/UNUSABLE
instead of SAFE
/UNSAFE
?
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.
I think using USABLE/UNUSABLE is more appropriate wording
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.
LGTM thanks for all the explanation surrounding the bridged rate from mainnet! 🙏
Fixes #233