Let's say I have this function is a contract, that should enable users to deposit ETH into the contract, and have the contract manage their deposits

function deposit() payable public {
    balances[msg.sender] = balances[msg.sender].add(msg.value);

Now that I have the contract deployed, how do I call this function from the truffle console? That is, with ETH attached.

  • 1
    No, because this is not the fallback function, it's a specific named payable function. – shaharsol Jun 24 '18 at 10:48

Apparently this is the syntax:

YourContractName.at('some address').deposit({from:'some address',value:100})
| improve this answer | |
  • 1
    That is what specified in the answer I've flagged you for duplicate content. – niksmac Jun 25 '18 at 4:30

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