Created
March 2, 2021 18:51
-
-
Save BetterProgramming/019eca4081147646173cedcf5507c0b3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
pragma solidity 0.6.6; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
contract SimpleCollectible is ERC721 { | |
uint256 public tokenCounter; | |
constructor () public ERC721 ("Dogie", "DOG"){ | |
tokenCounter = 0; | |
} | |
function createCollectible(string memory tokenURI) public returns (uint256) { | |
uint256 newItemId = tokenCounter; | |
_safeMint(msg.sender, newItemId); | |
_setTokenURI(newItemId, tokenURI); | |
tokenCounter = tokenCounter + 1; | |
return newItemId; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment