nftbench / third_party /real_code /rc21 /sources /src /helpers /VemoWalletCollection.sol
OniReimu's picture
NFTBench 0.9.0 preview (part 8)
57eca40 verified
Raw History Blame Contribute Delete
1.07 kB
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract VemoWalletCollection is ERC721, Ownable {
uint256 private _nextTokenId;
mapping(uint256 => string) private _tokenURIs;
constructor(
string memory name,
string memory symbol,
address owner
) ERC721(name, symbol) Ownable(owner) {}
function safeMint(address to, string memory uri) public onlyOwner returns (uint256 tokenId){
tokenId = _nextTokenId++;
_safeMint(to, tokenId);
_setTokenURI(tokenId, uri);
}
function _setTokenURI(uint256 tokenId, string memory uri) internal {
_tokenURIs[tokenId] = uri;
}
function tokenURI(uint256 tokenId) public view override returns (string memory) {
return _tokenURIs[tokenId];
}
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721) returns (bool) {
return super.supportsInterface(interfaceId);
}
}