实体错误:位置JSON中出现意外的令牌h

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)

小智 5

我的猜测是您正在使用Remix IDE

不要忘记在传递的参数周围添加双引号: 在此处输入图片说明