Skip to content

Instantly share code, notes, and snippets.

@snaketh4x0r
Last active April 19, 2020 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snaketh4x0r/6968fa193cf7b46e801529478375e737 to your computer and use it in GitHub Desktop.
Save snaketh4x0r/6968fa193cf7b46e801529478375e737 to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.17;
import "https://github.com/snaketh4x0r/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721Full.sol";
import "https://github.com/snaketh4x0r/openzeppelin-contracts/blob/master/contracts/drafts/Counters.sol";
contract NFTTest is ERC721Full {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721Full("TestTok", "TOK") public {
}
function mintToken(address _reciever, string memory tokenURI) public returns (uint256) {
_tokenIds.increment();
uint256 newTokId = _tokenIds.current();
_mint(_reciever, newTokId);
_setTokenURI(newTokId, tokenURI);
return newTokId;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment