Magickbase / godwoken_explorer

Godwoken Explorer
https://v1.gwscan.com
18 stars 8 forks source link

Token info is missing #1517

Closed Keith-CY closed 11 months ago

Keith-CY commented 11 months ago

Chain: Testnet Page: https://v1.testnet.gwscan.com/tx/0x07da19f290570d0f1287d43f5e562ab215125fd86c9bc1e901649949933e598f?tab=erc20Records Request:

curl 'https://api.v1.betanet.gwscan.com/graphql' \
  -H 'authority: api.v1.betanet.gwscan.com' \
  -H 'accept: application/json' \
  -H 'accept-language: en,de;q=0.9,zh-CN;q=0.8,zh;q=0.7,am;q=0.6' \
  -H 'content-type: application/json' \
  -H 'dnt: 1' \
  -H 'origin: https://v1.testnet.gwscan.com' \
  -H 'referer: https://v1.testnet.gwscan.com/' \
  -H 'sec-ch-ua: "Chromium";v="116", "Not)A;Brand";v="24", "Google Chrome";v="116"' \
  -H 'sec-ch-ua-mobile: ?0' \
  -H 'sec-ch-ua-platform: "macOS"' \
  -H 'sec-fetch-dest: empty' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-site: same-site' \
  -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36' \
  --data-raw $'{"query":"\\n  query (\\n    $transaction_hash: String\u0021\\n    $before: String\\n    $after: String\\n    $from_address: String\\n    $to_address: String\\n    $combine_from_to: Boolean\\n    $limit: Int\\n    $log_index_sort: SortType\\n  ) {\\n    token_transfers(\\n      input: {\\n        transaction_hash: $transaction_hash\\n        before: $before\\n        after: $after\\n        from_address: $from_address\\n        to_address: $to_address\\n        combine_from_to: $combine_from_to\\n        limit: $limit\\n        sorter: [{ sort_type: $log_index_sort, sort_value: LOG_INDEX }]\\n      }\\n    ) {\\n      entries {\\n        transaction_hash\\n        log_index\\n        from_address\\n        to_address\\n        from_account{\\n          eth_address\\n          bit_alias\\n        }\\n        to_account{\\n          eth_address\\n          bit_alias\\n        }\\n        udt {\\n          decimal\\n          name\\n          icon\\n          symbol\\n          id\\n        }\\n        token_id\\n        token_ids\\n        token_contract_address_hash\\n        amount\\n      }\\n      metadata {\\n        total_count\\n        before\\n        after\\n      }\\n    }\\n  }\\n","variables":{"transaction_hash":"0x07da19f290570d0f1287d43f5e562ab215125fd86c9bc1e901649949933e598f","before":null,"after":null,"from_address":null,"to_address":null,"combine_from_to":false,"limit":30,"log_index_sort":"ASC"}}' \
  --compressed

Notice that decimal, name, and symbol are null in field udt

image
Keith-CY commented 11 months ago

The response is correct.

This token doesn't exist and the Transfer event was emitted by a non-erc20 contract image

So the contract declares a ERC20 Transfer but it's actually not a ERC20 contract, and has no ERC20 Token Info

Ref: https://github.com/Magickbase/godwoken_explorer/issues/245