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
- Do transfer BUSD using web3 or ether.js and run on metamask mobile
- Find the transaction on [BSCScan])
- 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