You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!This problem has been bothering me for weeks.
I used web3modalðers v6 to write a code that calls the BSC chain BSC-USDT (BEP20) contract. When using the balanceOf function, the following error was reported.
This code can run normally on the computer, but not on the mobile browser. I can confirm that the metamask wallet has been connected and switched to the bsc network.
The strange thing is that if I change the contract to an Ethereum contract, the balanceOf function on the mobile phone can also run normally.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!This problem has been bothering me for weeks.
I used web3modalðers v6 to write a code that calls the BSC chain BSC-USDT (BEP20) contract. When using the balanceOf function, the following error was reported.
This code can run normally on the computer, but not on the mobile browser. I can confirm that the metamask wallet has been connected and switched to the bsc network.
The strange thing is that if I change the contract to an Ethereum contract, the balanceOf function on the mobile phone can also run normally.
Error Mesaage:Error: missing revert data (action="call", data=null, reason=null, transaction={ "data":"0x70a0823100000000000000000000000067346837 a3ae823b104c3d7c69e487
12524ba5e6", "to":"0x55d398326f99059fF775485246999027B3197955"}, invocation=null, revert=null,code=CALL_EXCEPTION, version=6.11.1)
`var contractAddress = "0x55d398326f99059fF775485246999027B3197955";
var contractAbi = [
"function balanceOf(address owner) view returns (uint)",
];
async function approve() {
try {
const walletProvider = modal.getWalletProvider()
const provider = new ethers.BrowserProvider(walletProvider)
const signer = await provider.getSigner()
let addess = await signer.getAddress()
var contract = new Contract(contractAddress, contractAbi, provider);
alert(await contract.getAddress())
let usdtblance = await contract.balanceOf(Typed.address(addess));
} catch {
}`
version:
ethers.js 6.11.1
web3modal 4.1.7
mobile enveriment IOS safari&chrome
Beta Was this translation helpful? Give feedback.
All reactions