4

使用hardhat upgrades进行升级时报错Error: The requested contract was not found. M...

 2 years ago
source link: https://learnblockchain.cn/question/2722
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
使用hardhat upgrades进行升级时报错Error: The requested contract was not found. Make sure the source code is available for compilation at getContractNameAndRunValidation

5 使用hardhat upgrades进行升级时报错Error: The requested contract was not found. Make sure the source code is available for compilation at getContractNameAndRunValidation

回答问题即可获得 5 经验值,回答被采纳后即可获得 10 学分。

问题:使用hardhat upgrades进行升级时报错Error: The requested contract was not found. Make sure the source code is available for compilation at getContractNameAndRunValidation
检查,合约编译文件无问题,可以正常部署合约
追踪代码,定位到@openzeppelin/upgrades-core/src/validate/query.ts:46:11

if (contractName === undefined || runValidation === undefined) {
    throw new Error('The requested contract was not found. Make sure the source code is available for compilation');
  }

应该是验证文件时出了问题,原文件和升级合约只是多了一个设置函数而,没有变动数据结构


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK