首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >HardHat -失败-无法验证/以太扫描

HardHat -失败-无法验证/以太扫描
EN

Stack Overflow用户
提问于 2022-12-01 20:24:02
回答 2查看 24关注 0票数 -1

这是我的合同。

代码语言:javascript
复制
// 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,如果有人犯了同样的错误,我会用它来点名。谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-12-02 00:23:16

我也有过类似的问题,他们都是自己解决的。有可能在您的代码中没有问题,问题是与以太扫描。

如果您有任何构造函数Param

下面是一些我推荐的分类方法:

verification

  • Try和
  1. 提交之间的差距,
  2. 与它们的UI.

有不同的env,如提交。

票数 1
EN

Stack Overflow用户

发布于 2022-12-01 21:35:26

我接受了你的合同,并在我的安全帽上进行了测试。一切都很好。也许在你的本地设置中还发生了什么?

再试一次新的安全帽设置。尝试使用这个‘坏的硬帽子设置’https://github.com/mistersingh179/badass-hardhat-setup

我使用该设置作为一个干净的板,启动我的本地主机链,然后连接到我的sidekik接口来测试函数。你的代码很好用。这里的例子:

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74647796

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档