导入 @openzeppelin/contrancts字符串文字(路径)错误
我是Web3的新手,我正在尝试解决此问题。它是关于openzeppelin/Contracts导入错误“预期字符串字符串(路径)”,“ ”或“别名列表”。这是错误定义。我安装了OpenZeppelin/Contracts,但是这个问题从未解决。我该如何修复?
我是Web的新手[在此处输入图像说明] [1] 3,我正在尝试解决此问题。它是关于openzeppelin/contracts导入错误“预期字符串字符串(路径),” “或别名列表”。这是错误定义。我安装了OpenZeppelin/Contracts,但是这个问题从未解决。我该如何修复?
pragma solidity ^0.8.4;
import '@openzeppelin\contracts\token\ERC721\ERC721.sol';
import '@openzeppelin\contracts\access\Ownable.sol';
contract safakNft is ERC721,Ownable{
uint256 public mintPrices;
uint256 public totalSupply;
uint256 public maxSupply;
uint256 public maxPerWallet;
bool public isPublicMintEnabled;
string internal baseTokenUri;
address payable public withdrawWallet;
mapping(address =>uint256) public walletMints;
I am new at web3 and I am trying to fix this problem. it is about openzeppelin/contracts import error "Expected string literal (path), "" or alias list." and this is the error definition. I install openzeppelin/contracts but this problem was never solved. how can I fix it?
I am new at web[enter image description here][1]3 and I am trying to fix this problem. it is about openzeppelin/contracts import error "Expected string literal (path), "" or alias list." and this is the error definition. I install openzeppelin/contracts but this problem was never solved. how can I fix it?
pragma solidity ^0.8.4;
import '@openzeppelin\contracts\token\ERC721\ERC721.sol';
import '@openzeppelin\contracts\access\Ownable.sol';
contract safakNft is ERC721,Ownable{
uint256 public mintPrices;
uint256 public totalSupply;
uint256 public maxSupply;
uint256 public maxPerWallet;
bool public isPublicMintEnabled;
string internal baseTokenUri;
address payable public withdrawWallet;
mapping(address =>uint256) public walletMints;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
复制“ @openzeppelin”文件夹并将其粘贴到“合同”文件夹中,然后导入(导入” ./@openzeppelin/contracts/token/ererc721/erc721/erc721.sol;)。只需记住将其添加到Gitignore文件中(完成后应该是深蓝色)。
Copy the "@openzeppelin" folder and paste it inside the "contracts" folder, then import it ( import "./@openzeppelin/contracts/token/ERC721/ERC721.sol";). Just remember to add it to the gitIgnore file (it should be dark blue after you done it).