Skip to content

Instantly share code, notes, and snippets.

@marcozecchini
Created July 27, 2021 18:04
Show Gist options
  • Save marcozecchini/c1564336849047190f93d667fda35f00 to your computer and use it in GitHub Desktop.
Save marcozecchini/c1564336849047190f93d667fda35f00 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.25+commit.59dbf8f1.js&optimize=true&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.0;
import "https://github.com/0xcert/ethereum-erc721/src/contracts/tokens/nf-token-metadata.sol";
import "https://github.com/0xcert/ethereum-erc721/src/contracts/ownership/ownable.sol";
/**
* @dev This is an example contract implementation of NFToken with metadata extension.
*/
contract MyCIHEAMToken is
NFTokenMetadata,
Ownable
{
/**
* @dev Contract constructor. Sets metadata extension `name` and `symbol`.
*/
constructor()
{
nftName = "Certificazione di diplomi di laurea";
nftSymbol = "CIHEAM";
}
/**
* @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