如何在坚固的混音中添加对Helloworld的响应?
我想将响应添加到这个Hello World示例。
helloworld.sol
// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.13 and less than 0.9.0
pragma solidity ^0.8.13;
contract HelloWorld {
string public greet = "Hello World!";
string public respond = "Good morning, starshine!"; // trying to add this line
}
在我运行 remix中的合同在我试图添加的行之前,我看到了这一点。 ..
我希望在添加的行是另一个称为响应的按钮后看到的内容,当我按下它时,我希望下面会读取:
字符串:早上好,星际!
但是,相反,我看不到没有添加线路运行时的变化。
我如何实现预期的行为?
I want to add a response to this Hello World example.
HelloWorld.sol
// SPDX-License-Identifier: MIT
// compiler version must be greater than or equal to 0.8.13 and less than 0.9.0
pragma solidity ^0.8.13;
contract HelloWorld {
string public greet = "Hello World!";
string public respond = "Good morning, starshine!"; // trying to add this line
}
When I run the contract in Remix before the line I'm attempting to add, I see this...
What I expect to see after my added line is another button called respond and when I press it, I expect below it to read:
string: Good morning, starshine!
But instead, I see no change than when run without my added line.
How do I achieve the expected behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我看到您的代码中没有错误
您必须通过单击橙色部署按钮再次重新部署合同
I see no errors in your code
you have to redeploy the contract again by clicking orange Deploy button