-
Notifications
You must be signed in to change notification settings - Fork 3
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/90 prevent locking user funds in _withdrawFromVault #7
base: master
Are you sure you want to change the base?
Conversation
…during-deposit 3.1 yearn re entrancy attack during deposit
@@ -188,7 +191,7 @@ contract YearnV2YieldSource is IYieldSource, ERC20Upgradeable, OwnableUpgradeabl | |||
} | |||
uint256 currentBalance = token.balanceOf(address(this)); | |||
|
|||
return previousBalance.sub(currentBalance); | |||
return currentBalance > previousBalance ? currentBalance.sub(previousBalance) : 0; |
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.
Is this from the other PR? Conditional is a no-op
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.
Other than the leak from the other PR LGTM. Just a redundant conditional
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 - this PR should be on our repo
reduce SLOAD calls in _withdrawFromVault
gas optimization
reduce SLOAD calls in _depositInVault
code-423n4/2021-06-pooltogether-findings#90