generated from antfu-collective/vitesse-nuxt3
-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5540032
commit 827a155
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.20; | ||
|
||
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | ||
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | ||
import "@openzeppelin/contracts/access/Ownable.sol"; | ||
|
||
contract MockNFT is ERC721, ERC721URIStorage, Ownable { | ||
constructor(address initialOwner) | ||
ERC721("MockNFT", "MNFT") | ||
Ownable(initialOwner) | ||
{} | ||
|
||
function _baseURI() internal pure override returns (string memory) { | ||
return "ipfs://bafybeifkbaxlcwp4pyfrqcx7blvebzwvenb5ef63o7jbfl4qj5cuna5wtm/"; | ||
} | ||
|
||
function safeMint(address to, uint256 tokenId, string memory uri) | ||
public | ||
onlyOwner | ||
{ | ||
_safeMint(to, tokenId); | ||
_setTokenURI(tokenId, uri); | ||
} | ||
|
||
// The following functions are overrides required by Solidity. | ||
|
||
function tokenURI(uint256 tokenId) | ||
public | ||
view | ||
override(ERC721, ERC721URIStorage) | ||
returns (string memory) | ||
{ | ||
return super.tokenURI(tokenId); | ||
} | ||
|
||
function supportsInterface(bytes4 interfaceId) | ||
public | ||
view | ||
override(ERC721, ERC721URIStorage) | ||
returns (bool) | ||
{ | ||
return super.supportsInterface(interfaceId); | ||
} | ||
} |