-
Notifications
You must be signed in to change notification settings - Fork 0
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
Tokens with decimals
larger than 18
are not supported
#204
Comments
Duplicate of #39 |
I gave this a ❤️ along with #61 because these findings both identified an additional location in the |
Marking as confirmed (and leaving issue open) for this reason. Would be great to merge both findings into 1 issue in the finalized audit. |
Fixed by connext/monorepo@f2e5b66 |
Marking this as the primary issue because it highlights an active part of the codebase while other issues do not. |
Lines of code
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L99-L115
Vulnerability details
For tokens with decimals larger than 18, many functions across the codebase will revert due to underflow.
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L99-L115
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/facets/StableSwapFacet.sol#L426
Chainlink feeds' with decimals > 18 are not supported neither:
https://github.com/code-423n4/2022-06-connext/blob/b4532655071566b33c41eac46e75be29b4a381ed/contracts/contracts/core/connext/helpers/ConnextPriceOracle.sol#L122-L140
Recommendation
Consider checking if decimals > 18 and normalize the value by div the decimals difference.
The text was updated successfully, but these errors were encountered: