我有一份明智的合同,其中包含以下导入语句:
import "@prb/contracts/PRBMathSD59x18.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";如何在编译时下载这些外部合同并导入它们呢?
我试着把第一行改为:
import "@prb/math/contracts/PRBMathSD59x18.sol";正如这个回答所建议的,但没有任何成功。这可能是因为我使用的是支架-eth,它建议使用$ yarn deploy来构建合同。
我试过手动安装它们。
$ npm install @paulrberg/prb-math@2.5.0
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@paulrberg%2fprb-math - Not found
npm ERR! 404
npm ERR! 404 '@paulrberg/prb-math@2.5.0' is not in this registry.
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/developer/.npm/_logs/2022-10-09T22_29_12_712Z-debug-0.log我还没有在文档中找到如何做到这一点。
https://stackoverflow.com/questions/74008918
复制相似问题