contract SaconiHolmovimiento is ERC721, ERC721Enumerable, Ownable {
    uint256 public constant MAX_SUPPLY = 2000;
    uint256 public constant PRICE = 0.04 ether;
    uint256 private tokenCounter;
    bool public saleActive;

    string private URI = "https://gateway.pinata.cloud/ipfs/QmQ32LbxeNhQCsHgp521M5NRddUYMhh2WGdoWGGXyPq3oF/";

    constructor() ERC721("Saconi Holmovimiento", "SGHM") {}

    function _baseURI() internal view override returns (string memory) {
        return URI;
    }

    function setURI(string memory _URI) external onlyOwner {
        URI = _URI;
    }

    function flipSale() external onlyOwner {
        saleActive = !saleActive;
    }

    function mint(address to, uint256 amount) external payable {
        require(saleActive, "Sale inactive");
        require(amount <= 10, "Exceeds 10");
        require(amount + tokenCounter < MAX_SUPPLY, "Supply limit");
        require(msg.value >= amount * PRICE, "Incorrect ETH");

        // Solidity optimization
        uint256 _tokenCounter = tokenCounter;
        for (uint256 i = 0; i < amount; i++) {
            _safeMint(to, _tokenCounter);
            _tokenCounter++;
        }
        tokenCounter = _tokenCounter;
    }

    // cash money
    function withdrawAll() external payable onlyOwner {
        payable(owner()).transfer(address(this).balance);
    }

    function forge(address to, uint256 amount) external onlyOwner {
        require(amount <= 10, "Exceeds 10");
        require(amount + tokenCounter < MAX_SUPPLY, "Supply limit!");

        // Solidity optimization
        uint256 _tokenCounter = tokenCounter;
        for (uint256 i = 0; i < amount; i++) {
            _safeMint(to, _tokenCounter);
            _tokenCounter++;
        }
        tokenCounter = _tokenCounter;
    }

    function _beforeTokenTransfer(
        address from,
        address to,
        uint256 tokenId
    ) internal override(ERC721, ERC721Enumerable) {
        super._beforeTokenTransfer(from, to, tokenId);
    }

    function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) {
        return super.supportsInterface(interfaceId);
    }
}
function withdrawAll() external payable onlyOwner {
    payable(owner()).transfer(address(this).balance);
}

// cash money