My contract instance is created like:
var instance = web3.eth.contract(abi).at(addressA);
instance.sendTransaction is showing error in this case, what's the correct way to send ether to this contract?
contract-invocationweb3js
My contract instance is created like:
var instance = web3.eth.contract(abi).at(addressA);
instance.sendTransaction is showing error in this case, what's the correct way to send ether to this contract?
Best Answer
you can use
web3.eth.sendTransaction()
and set the contract's address in the "to" field of your transaction object.Here is how to send a transaction :
//if you have the fallback payable :
// if you have a specific payable function