This is a functioning and scalable NFT token contract. It comes with whitelist and public sale features.
I have commented on essentially every line of code so that you can understand how it works.
I have also made a version of this contract that implements ERC721A which is helpful for saving gas. Check it out here https://github.com/Shiva-Tzu/NFT_Sale-ERC721A
Support my NFT project Techno-Feudal Citizens! www.technofeudal.com