contract TheDegenaissance is ERC721 {
    string public baseURI;
    uint256 public _totalSupply;
    address public owner;

    /**
    *   @notice constructor for this contract
    *   @dev name and symbol are hardcoded in from the start
    */
    constructor() ERC721("The Degenaissance", "DEGEN") {
        baseURI = string("ipfs://QmdPQRVCDvDjapV6SNGMxNbp31NeNwneM54Y861MGjTYMR/");
        owner = address(0x9Ad21C497837165344e1fA54fe894174b19c51e0);
        _totalSupply = 2553;
    }

    /**
    *   @notice function to view total supply
    *   @return uint256 with supply
    */
    function totalSupply() public view returns(uint256) {
        return _totalSupply;
    }

    /**
    *   @notice override supportsInterface function since both ERC721 and AccessControl utilize it
    *   @dev see {IERC165-supportsInterface}
    */
    function supportsInterface(bytes4 interfaceId) public view override(ERC721) returns (bool) {
        return
            interfaceId == type(IERC721).interfaceId ||
            interfaceId == type(IERC721Metadata).interfaceId ||
            super.supportsInterface(interfaceId);       
    }

    /**
    *   @notice sets the baseURI for the ERC721 tokens
    *   @dev requires ADMIN role
    *   @param uri is the base URI set for each token
    */
    function setBaseURI(string memory uri) external {
        require(msg.sender == owner, "setBaseUri unauthorized");
        baseURI = uri;
    }

    /**
    *   @notice override standard ERC721 base URI
    *   @dev doesn't require access control since it's internal
    *   @return string representing base URI
    */
    function _baseURI() internal view override returns (string memory) {
        return baseURI;
    }

    /**
    *   @notice mint function in batches
    *   @dev requires ADMIN access
    *   @dev converts token id to the appropriate tokenURI string
    *   @param addresses is an array of addresses to mint to
    *   @param start is the tokenId to start iteration with
    */
    function batchMint(address[] memory addresses, uint256 start) external {
        require(msg.sender == owner, "batchMint unauthorized");
        for (uint256 i = 0; i < addresses.length; i++) {
            _mint(addresses[i], start+i);
        }
    }
    
    /**
     * @dev See {IERC721Metadata-tokenURI}.
     */
    function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {
        require(_exists(tokenId), "ERC721Metadata: URI query for nonexistent token");

        return string(abi.encodePacked(_baseURI()));
    }

}
function totalSupply() public view returns(uint256) {
    return _totalSupply;
}

/**
 *   @notice function to view total supply
 *   @return uint256 with supply
 */