0

I'm getting an BigNumber overflow error when running hardhat tests. How do I fix this?

const ownerBalance = await MyToken.mint(
   owner.address,
   "ipfs://".length,
   { value: ethers.BigNumber.from(50000000000000000) }
);
2
  • 1
    Hello. Please provide the complete error with stack trace. Commented Nov 8, 2021 at 7:11
  • 2
    make sure that '50000000000000000' is a string
    – phaze
    Commented Nov 8, 2021 at 8:30

1 Answer 1

2

If you are getting the error from the BigNumber part, then I suggest you construct the number like this: ethers.utils.parseUnits("5", 16).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.