-
Notifications
You must be signed in to change notification settings - Fork 8
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
hash - maxDeposit
doesn't comply with ERC-4626
#134
Comments
1 comment(s) were left on this issue during the judging contest. infect3d commented:
|
Valid medium since it was mentioned as:
Sherlock rules states
|
maxDeposit
doesn't comply with ERC-4626maxDeposit
doesn't comply with ERC-4626
The protocol team fixed this issue in the following PRs/commits: |
Fixed. |
The Lead Senior Watson signed off on the fix. |
hash
medium
maxDeposit
doesn't comply with ERC-4626Summary
maxDeposit
doesn't comply with ERC-4626 since depositing the returned amount can cause revertsVulnerability Detail
The contract's
maxDeposit
function doesn't comply with ERC-4626 which is a mentioned requirement.According to the specification,
MUST return the maximum amount of assets deposit would allow to be deposited for receiver and not cause a revert ....
The
deposit
function will revert in case the deposit is a lossy deposit ie. totalPreciseAsset function returns less than the totalDebt after the deposit. It is possible for this to occur due to rounding inside the preview redeem function of the yieldVault in the absence / depletion of yield bufferPOC
Add the following test inside
pt-v5-vault/test/unit/PrizeVault/PrizeVault.t.sol
Impact
Failure to comply with the specification which is a mentioned necessity
Code Snippet
https://github.com/sherlock-audit/2024-05-pooltogether/blob/1aa1b8c028b659585e4c7a6b9b652fb075f86db3/pt-v5-vault/src/PrizeVault.sol#L991-L992
Tool used
Manual Review
Recommendation
Consider the yieldBuffer balance too inside the
maxDeposit
functionThe text was updated successfully, but these errors were encountered: