获取错误“创建 HelloWorld 出错:TypeError:无法将未定义或空值转换为对象”

Sou*_*SFT 5 ethereum solidity remix

Solidity 非常新,刚刚在 Remix IDE 中尝试了第一个 HelloWorld 智能合约,并在尝试部署智能合约时偶然发现了这个错误。

creation of HelloWorld pending...
creation of HelloWorld errored: TypeError: Cannot convert undefined or null to object
Run Code Online (Sandbox Code Playgroud)

我的代码:

pragma solidity ^0.5.16;

contract HelloWorld {
    string public greet = "Hello World!";
}
Run Code Online (Sandbox Code Playgroud)

编译器版本设置为 0.5.16+commit.9c3226ce

不确定我缺少什么,因此非常感谢任何所有帮助和指导。

小智 15

我认为问题出在您的浏览器上。重新加载 remix 并将代码粘贴回。代码本身没有问题。