Error transfer using metamask mobile only

Describe the bug
Error when do BEP-20 transaction( BUSD ) through web3 or ether.js return Warning! Error encountered during contract execution [invalid opcode: opcode 0xa9 not defined]
The contract also changed to contract creation

The issue only happen on metamask mobile , using the same script working on using metamask browser extension , and other Wallets .

Screenshots
Error shown when transfer BUSD using metamask mobile
Hash:0x590c8e6f453416d8b93496f512606c2bb8f027281c1cb0a611786ca0216f4f6d

Successfull when transfer BUSD using metamask browser extension
Hash:0x58bbf0d41964f8ffca70034dbb5c9f7e7dfb1c3e4662b71bf99c3cc09fecec18

Different contract outcome when using metamask mobile and metamask browser extension with the same script

Transfer Code Web3

      await window.ethereum.enable()
      const senderAddress = '{{sender_address}}'
      const receiverAddress = '{{receiver_address}}'
      const busdAddress = '0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56'
      const trfAmount = '0.001'

      const web3 = new Web3(window.ethereum)
      const contract = new web3.eth.Contract(bscContract.abi, busdAddress)

      contract.methods
        .transfer(receiverAddress, web3.utils.toWei(trfAmount, 'ether'))
        .send({ from: senderAddress })
        .then((res) => {
          console.log(res)
        })
        .catch((err) => {
          console.log(err)
        })

To Reproduce

  1. Do transfer BUSD using web3 or ether.js and run on metamask mobile
  2. Find the transaction on [BSCScan])
  3. See error

Expected behavior
Sucessfull BUSD transfer when using metamask mobile

Smartphone:

  • Device: iphone x
  • OS: IOS 14.7.1
  • App Version: v3.0.1
2 Likes

Exactly the same problem here on Android 3.0.1 (766). Working on browser, not on app with same result [invalid opcode: opcode 0xa9 not defined]. Any idea ?

2 Likes

Exactly the same thing happening to me, thought it may be the gas fee being too low as I got an Internal Json error before, however I increased the gas fee significantly and still had the same error on BSC.scan. Having this problem whilst using the binance bridge on metamask android. Error message: Warning! Error encountered during contract execution [ invalid opcode: opcode 0xa9 not defined ]

1 Like