I wrote a ERC721 contract with a mint function that requires you send 0.x ETH when you call the mint function.

How do I call this function with 0.x ETH? I am still writing the unit test for this. If the mint function does not check for msg.value, I can just call the mint function like contract.mint(), but when my mint function does require msg.value, I can't find a way to add ETH to my call.


2 Answers 2


Nvm. You need to pass the override permission in the function call. Missed this in the documentation.


mint() needs to be modified by payable.


Your Answer

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

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