0

我有这个 Solidity 合同,它工作得很好:

pragma solidity ^0.7.3;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";


contract MyNFT is ERC721, Ownable {
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;

    constructor() public ERC721("MyNFT", "NFT") {}

    function mintNFT(address recipient, string memory tokenURI)
        public onlyOwner
        returns (uint256)
    {
        _tokenIds.increment();

        uint256 newItemId = _tokenIds.current();
        _mint(recipient, newItemId);
        _setTokenURI(newItemId, tokenURI);

        return newItemId;
    }
}

我想将此合同转换为 ERC1155 合同。我怎样才能做到这一点 ?

我已经看到我们需要将参数与元数据一起传递给 ERC1155 构造函数。可悲的是,我需要将 10 000NFTS 放入区块链中,但我不能走这条路,我应该继续吗?

谢谢你的回答:)

4

0 回答 0