1

I'm trying to recreate a nft project, but the file ERC721Full.sol no longer exists in the current version of the OpenZeppelin Repo. I tried to import into my smart contract file all the files that ERC721Full imports, but my computer cannot seem to access those imports. Does anyone know a solution?

pragma solidity ^0.4.24;

import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "./ERC721Metadata.sol";

contract Color is ERC721, ERC721Enumerable, ERC721Metadata {
  constructor(string name, string symbol) ERC721Metadata(name, symbol)
    public
  {
     // E.G. color = "#FFFFFF"
    function mint(string memory _color) public {
      require(!_colorExists[_color]);
        colors.push(_color);
        uint _id = colors.length - 1;
        _mint(msg.sender, _id);
        _colorExists[_color] = true;
  }
}

2 Answers2

0

Here is the ERC721Full file with all its imports.

You can download the file, and import it locally in your project, or copy paste it into your contract file.

Once you've imported it, just do the following on your contract:

contract Color is ERC721Full {
  using SafeMath for uint;

  ...

  constructor(string name, string symbol) ERC721Full(name, symbol) public {}

  ...

  // E.G. color = "#FFFFFF"
  function mint(string memory _color) public {
   ...
  }

...

}

Here are the docs for it, they will guide you aswell, best regards.

MrFrenzoid
  • 1,208
  • 6
  • 21
0

Instead this imports:

import "./ERC721.sol";
import "./ERC721Enumerable.sol";
import "./ERC721Metadata.sol";

You have to import this:

import  "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";

import  "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";

And then your contract would look like as follows:

contract Color is ERC721Enumerable, IERC721Metadata {
  constructor(string name, string symbol) ERC721Enumerable(name, symbol)
    public { ... }
}
Hristo Todorov
  • 263
  • 2
  • 12