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

handle div by zero edge case in maxRedeem #112

Merged

Conversation

trmid
Copy link
Member

@trmid trmid commented Jun 21, 2024

Adds a check in the maxRedeem function to return zero if the prize vault is in a lossy state, but there are absolutely no assets left. This is an extremely unlikely scenario since it requires the yield vault to have lost all funds, but at least the hypothetical prize vault depositors can be soothed by the knowledge that the prize vault is still 4626 compliant after a yield vault's unfortunate demise.

Copy link

linear bot commented Jun 21, 2024

Copy link

LCOV of commit a812f89 during coverage #576

Summary coverage rate:
  lines......: 99.6% (237 of 238 lines)
  functions..: 100.0% (65 of 65 functions)
  branches...: no data found

Files changed coverage rate:
                              |Lines       |Functions  |Branches    
  Filename                    |Rate     Num|Rate    Num|Rate     Num
  ==================================================================
  src/PrizeVault.sol          |99.5%    200| 100%    51|    -      0

@trmid trmid requested a review from asselstine June 27, 2024 17:22
@trmid trmid merged commit a32024e into fix-review Jun 28, 2024
2 checks passed
@trmid trmid deleted the gen-1777-136-handle-maxredeem-div-by-zero-edge-case branch July 16, 2024 16:04
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.

2 participants