Giter VIP home page Giter VIP logo

Comments (4)

jimmychu0807 avatar jimmychu0807 commented on August 16, 2024 1

回到 SE 讨论。我想 Darwinia 不再维护 CurrencyAdapter 应该是觉得是维护起来很麻烦。除了每次乘/除以外,我想到就是手续费。那 evm 上的手续费就是奇高。就算本身很少,但要乘个 10^9 (它们,我们是 10^6). 还有,到 DEX/CEX 交易所时,你怎样兑?是用 evm token 的单位还是 substrate token 单位? 想到这些,我都觉得直接改到 10^18 就痛一次较好。

from cess.

ytqaljn avatar ytqaljn commented on August 16, 2024

Thank you for your discovery. We will fix it in the next version.

from cess.

jimmychu0807 avatar jimmychu0807 commented on August 16, 2024

@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:

  1. Change the Substrate token decimal places to 18 (10^18). This is the approach Moonbeam takes (GLMR is 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.

  2. 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:

from cess.

ytqaljn avatar ytqaljn commented on August 16, 2024

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.

from cess.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.