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

Sepolia frontend changes to make sure stablecoin transactions are accurate displaying the prices #114

Closed
wants to merge 2 commits into from

Conversation

Tanya-ruby
Copy link
Contributor

Previously, users trying to obtain 10,000 stablecoins would see a value of 0 ETH, which is inaccurate. The issue stemmed from the parameters configured for the conversion function, particularly with the decimal points (scDecimals, rcDecimals, and BC_decimals).

Sepolia showed a value of 0.000000000000000032 ETH(18 digits) due to incorrect BC_decimals being used (18), which, when displayed on the frontend, only showed 0.00000 ETH.

  • Introduced decimal_subtractor = 12 in sepolia.env to adjust the decimal precision correctly:
    When BC_decimals is set to 18 in the conversion function but scDecimals = 6 is required, subtract decimal_subtractor from BC_decimals (18 - 12 = 6).

  • For Milkomeda network, set decimal_subtractor = 0:
    This way, 18 - 0 = 18 decimal points remain unchanged, ensuring that Milkomeda continues working as before.

Resolves #113

Copy link

vercel bot commented May 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
djed-solidity-web-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2024 7:44pm

Copy link
Contributor

@ceilican ceilican left a comment

Choose a reason for hiding this comment

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

@Tanya-ruby . Thanks for the PR.

I think you are right that the issue could be related to Sepolia and Milkomeda having different numbers of decimals for their respective base coins. But I checked and Milkomeda also has 18 decimals, like Sepolia.

Therefore, I don't understand why we should be subtracting 12 from one of them, but not from the other.

I think that there is a high chance that your PR is not really fixing the problem (whatever it might be) where it is, but is instead patching the problem in a different location.

I think it has to be possible to fix this problem in a way that does not involve subtracting a magical number in one case but not in the other.

@ceilican ceilican closed this Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure Sepolia Frontend for Transaction Price Display
2 participants