Unify the unit of currency/balance between Substrate pallet-balance and pallet-evm
Currently, 1M of native CESS tokens (on Substrate side) = 1 EVM CESS tokens
Thank you for your discovery. We will fix it in the next version.
@ytqaljn we will need to open this issue and discuss: 1) whether to fix it, 2) the approach to fix it.
The reason that currently 1M of native CESS tokens is shown as 1 EVM CESS tokens is because all EVM wallets use 18 decimals to read the EVM chain native token. There is no way we can configure the decimal places as in reading ERC-20 contracts.
The current approach to fix it are:
-
Change the Substrate token decimal places to 18 (10^18). This is the approach Moonbeam takes (
GLMRis their token name). Currently in CESS, it is set to (10^12) as shown here. This will have a one-time effect on all the Substrate token holders. -
Adding a currency adaptor, as Darwinia does, as shown here. Darwinia Substrate native token is 10^9 (9 decimal places) and need to multiply/divide by another 10^9 to convert to EVM token unit back and forth. There are also some runtime config hooking work to extend the pallet to use a currency adapter.
Ref:
Thank you for your suggestion. Although the second option is more cumbersome, it will have less impact on our network. If you change the decimal place of cess, it will have an impact on other programs such as bucket and go-sdk.
回到 SE 讨论。我想 Darwinia 不再维护 CurrencyAdapter 应该是觉得是维护起来很麻烦。除了每次乘/除以外,我想到就是手续费。那 evm 上的手续费就是奇高。就算本身很少,但要乘个 10^9 (它们,我们是 10^6). 还有,到 DEX/CEX 交易所时,你怎样兑?是用 evm token 的单位还是 substrate token 单位? 想到这些,我都觉得直接改到 10^18 就痛一次较好。