useDApp icon indicating copy to clipboard operation
useDApp copied to clipboard

can not send Matic

Open Merrick17 opened this issue 3 years ago • 6 comments

Describe the bug I tried to use useConractFunction with MATIC , declaring like this const maticContarct = new Contract( "0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0", ERC20Interface ); const {send}= useContractFunction(maticContarct, "transfer"); however i always get this error :

Software versions

  • useDapp version ;^1.0.12
  • Package manager: yarn
  • Node version v16.14.0

Additional context

** image **

Merrick17 avatar Jun 30 '22 01:06 Merrick17

@Merrick17 Can you also add a snippet on how exactly are you calling the send function? (the exact addresses or values can be anonymized of course)

You are connected to MetaMask? Are you able to send different transactions successfully?

rzadp avatar Jun 30 '22 08:06 rzadp

image image i tried with NFT's and it worked fine using custom Contracts ... @rzadp

Merrick17 avatar Jun 30 '22 13:06 Merrick17

@Merrick17 hey i am trying to connect to the polygon network but it's failing, may i ask how you did the connection?

soya-miruku avatar Jul 01 '22 19:07 soya-miruku

@VinHylme
image

Merrick17 avatar Jul 02 '22 07:07 Merrick17

Hey @Merrick17, From the calldata from the error screenshot you provided I can see that you're trying to send a lot of tokens (4908360000000000000?). I think the bug might be here:

...
toBn((price * tokenPrices.matic).toString())
...

Did you mean something else?

yivlad avatar Jul 11 '22 09:07 yivlad

I am actually having the exact same issue but for calling a simple function on a contract on the goerli network. More here: https://github.com/TrueFiEng/useDApp/issues/931

JCaraballo113 avatar Aug 15 '22 14:08 JCaraballo113