ERC721Burnable TypeError: Definition of base has to precede definition of derived contract

Hi everyone! I need assistance with this error i'm getting on Burnable, but it's not being used in my contract.

@openzeppelin/contracts/token/ERC721/ERC721Burnable.sol:12:46:

abstract contract ERC721Burnable is Context, ERC721
                                             ^----^

My ERC-721 Contract

pragma solidity ^0.6.0;

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

contract MyContract is ERC721 {

    mapping(uint256 => string) private _CIDS;
    using Counters for Counters.Counter;
    Counters.Counter private _tokenIds;
    mapping(string => uint8) hashes;

    constructor() ERC721("MYNFT", "MNT") public {
    }

    function CID(uint256 tokenId) public view returns (string memory) {

      require(_exists(tokenId), "ERC721Metadata: CID query for nonexistent token");
      string memory _CID = _CIDS[tokenId];

      return _CID;
    }

    function _setTokenCID(uint256 tokenId, string memory _CID) internal virtual {
      require(_exists(tokenId), "ERC721Metadata: CID set of nonexistent token");
      _CIDS[tokenId] = _CID;
    }

    function mint(string memory _CID, string memory metadata) public {
      require(hashes[_CID] != 1);
      hashes[_CID] = 1;

      uint256 _newId = totalSupply() + 1;
      _safeMint(msg.sender, _newId);
      _setTokenCID(_newId, _CID);

      _setTokenURI(_newId, metadata);
      
    }
    
}

Truffle Config

const path = require("path");
const HDWalletProvider = require("@truffle/hdwallet-provider");
require('dotenv').config();
const mnemonic = process.env["MNEMONIC"];
const infuraAccessKey = process.env["INFURA_ACCESS_KEY"];

module.exports = {

  networks: {

    development: {
     host: "127.0.0.1",     // Localhost (default: none)
     port: 7545,            // Standard Ethereum port (default: none)
     network_id: "*",       // Any network (default: none)
    },
    rinkeby: {
      provider: () => { 
        return new HDWalletProvider(mnemonic, `wss://rinkeby.infura.io/ws/v3/${infuraAccessKey}`);
       },
      network_id: "4",
      confirmations: 2,    // # of confs to wait between deployments. (default: 0)
      timeoutBlocks: 200,  // # of blocks before a deployment times out  (minimum/default: 50)
      skipDryRun: true,    
    }

  },

  compilers: {
    solc: {
      version: "^0.6.0"
    }
  },

  db: {
    enabled: false
  }
};
1 Like
npm install @openzeppelin/contracts

Got it

1 Like