showing results for - "pinata for nft"
Lotta
16 Jan 2019
1pragma solidity ^0.7.0;
2
3import "hardhat/console.sol";
4import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
5import "@openzeppelin/contracts/utils/Counters.sol";
6
7contract Minty is ERC721 {
8    using Counters for Counters.Counter;
9    Counters.Counter private _tokenIds;
10
11    constructor(string memory tokenName, string memory symbol) ERC721(tokenName, symbol) {
12        _setBaseURI("ipfs://");
13    }
14
15    function mintToken(address owner, string memory metadataURI)
16    public
17    returns (uint256)
18    {
19        _tokenIds.increment();
20
21        uint256 id = _tokenIds.current();
22        _safeMint(owner, id);
23        _setTokenURI(id, metadataURI);
24
25        return id;
26    }
27}
28
similar questions
queries leading to this page
pinata for nft