Closed alecdwm closed 5 months ago
we use 0 as a default for decimals because we don't want our users to accidentally transfer significantly more tokens than they intended to, on account of a missing piece of chain configuration.
Good idea!
Thanks for the PR!
Yo!
The
system_properties
RPC call is the standard way for dapps & wallets to find out what these values are set to for each substrate chain.By chance, the setting of
12
for decimals and42
for the account prefix are the defaults shown in the metadata section of the polkadot.js apps UI.As such, when using that UI it looks like it has successfully picked up the
TOKEN_DECIMALS
value from the config for this chain.In reality, if a dev were to change the decimals to e.g.
18
or10
, they might be confused to find that pjs-apps still considers it to be12
!Also in Talisman, when a user-provided chain RPC doesn't tell us otherwise, we use
0
as a default for decimals because we don't want our users to accidentally transfer significantly more tokens than they intended to, on account of a missing piece of chain configuration.By merging this PR, both scenarios will be accounted for 🙂 Pjs-apps and Talisman will both use the correct token decimals, as configured in
lib.rs
.