坚固性未定义

Solidity undefined

我在用solidity编译简单合约的时候遇到了一个问题。 是这样的:

> 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

不知道为什么结果是"undefined",有什么问题吗?我在 mac os.

上使用它

根据 Greeter variables are all undefined and contract doesn't run undefined 在 JavaScript 中的说法并不是一件坏事。变量声明总是return undefined,没什么好担心的。

因此,为了回答您的问题,没有任何问题,只需继续编译 clientContract 并忽略 undefined return 消息。