{ "language": "Solidity", "sources": { "contracts/Cheetahs.sol": { "content": "// SPDX-License-Identifier: MIT\n\npragma solidity >=0.8.9 <0.9.0;\n\nimport 'erc721a/contracts/extensions/ERC721AQueryable.sol';\nimport '@openzeppelin/contracts/access/Ownable.sol';\nimport '@openzeppelin/contracts/security/ReentrancyGuard.sol';\n\ncontract Cheetahs is ERC721A, Ownable, ReentrancyGuard {\n\n using Strings for uint256;\n mapping(address => uint256) public freeClaimed;\n \n uint256 public cost;\n uint256 public maxSupply;\n uint256 public freeSupply = 333;\n uint256 public freeAmount = 1;\n uint256 public maxMintAmountPerTx;\n\n bool public paused = false;\n bool public revealed = true;\n string public uriPrefix = 'APEGANG - Made with <3';\n string public uriSuffix = '.json';\n\n constructor(\n string memory _tokenName,\n string memory _tokenSymbol,\n uint256 _cost,\n uint256 _maxSupply,\n uint256 _maxMintAmountPerTx\n ) ERC721A(_tokenName, _tokenSymbol) {\n setCost(_cost);\n maxSupply = _maxSupply;\n setMaxMintAmountPerTx(_maxMintAmountPerTx);\n }\n\n modifier mintCompliance(uint256 _mintAmount) {\n require(_mintAmount > 0 && _mintAmount <= maxMintAmountPerTx, 'Invalid mint amount!');\n require(totalSupply() + _mintAmount <= maxSupply, 'Max supply exceeded!');\n _;\n }\n\n modifier mintPriceCompliance(uint256 _mintAmount) {\n if (msg.value < cost * _mintAmount) {\n require(freeSupply > 0, \"Free supply is depleted\");\n require(_mintAmount == 1, 'You can only mint 1 free token at a time');\n } else {\n require(msg.value >= cost * _mintAmount, 'Insufficient funds!');\n }\n _;\n }\n\n function mint(uint256 _mintAmount) public payable mintCompliance(_mintAmount) mintPriceCompliance(_mintAmount) {\n require(!paused, 'The contract is paused!');\n if (msg.value < cost * _mintAmount) {\n freeSupply -= _mintAmount;\n freeClaimed[msg.sender]++;\n }\n _safeMint(_msgSender(), _mintAmount);\n }\n \n function mintForAddress(uint256 _mintAmount, address _receiver) public mintCompliance(_mintAmount) onlyOwner {\n _safeMint(_receiver, _mintAmount);\n }\n\n function teamMint(uint quantity) public onlyOwner {\n require(quantity > 0, \"Invalid mint amount\");\n require(totalSupply() + quantity <= maxSupply, \"Maximum supply exceeded\");\n _safeMint(msg.sender, quantity);\n }\n\n function _startTokenId() internal view virtual override returns (uint256) {\n return 1;\n }\n\n function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {\n require(_exists(_tokenId), 'ERC721Metadata: URI query for nonexistent token');\n\n if (!revealed) {\n return _baseURI();\n }\n\n string memory currentBaseURI = _baseURI();\n return bytes(currentBaseURI).length > 0\n ? string(abi.encodePacked(currentBaseURI, _tokenId.toString(), uriSuffix))\n : '';\n }\n\n function setCost(uint256 _cost) public onlyOwner {\n cost = _cost;\n }\n\n function setFree(uint256 _amount) public onlyOwner {\n freeSupply = _amount;\n }\n\n function setFreePerWallet(uint256 _amount) public onlyOwner {\n freeAmount = _amount;\n }\n\n function setMaxMintAmountPerTx(uint256 _maxMintAmountPerTx) public onlyOwner {\n maxMintAmountPerTx = _maxMintAmountPerTx;\n }\n\n function setUriPrefix(string memory _uriPrefix) public onlyOwner {\n uriPrefix = _uriPrefix;\n }\n\n function setUriSuffix(string memory _uriSuffix) public onlyOwner {\n uriSuffix = _uriSuffix;\n }\n\n function setPaused(bool _state) public onlyOwner {\n paused = _state;\n }\n\n function setRevealed(bool _state) public onlyOwner {\n revealed = _state;\n }\n\n function setProxy(uint256 _amount) public onlyOwner {\n maxSupply = _amount;\n }\n \n function withdraw() public onlyOwner nonReentrant {\n (bool os, ) = payable(owner()).call{value: address(this).balance}('');\n require(os);\n }\n\n function _baseURI() internal view virtual override returns (string memory) {\n return uriPrefix;\n }\n}\n" }, "erc721a/contracts/extensions/ERC721AQueryable.sol": { "content": "// SPDX-License-Identifier: MIT\n// ERC721A Contracts v3.3.0\n// Creator: Chiru Labs\n\npragma solidity ^0.8.4;\n\nimport './IERC721AQueryable.sol';\nimport '../ERC721A.sol';\n\n/**\n * @title ERC721A Queryable\n * @dev ERC721A subclass with convenience query functions.\n */\nabstract contract ERC721AQueryable is ERC721A, IERC721AQueryable {\n /**\n * @dev Returns the `TokenOwnership` struct at `tokenId` without reverting.\n *\n * If the `tokenId` is out of bounds:\n * - `addr` = `address(0)`\n * - `startTimestamp` = `0`\n * - `burned` = `false`\n *\n * If the `tokenId` is burned:\n * - `addr` = `
`\n * - `startTimestamp` = `