这是我的合同。
// SPDX-License-Identifier: MIT
pragma solidity >= 0.7.3;
contract terceiroTest {
// We pass and old String, a new string and when this event is
// broadcast everybody is able to see that the even happened.
// and see the strings exposed too.
event UpdatedMessages(string oldStr, string newStr);
string public message;
// When this contract is deployed we require an argument passed called initMessasge
constructor (string memory initMessage) {
message = initMessage;
}
function update(string memory newMessage) public {
string memory oldMsg = message;
message = newMessage;
emit UpdatedMessages(oldMsg, newMessage);
}
} 它给了我错误:

我试图找到任何关于这个错误的描述,甚至改变了solidity的版本。我仍然在研究smartcontracts,如果有人犯了同样的错误,我会用它来点名。谢谢。
发布于 2022-12-02 00:23:16
我也有过类似的问题,他们都是自己解决的。有可能在您的代码中没有问题,问题是与以太扫描。
如果您有任何构造函数Param
下面是一些我推荐的分类方法:
verification
有不同的env,如提交。
发布于 2022-12-01 21:35:26
我接受了你的合同,并在我的安全帽上进行了测试。一切都很好。也许在你的本地设置中还发生了什么?
再试一次新的安全帽设置。尝试使用这个‘坏的硬帽子设置’https://github.com/mistersingh179/badass-hardhat-setup
我使用该设置作为一个干净的板,启动我的本地主机链,然后连接到我的sidekik接口来测试函数。你的代码很好用。这里的例子:

https://stackoverflow.com/questions/74647796
复制相似问题