Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions contracts/BlockfuseNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down