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

H-02 MitigationConfirmed #51

Open
c4-bot-5 opened this issue Jun 7, 2024 · 1 comment
Open

H-02 MitigationConfirmed #51

c4-bot-5 opened this issue Jun 7, 2024 · 1 comment
Labels
edited-by-warden mitigation-confirmed MR-H-02 satisfactory satisfies C4 submission criteria; eligible for awards

Comments

@c4-bot-5
Copy link
Contributor

c4-bot-5 commented Jun 7, 2024

Lines of code

Vulnerability details

C4 Issue

H-02: code-423n4/2024-04-renzo-findings#395

Issue Details

Function getTokenBalanceFromStrategy is used to calculate the amount of ezETH to mint against a given value in collateral tokens. But in checking condition, it wrongly used address(this) instead of address(token), which lead to failing to consider collaterals in the withdrawal process for calculation.

 function getTokenBalanceFromStrategy(IERC20 token) external view returns (uint256) {
     return
         queuedShares[address(this)] == 0   //  <---
             ? tokenStrategyMapping[token].userUnderlyingView(address(this))
             : tokenStrategyMapping[token].userUnderlyingView(address(this)) +
                 tokenStrategyMapping[token].sharesToUnderlyingView(
                     queuedShares[address(token)]
                 );
 }

Mitigation

Mitigation successfully mitigates the original issue by modifying address(this) to address(token)

Additional code refactoring has been made so that the code is leaner.

Conclusion

Mitigation confirmed.

@c4-judge
Copy link

c4-judge commented Jun 8, 2024

alcueca marked the issue as satisfactory

@c4-judge c4-judge added the satisfactory satisfies C4 submission criteria; eligible for awards label Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edited-by-warden mitigation-confirmed MR-H-02 satisfactory satisfies C4 submission criteria; eligible for awards
Projects
None yet
Development

No branches or pull requests

3 participants