From 090a963a0be73e6e88723e69ae98bd0c9baf7fd9 Mon Sep 17 00:00:00 2001 From: Isamade Date: Wed, 5 Feb 2025 01:36:30 +0100 Subject: [PATCH] Removed try catch --- contracts/BlockfuseNFT.sol | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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; } }