导入 @openzeppelin/contrancts字符串文字(路径)错误

发布于 2025-01-29 03:12:40 字数 861 浏览 5 评论 0原文

我是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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

生生漫 2025-02-05 03:12:40

复制“ @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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文