Open wottpal opened 1 year ago
i guess thats not a bug you can enable transfer or other psp22 functions in your contract by importing your contract as dependancy
Agree this can be confusing. It's blindly stating the chains token symbol for any Balance
type inputs. That's probably often true but not always, therefore this ticket.
Adding some custom logic for detecting an interaction with a psp22 contract could help here, however imho the actual benefits are a bit limited. I would almost rather opt for not showing any Symbol on a Balance
input. 🤔
IMO the most simple fix would be a little toggle in the input field that either denominates the value as a balance (12 decimals) or doesn't denominate at all. Just removing the symbol still leaves up the question: Is this value denominated or now? And if yes, how many decimals?
Hey, when working with fungible token contracts (i.e. PSP-22) we've noticed that contracts-ui is statically assuming that values with the
Balance
type are always the native chain currency with it's decimals & token identifier.In the PSP-22 interface,
Balance
is just an alias type foru128
and can have any decimal & any token identifier. And as the input field is already denominating with the networks decimals (e.g. 12) it's super confusing that it assumes the same for other tokens Balances.Maybe adding a "Network Currency" switch that switches between networks decimals & token symbol between just the plain
u128
value w/o any decimals applied would help here?