Search code examples
ethereumsolidity

Solidity undefined


I have a question when I use solidity to compile a simple contract. It like that:

> web3.eth.getCompilers()
["Solidity"]
> source = "contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
"contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
> source
"contract test { function multiply(uint a) returns(uint d) { return a * 7; } }"
> clientContract = eth.compile.solidity(source).test
undefined

I don't know why the result is "undefined", what is wrong? I'm using it on the mac os.


Solution

  • According to Greeter variables are all undefined and contract doesn't run undefined in JavaScript isn't a bad thing. Variable declarations always return undefined, its nothing to worry about.

    So to answer your question, nothing is wrong, just proceed with your compiled clientContract and ignore the undefined return message.