Skip to content

Instantly share code, notes, and snippets.

@brianfakhoury
Created May 22, 2021 13:13
Show Gist options
  • Save brianfakhoury/c30eab1d07fa41f206380fbc755a01b4 to your computer and use it in GitHub Desktop.
Save brianfakhoury/c30eab1d07fa41f206380fbc755a01b4 to your computer and use it in GitHub Desktop.
An NFT to track progress as JSON
// SPDX-License-Identifier: MIT
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";
contract newNFT is NFTokenMetadata, Ownable {
constructor() {
nftName = "Practical Crypto Progress Token";
nftSymbol = "PCPT";
}
function mint(address _to, uint256 _tokenId) external onlyOwner {
super._mint(_to, _tokenId);
super._setTokenUri(_tokenId, '{"day1": false,"day2": false,"day3": false,"gameChamp": false}');
}
function update(uint256 _tokenId, string calldata _uri) external onlyOwner {
super._setTokenUri(_tokenId, _uri);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment