I am trying to call a solidity function and am getting an error. This is how I create my contract:
var EthProjContract = web3.eth.contract(my abi);
var EthProj = EthProjContract.at('0xcce478FDeF9F1DF933e31B1eeA48561e0095628A');
I am calling my function like this:
EthProj.setMessage.sendTransaction(shoco.compress(document.getElementById("MessageBox").value), {from: document.getElementById("add").value})
and get this error:
Uncaught Error: Invalid number of arguments to Solidity function
If you are wondering what shoco.compress is, it compressed my strings into uint8arrays. For example,
shoco.compress("Hello")
returns Uint8Array(3) [72, 193, 77]
If I have Hello
in my MessageBox
box and call
EthProj.setMessage.sendTransaction(shoco.compress(document.getElementById("MessageBox").value), {from: document.getElementById("add").value})
I get the error. But, when I call
EthProj.setMessage.sendTransaction([72, 193, 77], {from: document.getElementById("add").value})
it works perfectly. This means it can't be anything with getting my text. So what could it be? All I could think that it could possibly be is that Uint8Array(3)
being in there could be messing it up. If so, how could I fix that?