Skip to content

Instantly share code, notes, and snippets.

@lex-world
Created December 4, 2021 05:34
Show Gist options
  • Save lex-world/84966ff0080913c995011fc93327d522 to your computer and use it in GitHub Desktop.
Save lex-world/84966ff0080913c995011fc93327d522 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/nibbstack/erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/nibbstack/erc721/src/contracts/ownership/ownable.sol";
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
contract MyArtSale is
NFTokenMetadata,
Ownable
{
/**
* @dev Contract constructor. Sets metadata extension `name` and `symbol`.
*/
constructor()
{
nftName = "Lex's Art Sale";
nftSymbol = "LAS";
}
/**
* @dev Mints a new NFT.
* @param _to The address that will own the minted NFT.
* @param _tokenId of the NFT to be minted by the msg.sender.
* @param _uri String representing RFC 3986 URI.
*/
function mint(
address _to,
uint256 _tokenId,
string calldata _uri
)
external
onlyOwner
{
super._mint(_to, _tokenId);
super._setTokenUri(_tokenId, _uri);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment