I want to send 100wei to a payable function in my deployed contract. But i don't want to sign the transaction because of to much effort to get this going. I just want to submit the transaction with metamask. Therefore i need the correct web3 command to call my 'depositFunds' method and send 100 wei. Currently i have this command, but i get frankly an error. myContractInstance.depositFunds().sendTransaction({from: web3.eth.accounts[0], gas: 3000000, value: 100}, function(err, res){});

What do i have to change to get this going?

  • What is the full error message you get?
    – Ismael
    Sep 30, 2017 at 15:34

2 Answers 2


You can call the method directly as follows without sendTransaction:

myContractInstance.depositFunds({from: web3.eth.accounts[0], gas: 3000000, value: 100}, function(err, res){});

Here's a tutorial I wrote on interacting with smart contracts using MetaMask. Calling a payable function is the same as this, just add a value to the transaction:


You'll need the contract address and its ABI to call a method.

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.