contract SHIBASWOW is ERC721PresetMinterPauserAutoId, Ownable {
    constructor()
        public
        // start contract
        ERC721PresetMinterPauserAutoId("SHIBASWOW", "SHIBASWOW", "APILOCATION")
    {}
    string private contURI;
    uint public constant MAX_SHIBAS = 10000;

    // in case of need to change the URL of the api to get metadata
    function setBaseURI(string memory baseURI_) public onlyOwner {
        _setBaseURI(baseURI_);
    }
    function setContractURI(string memory contURI_) public onlyOwner {
        contURI=contURI_;
    }

   function adoptSHIBAS() public payable {
        require(totalSupply() < MAX_SHIBAS, "Sale has already ended");
        require(msg.value == calculatePrice(), "Wrong price!");
        _safeMint(msg.sender, totalSupply());
        }

    
    
        
        
    function withdrawAll() public payable onlyOwner {
        require(payable(msg.sender).send(address(this).balance));
    }
    function contractURI() public view returns (string memory) {
        return contURI;
    }
    
    
    function calculatePrice() public view returns (uint256) {

        require(totalSupply() < MAX_SHIBAS, "Sale has already ended");

        uint currentSupply = totalSupply();
        if (currentSupply >= 9900) {
            return 1000000000000000000;
        } else if (currentSupply >= 9500) {
            return 640000000000000000;
        } else if (currentSupply >= 7500) {
            return 320000000000000000;
        } else if (currentSupply >= 3500) {
            return 160000000000000000;
        } else if (currentSupply >= 1500) {
            return 80000000000000000;
        } else if (currentSupply >= 500) {
            return 40000000000000000;
        } else {
            return 20000000000000000;
        }
        
    }
    
    
    function mintPromoTokens() public onlyOwner {
        //mints the first 30 tokens to Owner account to distribute for promotions
        for (uint i = 0; i < 30; i++) {
            _safeMint(address(0x111B78E2A110DF52310B7851B2D6743d93c738dC), i);
        }
 

    }
}
function setBaseURI(string memory baseURI_) public onlyOwner {
        _setBaseURI(baseURI_);
    }
// in case of need to change the URL of the api to get metadata