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

fix: mint amount calculation #147

Merged
merged 13 commits into from
Apr 18, 2024
Merged

fix: mint amount calculation #147

merged 13 commits into from
Apr 18, 2024

Conversation

JeneaVranceanu
Copy link
Member

@JeneaVranceanu JeneaVranceanu commented Apr 2, 2024

https://app.clickup.com/t/86by5jgxz

The current calculation of the mint amount always uses toWei function which multiplies entered amount by 18.
Not all LSP7 tokens have 18 decimals. This breaks minting.

Here is an attempt to mint 0x5f4030c46497ecf4340c7c9bca2412fa10536f08 which has 13 decimals.
The resulting value is not 1 but 1000000 tokens to be minted as 1 was converted using toWei and it produced an extra large value:

Screenshot 2024-04-02 at 15 57 18

After the fix with the same values:

Screenshot 2024-04-02 at 16 19 06

@JeneaVranceanu JeneaVranceanu changed the base branch from main to fix/work-on-gas-estimate April 2, 2024 13:33
Base automatically changed from fix/work-on-gas-estimate to main April 2, 2024 13:34
@JeneaVranceanu JeneaVranceanu force-pushed the fix/decimals-token-mint branch from 28ffbee to cd3c80c Compare April 2, 2024 13:54
@JeneaVranceanu JeneaVranceanu changed the base branch from main to fix/repair-send-add-call April 2, 2024 13:54
@JeneaVranceanu JeneaVranceanu force-pushed the fix/decimals-token-mint branch from ee663c2 to ca4b7ed Compare April 3, 2024 09:44
Base automatically changed from fix/repair-send-add-call to main April 3, 2024 15:56
Copy link

github-actions bot commented Apr 8, 2024

@Hugoo
Copy link
Contributor

Hugoo commented Apr 16, 2024

@JeneaVranceanu @richtera - can we merge this one or are we missing something?

@Hugoo
Copy link
Contributor

Hugoo commented Apr 16, 2024

  • well - probably a review haha let me check

@JeneaVranceanu
Copy link
Member Author

@Hugoo Haha, yes, a review is missing.

@JeneaVranceanu
Copy link
Member Author

Thanks for your approval 😄

@jnorbert jnorbert merged commit c0a9d21 into main Apr 18, 2024
1 check passed
@jnorbert jnorbert deleted the fix/decimals-token-mint branch April 18, 2024 09:26
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.

4 participants