中文
铁叔

天地不仁 以万物为刍狗


  • 首页

  • 归档

  • 关于我

  • 公益404

  • 搜索

hardhat solidity 常见错误

时间: 2021-10-31   |   分类: Defi   Solidity   | 字数: 192 字 | 阅读: 1分钟 | 阅读次数:

常见 hardhat 相关问题整理

整理 hardhat, solidity 常见的错误,不定期更新。

hardhat-deploy: cannot find artifact “xxxx”

可能有两种情况:

  1. 确实没有该合约;
  2. 有重复的合约定义;

情况1的问题非常容易发现,由于错误提示的误导,情况2的却不容易被发现,因此,如果出现此类提示,请注意查看是否有多个重复的合约定义。

Error: Cannot find module ’typechain/dist/TypeChain'

原因:使用旧版本的 hardhat-typechain 导致该问题,这个版本已经不在维护。

解决方案:

  1. 删除依赖 hardhat-typechain
  2. 增加依赖 typechain @typechain/hardhat @typechain/ethers-v5
yarn add -D typechain @typechain/hardhat @typechain/ethers-v5
  1. 修改 hardhat.config.ts:
- import 'hardhat-typechain';
+ import '@typechain/hardhat'

https://github.com/dethcrypto/TypeChain/issues/409

#hardhat# #Solidity# #hardhat-deploy#

声明:hardhat solidity 常见错误

链接:https://guotie.github.io/post/hardhat/hardhat-solidity-common-cases/

作者:铁叔

声明: 本博客文章除特别声明外,均采用 CC BY-NC-SA 3.0许可协议,转载请注明出处!

创作实属不易,如有帮助,那就打赏博主些许茶钱吧 ^_^
WeChat Pay

微信打赏

Alipay

支付宝打赏

使用 lua script 来执行 redis 事务
openzeppelin 版本4.1.0-4.3.1中UUPS proxy 存在致命漏洞
铁叔

铁叔

千里之行 始于足下

25 日志
14 分类
56 标签
GitHub twitter telegram email medium
标签云
  • Solidity
  • Defi
  • Aave
  • Compound
  • Abi
  • Dapp
  • Ethereum
  • Evm
  • Lend protocol
  • Lending
© 2010 - 2024 铁叔
Powered by - Hugo v0.119.0 / Theme by - NexT
/
0%