36522/how-to-call-payable-contract-function-from-truffle-console
I am using the following contract to deposit ethers:
function deposit() payable public { balances[msg.sender] = balances[msg.sender].add(msg.value); totalBalances.add(msg.value); }
I have compiled and deployed the contract. I have entered truffle console but I am not understanding how to call this function.
You can use a contract function, on a contract that has been deployed, by:
ContractName.at("ContractAddress").FunctionName(FunctionArguments)
So, for your contract, it would be something like this:
ContractName.at("ContractAddress").deposit ()
Please check whether you have byzantiumBlock: 0 in your ...READ MORE
Yes, the contract is distributed by every node ...READ MORE
You can do this using a wrapper. ...READ MORE
You include ether to send in the ...READ MORE
This was a bug. They've fixed it. ...READ MORE
recipes is a dynamic storage array. You need ...READ MORE
I guess you have ganache running already ...READ MORE
The problem lies in the command: truffle migrate Your truffle migrate command ...READ MORE
Try this: var result = getUserAtIndex.CallAsync<byte[]>(123) ...READ MORE
The command you are using to create ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.