contract LuckyEggs is ERC721 {
    using SafeMath for uint256;

    address public owner;
    
    // LuckyEggs own;
    uint public LuckyEggMinted = 0;
    uint256 constant Max_Supply = 9999;
    bool public active  =  true;  
    address authorizedOwner;

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
    
    constructor()
    // name of token
    ERC721("Lucky Eggs", "LUCK") {
        owner = msg.sender;
    }

    function setAuthorizedOwner(address _authorizedOwner) public onlyOwner {
        authorizedOwner = _authorizedOwner;
    }

    // Standard mint function
    function mintLuckyEggs(uint numberOfTokens, address minter) public {
        require(msg.sender == authorizedOwner, "Sorry you are not authorized to mint");
        for(uint i = 0; i < numberOfTokens; i++) {
            uint mintIndex = LuckyEggMinted + i;
            _safeMint(minter, mintIndex);
        }
        LuckyEggMinted = LuckyEggMinted + numberOfTokens;
    }


    function updateURI(string memory new_URI) public{
        require(msg.sender == owner, "Only owner");
       _setBaseURI(new_URI);
    }
     
}
function mintLuckyEggs(uint numberOfTokens, address minter) public {
    require(msg.sender == authorizedOwner, "Sorry you are not authorized to mint");
    for(uint i = 0; i < numberOfTokens; i++) {
        uint mintIndex = LuckyEggMinted + i;
        _safeMint(minter, mintIndex);
    }
    LuckyEggMinted = LuckyEggMinted + numberOfTokens;
}

// Standard mint function