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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix]cm-663 swap conversion bug fix scientific notation #1806

Merged
merged 4 commits into from
May 21, 2024

Conversation

mimi-imtbl
Copy link
Contributor

@mimi-imtbl mimi-imtbl commented May 20, 2024

Hi馃憢, please prefix this PR's title with:

  • breaking-change: if you have introduced modification that necessitates immediate adjustments by this SDK's users to their applications, clients, or integrations to avert disruptions to existing features or functionalities.
  • feat:, fix:, refactor:, docs:, or chore:.

Summary

expandedFromAmount had a scientific notation format (e.g. 1e+21) when the amount was >= 10^21. When it was passed to BigNumber.from it caused an invalid BigNumber error.

Fixed

Use parseUnits from ethers to convert fromAmount to integer.

@mimi-imtbl mimi-imtbl requested a review from a team as a code owner May 20, 2024 05:15
Copy link
Contributor

@dreamoftrees dreamoftrees left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix @mimi-imtbl 馃帀

@jhesgodi jhesgodi added this pull request to the merge queue May 21, 2024
Merged via the queue into main with commit f2b58f6 May 21, 2024
11 checks passed
@jhesgodi jhesgodi deleted the fix/cm-663-swap-conversion-bug-fix-scientific-notation branch May 21, 2024 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants