0

When creating new eosio::asset objects, what is the maximum precision that can be stored in the asset?

1 Answer 1

1

In nodeos, eosio::chain::symbol only accepts decimals under 18 digits, but eosio::symbol in CDT doesn't check its precision. Of course, during [de]serialization, the inner value of symbol is managed by eosio::chain::symbol, so error occurs, but if you instantiate symbol or asset in contract, it can have more that 18 digits. I think eosio::symbol::is_valid needs to check maximum decimal digits to keep consistency with nodeos-side symbol struct. (I sent PR about this issue)

https://github.com/EOSIO/eosio.cdt/pull/553

2
  • Can you link the PR please? Commented Jul 12, 2019 at 10:32
  • 1
    @PhillipHamnett-EOS42 I added the link in answer.
    – conr2d
    Commented Jul 18, 2019 at 12:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.