Created
March 28, 2021 23:42
-
-
Save Filip3Dev/9d32f54f35719f3b748c36ba75a4833a to your computer and use it in GitHub Desktop.
Token ERC-721 Asgard
This file contains 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.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