diff --git a/contracts/BlockfuseNFT.sol b/contracts/BlockfuseNFT.sol index 85932b2..8c71aa1 100644 --- a/contracts/BlockfuseNFT.sol +++ b/contracts/BlockfuseNFT.sol @@ -12,18 +12,18 @@ contract BlockfuseNFT is ERC721, Ownable { tokenCounter = 0; } - function mint(address to) public { - require(!hasMinted[to], "You already own an NFT"); - hasMinted[to] = true; + function mint() public { + require(!hasMinted[msg.sender], "You already own an NFT"); + hasMinted[msg.sender] = true; uint256 tokenId = tokenCounter; - _safeMint(to, tokenId); - tokenCounter += 1; + _safeMint(msg.sender, tokenId); + tokenCounter = tokenId + 1; } function exists(uint256 tokenId) public view returns (bool) { - try this.ownerOf(tokenId) { + if this.ownerOf(tokenId) { return true; - } catch { + } else { return false; } }