-
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
Add rseth ezeth oracles #29
Conversation
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.
Small changes
src/EZETHExchangeRateOracle.sol
Outdated
function latestAnswer() external view returns (int256) { | ||
int256 ethUsd = ethSource.latestAnswer(); | ||
(, , uint256 tvl) = oracle.calculateTVLs(); | ||
int256 exchangeRate = int256(((tvl * 1e18) / ezETH.totalSupply())); |
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.
int256 exchangeRate = int256(((tvl * 1e18) / ezETH.totalSupply())); | |
( ,, uint256 tvl ) = oracle.calculateTVLs(); |
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.
These diffs are weird, but I think you wanted the spacing fixed on the return calculate tvls value. Changed.
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.
int256(tvl * 1e18 / ezETH.totalSupply());
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.
ah wtf why did I put so many brackets. fixed
} | ||
|
||
function calculateTVLs() external view returns (uint256[][] memory , uint256[] memory, uint256 _exchangeRate) { | ||
_exchangeRate = exchangeRate; |
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.
_exchangeRate = exchangeRate; | |
function calculateTVLs() external view returns (uint256[][] memory, uint256[] memory, uint256 _exchangeRate) { |
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.
Not sure what you want changed here.
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.
Hahah damn just uint256[][] memory , => uint256[][] memory,
for first return param
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.
fixed
test/EZETHExchangeRateOracle.t.sol
Outdated
_exchangeRate = exchangeRate; | ||
} | ||
|
||
function totalSupply() external view returns (uint256) { |
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.
pure
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.
fixed
Coverage after merging add-rseth-ezeth-oracles into master will be
Coverage Report
|
rsETH and ezETH are planned to be onboarded, so we need exchange rate oracles for them.