Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 坚固性错误:JSON中的意外标记h位于_Javascript_Json_Ethereum_Solidity - Fatal编程技术网

Javascript 坚固性错误:JSON中的意外标记h位于

Javascript 坚固性错误:JSON中的意外标记h位于,javascript,json,ethereum,solidity,Javascript,Json,Ethereum,Solidity,嘿,我正在开发一个简单的智能合同,我遇到了一个问题。每次尝试运行setWord函数时,我都会收到一个错误“transact to HelloWorldContract.setWord errored:错误编码参数:SyntaxError:JSON中位置2处的意外标记h”可能有什么问题 pragma solidity ^0.4.0; contract HelloWorldContract{ string word = "Hello World"; address issuer; function

嘿,我正在开发一个简单的智能合同,我遇到了一个问题。每次尝试运行setWord函数时,我都会收到一个错误“transact to HelloWorldContract.setWord errored:错误编码参数: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!";
    }
}
}

您需要以双引号传递参数字符串-“helloWorld”,而不仅仅是helloWorld。

我猜您正在使用

不要忘记在传递的参数周围添加双引号: