subscan-explorer / subscan-issue-tracker

The issue tracker for Subscan.io.
3 stars 5 forks source link

Incorrect decimals / precision in a Moonbeam transaction #67

Closed brissenden closed 1 year ago

brissenden commented 1 year ago

Confirmation

Affected Network(s)

Moonbeam

Steps to reproduce

  1. Open EVM transaction https://moonbeam.subscan.io/tx/0x23622bc20a4d1a98ba206ee52b7fc19b434f48d2e7f2d05f1f544fbfd31d1be5
  2. Notice that 0.00000000009999 of 0006648936.c599 token is being transferred.
  3. It looks like you use 18 decimals for this currency, below is the response from an API:
{"contract"=>"0x1dc78acda13a8bc4408b207c9e48cdbc096d95e0",
 "hash"=>"0x23622bc20a4d1a98ba206ee52b7fc19b434f48d2e7f2d05f1f544fbfd31d1be5",
 "create_at"=>1656023676,
 "from"=>"0x7ec7b375834ef33a1a677503d5065651ee530975",
 "to"=>"0x24a9d8f1f350d59cb0368d3d52a77db29c833d1d",
 "value"=>"99990000",
 "decimals"=>18,
 "symbol"=>"0006648936.c599",
 "name"=>"0006648936.c599",
 "from_display"=>{"address"=>"0x7ec7b375834ef33a1a677503d5065651ee530975"},
 "to_display"=>{"address"=>"0x24a9d8f1f350d59cb0368d3d52a77db29c833d1d", "evm_contract"=>{}}}

Expected output

The same transaction in https://moonscan.io/tx/0x23622bc20a4d1a98ba206ee52b7fc19b434f48d2e7f2d05f1f544fbfd31d1be5 shows0.9999 WBTC.

Actual output

I'd expect the API response to be equal:

{"contract"=>"0x1dc78acda13a8bc4408b207c9e48cdbc096d95e0",
 "hash"=>"0x23622bc20a4d1a98ba206ee52b7fc19b434f48d2e7f2d05f1f544fbfd31d1be5",
 "create_at"=>1656023676,
 "from"=>"0x7ec7b375834ef33a1a677503d5065651ee530975",
 "to"=>"0x24a9d8f1f350d59cb0368d3d52a77db29c833d1d",
 "value"=>"99990000",
 "decimals"=>8,
 "symbol"=>"0006648936.c599",
 "name"=>"0006648936.c599",
 "from_display"=>{"address"=>"0x7ec7b375834ef33a1a677503d5065651ee530975"},
 "to_display"=>{"address"=>"0x24a9d8f1f350d59cb0368d3d52a77db29c833d1d", "evm_contract"=>{}}}

Additional factoids or references

freehere107 commented 1 year ago

@brissenden This issue has been fixed. Thanks for your feedback

brissenden commented 1 year ago

Thank you @freehere107, it's working well now :)