Skip to content

Instantly share code, notes, and snippets.

@Filip3Dev
Created March 28, 2021 23:42
Show Gist options
  • Select an option

  • Save Filip3Dev/9d32f54f35719f3b748c36ba75a4833a to your computer and use it in GitHub Desktop.

Select an option

Save Filip3Dev/9d32f54f35719f3b748c36ba75a4833a to your computer and use it in GitHub Desktop.

Revisions

  1. Filip3Dev created this gist Mar 28, 2021.
    26 changes: 26 additions & 0 deletions AsgardToken.sol
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    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);
    }
    }