Tried compiling this code on Remix. Would be thankful for your help.
Getting the error below: Reason provided by the contract: "Ownable: caller is not the owner". Debug the transaction to get more information.
https://mumbai.polygonscan.com/address/0xeb22a05c1c3ca55aec8be98e2a005dffe7099876
Please find the contract address
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/token/ERC721/ERC721Upgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/utils/CountersUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/access/OwnableUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/token/ERC721/extensions/ERC721URIStorageUpgradeable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/proxy/utils/Initializable.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/utils/ContextUpgradeable.sol";
//import "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/release-v4.4/contracts/token/ERC20/ERC20Upgradeable.sol";
contract MintDropsNFT is
Initializable,
ContextUpgradeable,
OwnableUpgradeable,
ERC721URIStorageUpgradeable
{
using CountersUpgradeable for CountersUpgradeable.Counter;
CountersUpgradeable.Counter private _tokenIds;
function initialize(address owner) initializer public {
__ERC721_init_unchained("MintDrops", "MDROPS");
__Ownable_init_unchained();
__Context_init_unchained();
}
function send(address recipient, uint256 tokenId) public onlyOwner {
safeTransferFrom(address (this),recipient,tokenId);
}
function mintNFT(address recipient, string memory tokenURI)
public onlyOwner
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(recipient, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
function airDrop(address recipient, string memory tokenURI)
public onlyOwner
returns (uint256)
{
uint256 tokenId = mintNFT(recipient, tokenURI);
send(recipient, tokenId);
return tokenId;
}
}