lukso-network / universalprofile-test-dapp

Testing dApps for ERC725 and Universal Profiles.
https://up-test-dapp.lukso.tech/
17 stars 14 forks source link

fix: mint amount calculation #147

Closed JeneaVranceanu closed 6 months ago

JeneaVranceanu commented 7 months ago

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
github-actions[bot] commented 7 months ago

Deployed with Cloudflare Pages :cloud: :rocket: :ok:

Hugoo commented 6 months ago

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

Hugoo commented 6 months ago
JeneaVranceanu commented 6 months ago

@Hugoo Haha, yes, a review is missing.

JeneaVranceanu commented 6 months ago

Thanks for your approval 😄