MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
11.88k stars 4.85k forks source link

Binance Smart Chain: Does not show any balance #10151

Closed ninjavisa closed 3 years ago

ninjavisa commented 3 years ago

Describe the bug Metamask is not show any balance on the Binance Smart Chain

SETUP: RPC: https://bsc-dataseed1.ninicoin.io/ ChainID: 56 Currency symbol: BNB Block explorer: https://bscscan.com

Steps to reproduce (REQUIRED) Steps to reproduce the behavior, libraries used with version number, and/or any setup information to easily reproduce:

  1. Using Binance bridge to send BUSD from Ethereum chain to Binance Smart chain
  2. I can see the balance using the https://www.bscscan.com/
  3. But I do not see the balance in the metamask wallet, shows 0 BUSD

Expected behavior

Expected to see the Binance Smart Chain balance

Browser details (please complete the following information):

1blockologist commented 3 years ago

wouldn't that issue more likely be the node you are connecting to? https://bsc-dataseed1.ninicoin.io/

ninjavisa commented 3 years ago

I don't think it is node issue since I have tried several nodes in this list: https://docs.binance.org/smart-chain/developer/rpc.html

https://bsc-dataseed.binance.org/ https://bsc-dataseed1.defibit.io/ https://bsc-dataseed1.ninicoin.io/ https://bsc-dataseed4.binance.org/

It could be that all those nodes I have tested are broken, but I do not think so, not sure how I can validate if it is a node issue or metamask issue

ninjavisa commented 3 years ago

@1blockologist I just connected to one of the nodes

geth attach https://bsc-dataseed1.defibit.io/ web3.eth.call( {"to":"contract_addres","data":"0x70a08231000000000000000000000000{my_address}"})

And I got the correct balance back, this should indicate that the nodes are returning the correct value

1blockologist commented 3 years ago

that is interesting, so you are doing a "balanceOf" transaction to a token contract, is this the BNB asset? because there is WBNB there but not BNB and I am just checking for consistency to think about what the possibilities are

ninjavisa commented 3 years ago

Yes I am checking the BUSD token and this is on the binance chain, the contract is "0xe9e7cea3dedca5984780bafc599bd69add087d56"

I am not sure how to debug what is going on inside metamask, but for some reason it is not displaying the balance

crypto-contributor commented 3 years ago

@ninjavisa The default BUSD token in metamask on BSC network is using the contract address from the Ethereum network (0x4fabb145d64652a948d72533023f6e7a623c7c53). You need to add a custom token using the address 0xe9e7cea3dedca5984780bafc599bd69add087d56

tmashuang commented 3 years ago

Where as this is confusing and not and ideal solution, there is no easy way to handle the multiple of the multitude of the different chains and currencies with our current API and sources. There could be potential new features that in the future that might alleviate the custom network confusions. Closing this issue as OP seems to have solved their own issue.

ninjavisa commented 3 years ago

Yeah you are absolutely right, the contract address is different on binance change. Thanks a lot for investigating this