Can't execute my contract.

jbeuckmjbeuckm Member Posts: 2
I compiled and created a contract like this:
	var source = "" + 
	    "contract test {\n" +
	    "   function multiply(uint a) returns(uint d) {\n" +
	    "       return a * 7;\n" +
	    "   }\n" +
	var compiled = web3.eth.compile.solidity(source);

	web3.eth.sendTransaction({from: web3.eth.coinbase, data: compiled.test.code}, function(err, address) {

		if (!err) {
	    	console.log('contract address = '+address); // "0x92b9a602632a1f58aed750f32b5d434ae23ad56e"
		} else {

The transaction appears in the blockchain here:

The reported contract address was: '0xbd95661809724c48452ef2d5a773b2d021208d63'

So I am trying to execute the multiply function in my contract like this:
	var MyContract = web3.eth.contract(;

	var myContractInstance =;

	console.log("answer = "+myContractInstance.multiply(6));
myContractInstance looks good, with the correct address and a multiply function. But the console reports "Uncaught Error: could not decode, from not valid, is required"

What am I doing wrong here?
Sign In or Register to comment.