得到错误“创建HelloWorld错误:TypeError:无法将未定义或null转换为对象”

问题描述

solidity相当新,刚刚在Remix IDE中尝试了第一个HelloWorld智能合约,却在尝试部署智能合约时偶然发现了此错误

creation of HelloWorld pending...
creation of HelloWorld errored: TypeError: Cannot convert undefined or null to object

我的代码

pragma solidity ^0.5.16;

contract HelloWorld {
    string public greet = "Hello World!";
}

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

不确定我缺少什么,因此高度感谢所有帮助和指导。

解决方法

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