Skip to content

Instantly share code, notes, and snippets.

@Filip3Dev
Created March 28, 2021 23:42
Show Gist options
  • Save Filip3Dev/9d32f54f35719f3b748c36ba75a4833a to your computer and use it in GitHub Desktop.
Save Filip3Dev/9d32f54f35719f3b748c36ba75a4833a to your computer and use it in GitHub Desktop.
Token ERC-721 Asgard
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 Asgard is NFTokenMetadata, Ownable {
uint256 private count = 0;
mapping(address => uint256) tokens;
constructor() {
nftName = "Asgard Market";
nftSymbol = "ASG";
}
function getCount() public view returns (uint256){
return count;
}
function mint( address _to, string calldata _uri) external onlyOwner {
uint256 tokenId = count+1;
tokens[_to] = tokenId;
count = tokenId;
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