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

Fix Issue 119 #47

Merged
merged 2 commits into from
Sep 11, 2023
Merged

Fix Issue 119 #47

merged 2 commits into from
Sep 11, 2023

Conversation

ohmzeus
Copy link
Owner

@ohmzeus ohmzeus commented Sep 5, 2023

Summary: At claimDefaulted, the lender may not receive the token because the Unclaimed token is not processed
Issue Link: sherlock-audit/2023-08-cooler-judging#119
Fix Description: Set amount and collateral to zero but do not delete loan struct.

Summary: At claimDefaulted, the lender may not receive the token because the Unclaimed token is not processed
Issue Link: sherlock-audit/2023-08-cooler-judging#119
Fix Description: Set amount and collateral to zero but do not delete loan struct.
@ind-igo
Copy link
Collaborator

ind-igo commented Sep 5, 2023

Why does the loan structure get deleted in claimRepaid but not in claimDefaulted?

@ohmzeus
Copy link
Owner Author

ohmzeus commented Sep 5, 2023

i think only the unclaimed field of the loan struct gets deleted in claimRepaid. I didn't write that and thought it was weird vs setting it to zero but assumed it was a gas optimization thing. It should not be deleting the entire struct.

@0xrusowsky
Copy link
Collaborator

it is what zeus mentions, this code is only clearing the unclaimed variable of the struct. We could set it to 0 if you feel like it's more idiomatic than the delete but the outcome is the same.

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.

3 participants