-
Notifications
You must be signed in to change notification settings - Fork 14
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
LiquidityPool.sol
doesn't respect fully EIP 4626
#798
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-34
low quality report
This report is of especially low quality
satisfactory
satisfies C4 submission criteria; eligible for awards
Comments
c4-submissions
added
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
labels
Sep 14, 2023
raymondfam marked the issue as low quality report |
c4-pre-sort
added
the
low quality report
This report is of especially low quality
label
Sep 16, 2023
raymondfam marked the issue as duplicate of #25 |
gzeon-c4 marked the issue as unsatisfactory: |
c4-judge
added
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Sep 26, 2023
gzeon-c4 removed the grade |
c4-judge
removed
the
unsatisfactory
does not satisfy C4 submission criteria; not eligible for awards
label
Sep 26, 2023
gzeon-c4 marked the issue as not a duplicate |
gzeon-c4 marked the issue as duplicate of #34 |
gzeon-c4 marked the issue as satisfactory |
c4-judge
added
the
satisfactory
satisfies C4 submission criteria; eligible for awards
label
Sep 26, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-34
low quality report
This report is of especially low quality
satisfactory
satisfies C4 submission criteria; eligible for awards
Lines of code
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/InvestmentManager.sol#L383-L393
https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/InvestmentManager.sol#L396-L406
Vulnerability details
Impact
The EIP-4626 states that the function
previewMint
andpreviewWithdraw
should be rounded up always, but that is not the case in theInvestmentManager.sol
which makes it not fully compliant.Proof of Concept
As can be seen by EIP-4626
https://eips.ethereum.org/EIPS/eip-4626
the function
previewDeposit
andpreviewRedeem
must round down, which is done trough the whole functions, butpreviewMint
andpreviewWithdraw
should be rounded up, which is not the case as can be seen here https://github.com/code-423n4/2023-09-centrifuge/blob/512e7a71ebd9ae76384f837204216f26380c9f91/src/InvestmentManager.sol#L579-L581.This will make the
LiquidityPool.sol
not fully EIP-4626 compliant as stated, which can lead to wrong assumptions if other protocol interact with Centrifuge.Tools Used
Manual review
Recommended Mitigation Steps
Consider implementing EIP-4626 fully and correctly to prevent wrong assumptions.
Assessed type
ERC4626
The text was updated successfully, but these errors were encountered: