trustwallet / wallet-core

Cross-platform, cross-blockchain wallet library.
https://developer.trustwallet.com/wallet-core
Apache License 2.0
2.77k stars 1.56k forks source link

TrustWallet shows error Cannot read properties of undefined (reading 'type') #3735

Closed uncleGena closed 6 months ago

uncleGena commented 6 months ago

Describe the bug When executing transfer on token contract, wallet opens popup with error on bottom and with disabled 'Confirm' button. Error:

Cannot read properties of undefined (reading 'type')

To Reproduce

  1. ethers.js v6.11.1
  2. trustwallet/web3-react-trust-wallet
  3. custom chain:
  4. custom token:
    • address: 0x4200000000000000000000000000000000000042
    • symbol: PATEX
const data = contractERC20Token.interface.encodeFunctionData('transfer', [
  someAddressSendTokensTo,
  balanceOfCustomToken
])

const tx = await signer.sendTransaction({
  to: contractERC20TokenAddress,
  data,
})

Expected behavior Shows popup without JS error on bottom with correct data and balance of native and transfer tokens.

Screenshots

image

Additional context Add any other context about the problem here.

satoshiotomakan commented 6 months ago

Hi @stylianos-panagakos, could you please check this issue?