Rok*_*kus 1 javascript json ethereum solidity
嘿,我正在开发一个简单的关于稳定性的智能合约,但遇到了麻烦。每次尝试运行setWord函数时,我都会收到一条错误消息:“交易到HelloWorldContract.setWord错误:编码参数错误:SyntaxError:JSON中位置2处的标记h异常”这可能是什么问题?
pragma solidity ^0.4.0;
contract HelloWorldContract{
string word = "Hello World";
address issuer;
function HelloWorldContract(){
issuer = msg.sender;
}
function getWord() constant returns(string) {
return word;
}
function setWord(string newWord) returns(string) {
if(issuer != msg.sender){
return "this is not the creator!";
}
else{
word = newWord;
return "this is the creator!";
}
}
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
1672 次 |
最近记录: |