Skip to content

Instantly share code, notes, and snippets.

@rpaskin
Forked from BetterProgramming/simplecollectible.sol
Created November 16, 2021 13:14
Show Gist options
  • Save rpaskin/045c1dcd2d0aec8fc0c9790a64c49b63 to your computer and use it in GitHub Desktop.
Save rpaskin/045c1dcd2d0aec8fc0c9790a64c49b63 to your computer and use it in GitHub Desktop.
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