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

Tokens with more than 18 decimals can cause issues #174

Open
code423n4 opened this issue Sep 8, 2022 · 2 comments
Open

Tokens with more than 18 decimals can cause issues #174

code423n4 opened this issue Sep 8, 2022 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax

Comments

@code423n4
Copy link
Contributor

Lines of code

https://github.com/code-423n4/2022-09-canto/blob/65fbb8b9de22cf8f8f3d742b38b4be41ee35c468/src/Swap/BaseV1-core.sol#L93-L94

Vulnerability details

PoC

There are some tokens with more than 18 decimals. For example (YAMv2 has 24 decimals).

However, all you math is based on the fact that the maximum number of digits for a token is 18.

Recommended

Check that the tokens has 18 digits or less when creating the pair.

@code423n4 code423n4 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 8, 2022
code423n4 added a commit that referenced this issue Sep 8, 2022
@nivasan1
Copy link
Collaborator

duplicate #25

@nivasan1 nivasan1 added the duplicate This issue or pull request already exists label Sep 10, 2022
@0xean
Copy link
Collaborator

0xean commented Sep 12, 2022

downgraded to QA per #25 - warden has no QA report, so this will stand alone

@0xean 0xean reopened this Sep 12, 2022
@0xean 0xean added the QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax label Sep 12, 2022
@0xean 0xean removed the 2 (Med Risk) Assets not at direct risk, but function/availability of the protocol could be impacted or leak value label Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Projects
None yet
Development

No branches or pull requests

3 participants