I have some trouble with my code, basically I want to call the payable function in my Smart Contract through Web3.js, here is my code, I'm sure I did something wrong but I can't figure out where.

  • What is the problem? Sep 21, 2018 at 16:12
  • When calling the function the MetaMask window pops up with a value of 0 Ether instead of 1
    – Chris
    Sep 21, 2018 at 16:22

2 Answers 2


you don't have use the address of instance when you are sending the ether to the payable function. sorry i didn't saw the updated answer.i was typing the answer but i was not able to refreh to your answer.

  • Close one, thank you anyway! This would have solved my problem :)
    – Chris
    Sep 21, 2018 at 16:45
  • @Chris bro close this one so that other people don't have to look at this problem as they will see that this is not answered.
    – AVATAR
    Sep 21, 2018 at 16:48
  • I'm new here, is it now closed now that I marked your answer?
    – Chris
    Sep 21, 2018 at 16:52
  • welcome bro, I am also new here.N ice to meet you, Chris.
    – AVATAR
    Sep 21, 2018 at 16:54

Fixed it. The Web3.js code had to look different

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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