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

ETHx integration #1174

Merged

Conversation

dulguun-staderlabs
Copy link

No description provided.

@dulguun-staderlabs dulguun-staderlabs changed the base branch from master to 4.0.0 July 28, 2024 13:16
@julianmrodri
Copy link
Contributor

julianmrodri commented Aug 1, 2024

@dulguun-staderlabs I noticed you are using getExchangeRate() for the underlyingRefPerTok() calculation. But that function does not exist on the ETHx token. How can you get the equivalent for that in Stader Ethx? Its the amount of underlying ETH2 per each ETHx. WE should be able to obtain this rate from your protocol ideally.

@dulguun-staderlabs
Copy link
Author

@dulguun-staderlabs I noticed you are using getExchangeRate() for the underlyingRefPerTok() calculation. But that function does not exist on the ETHx token. How can you get the equivalent for that in Stader Ethx? Its the amount of underlying ETH2 per each ETHx. WE should be able to obtain this rate from your protocol ideally.

That is correct.
Actual contract is called StaderStakePoolsManager at 0xcf5EA1b38380f6aF39068375516Daf40Ed70D299 (eth mainnet).It has a function function getExchangeRate() external view override returns (uint256).

I was thinking of using ETHx as simplicity but can definitely change it to the actual contract name.

@julianmrodri
Copy link
Contributor

julianmrodri commented Aug 1, 2024

@dulguun-staderlabs I noticed you are using getExchangeRate() for the underlyingRefPerTok() calculation. But that function does not exist on the ETHx token. How can you get the equivalent for that in Stader Ethx? Its the amount of underlying ETH2 per each ETHx. WE should be able to obtain this rate from your protocol ideally.

That is correct. Actual contract is called StaderStakePoolsManager at 0xcf5EA1b38380f6aF39068375516Daf40Ed70D299 (eth mainnet).It has a function function getExchangeRate() external view override returns (uint256).

I was thinking of using ETHx as simplicity but can definitely change it to the actual contract name.

So what the plugin is missing is the link to that contract and that is the one that should be used in underlyingRefPerTok() instead of using the erc20 variable. Is there a way to get to that address fron the ETHx contract? we can get it dynamically in the constructor and set it as an immutable var. Then use that contract in the underlyingRefPerTok() calculation.

I would use the correct naming for the variable and interface (instead of IETHx) (in the vendor folder for example and in the plugin)

@dulguun-staderlabs
Copy link
Author

@dulguun-staderlabs I noticed you are using getExchangeRate() for the underlyingRefPerTok() calculation. But that function does not exist on the ETHx token. How can you get the equivalent for that in Stader Ethx? Its the amount of underlying ETH2 per each ETHx. WE should be able to obtain this rate from your protocol ideally.

That is correct. Actual contract is called StaderStakePoolsManager at 0xcf5EA1b38380f6aF39068375516Daf40Ed70D299 (eth mainnet).It has a function function getExchangeRate() external view override returns (uint256).
I was thinking of using ETHx as simplicity but can definitely change it to the actual contract name.

So what the plugin is missing is the link to that contract and that is the one that should be used in underlyingRefPerTok() instead of using the erc20 variable. Is there a way to get to that address fron the ETHx contract? we can get it dynamically in the constructor and set it as an immutable var. Then use that contract in the underlyingRefPerTok() calculation.

I would use the correct naming for the variable and interface (instead of IETHx) (in the vendor folder for example and in the plugin)

I changed accordingly. ✅

Copy link

openzeppelin-code bot commented Aug 5, 2024

ETHx integration

Generated at commit: 3e64f8f0c1f60a86aacea42f1d689f0e48aab494

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
3
3
0
15
38
59
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@julianmrodri
Copy link
Contributor

julianmrodri commented Aug 9, 2024

Pushed some refactors and the tests.. We need to open this PR against the ethx-plugin branch. I can merge it there and take the next steps.
@dulguun-staderlabs

@dulguun-staderlabs dulguun-staderlabs changed the base branch from 4.0.0 to ethx-plugin August 12, 2024 14:06
@dulguun-staderlabs dulguun-staderlabs marked this pull request as ready for review August 12, 2024 14:06
@julianmrodri julianmrodri merged commit 2f05a32 into reserve-protocol:ethx-plugin Aug 12, 2024
5 of 15 checks passed
@dulguun-staderlabs dulguun-staderlabs deleted the feat/ethx branch August 14, 2024 06:28
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.

4 participants