【问题标题】:Hardhat: failed to verify ProxyAdmin contract at <0x~>: Bytecode does not match with the current version of ProxyAdmin in the Hardhat Upgrades pluginHardhat:未能在 <0x~> 处验证 ProxyAdmin 合约:字节码与 Hardhat Upgrades 插件中的 ProxyAdmin 的当前版本不匹配
【发布时间】:2022-10-15 04:53:39
【问题描述】:

我们的团队在尝试通过 Hardhat 验证代理合同时看到以下错误:

运行后:npx hardhat verify --network matic 0x2CB7FfCE5d0e128268D8AA7549EBefB9B293Dc21 我们看到:

Nothing to compile
Implementation 0x3Adf7e2B2aCfFf48d11802EC0b1591Cc19672804 already verified.
Verifying proxy: 0x2CB7FfCE5d0e128268D8AA7549EBefB9B293Dc21
Contract at 0x2CB7FfCE5d0e128268D8AA7549EBefB9B293Dc21 already verified.
Linking proxy 0x2CB7FfCE5d0e128268D8AA7549EBefB9B293Dc21 with implementation
Successfully linked proxy to implementation.
Verifying proxy admin: 0x877D0e3fB2732d074aa70D961320e3AE58320705
Failed to verify ProxyAdmin contract at 0x877D0e3fB2732d074aa70D961320e3AE58320705: Bytecode does not match with the current version of ProxyAdmin in the Hardhat Upgrades plugin.
An unexpected error occurred:
Error: Verification completed with the following errors.
Error 1: Failed to verify ProxyAdmin contract at 0x877D0e3fB2732d074aa70D961320e3AE58320705: Bytecode does not match with the current version of ProxyAdmin in the Hardhat Upgrades plugin.

是否有人熟悉此错误和潜在的故障排除途径?

【问题讨论】:

    标签: solidity web3js npx hardhat etherscan


    【解决方案1】:

    在这种情况下,polygonscan 本身发现了一个类似的源代码,并且似乎已通过相似性验证https://polygonscan.com/address/0x877D0e3fB2732d074aa70D961320e3AE58320705#contracts

    要检查的另一件好事是,该合约的安全帽配置中的编译器版本是否正确,因为可能是安全帽使用了不同的版本。

    例如,如果您的合约中有多个 Solidity 版本,您可以在安全帽配置中放置不同的版本:

    module.exports = {
      solidity: {
        compilers: [
          {
            version: "0.8.2",
          },
          {
            version: "0.8.9",
          },
        ],
      },
    };
    

    【讨论】:

      猜你喜欢
      • 2021-11-14
      • 2021-11-15
      • 2022-08-16
      • 2022-12-24
      • 2022-08-23
      • 2022-06-16
      • 2023-01-16
      • 2022-01-20
      • 2022-12-09
      相关资源
      最近更新 更多