当我使用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我不知道为什么结果是“未定义的”,有什么问题吗?我在mac操作系统上使用它。
发布于 2017-02-28 04:26:14
根据Greeter variables are all undefined and contract doesn't run的说法,JavaScript中的undefined并不是一件坏事。变量声明总是返回undefined,这没什么好担心的。
因此,为了回答您的问题,没有任何错误,只需继续执行已编译的clientContract并忽略undefined返回消息。
https://stackoverflow.com/questions/42061479
复制相似问题