Skip to content

TypeError: gasUsed.mul is not a function #5813

Answered by maheepatel
SamarthBagga asked this question in Q&A
Discussion options

You must be logged in to vote

hey smarth, i also ran into same problem.

  1. If you are using ethers latest version v6 then first do the changes according to what @alfaqi mentioned earlier (like change this const gasCost = gasUsed.mul(effectiveGasPrice)
    to this const gasCost = gasUsed * effectiveGasPrice

after making those changes. If you get an error like this

 5 passing (4s)
  2 failing

  1) FundMe
       withdraw
         withdraw ETH from a single founder:
     TypeError: Cannot mix BigInt and other types, use explicit conversions
      at Context.<anonymous> (test/unit/FundMe.test.js:61:37)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)

  2) FundMe
       withdraw
         allows us to w…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@alfaqi
Comment options

Comment options

You must be logged in to vote
1 reply
@Okpainmo
Comment options

Answer selected by SamarthBagga
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants