mirror of
https://github.com/autistic-symposium/web3-starter-sol.git
synced 2025-07-23 15:10:48 -04:00
Clean up
This commit is contained in:
parent
c2d0866191
commit
db37d209ab
58 changed files with 4663 additions and 1043 deletions
28
basic_knowledge/workspace/hardhat/contracts/MiaNFT.sol
Normal file
28
basic_knowledge/workspace/hardhat/contracts/MiaNFT.sol
Normal file
|
@ -0,0 +1,28 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity >=0.7.3 <0.9.0;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
|
||||
import "@openzeppelin/contracts/utils/Counters.sol";
|
||||
import "@openzeppelin/contracts/access/Ownable.sol";
|
||||
|
||||
|
||||
contract MiaNFT is ERC721, Ownable {
|
||||
|
||||
using Counters for Counters.Counter;
|
||||
Counters.Counter private _tokenIds;
|
||||
|
||||
constructor() public ERC721("Mia's NFT, "NFT") {}
|
||||
|
||||
function mintNFT(address recipient, string memory tokenURI)
|
||||
public onlyOwner
|
||||
returns (uint256)
|
||||
{
|
||||
_tokenIds.increment();
|
||||
|
||||
uint256 newItemId = _tokenIds.current();
|
||||
_mint(recipient, newItemId);
|
||||
_setTokenURI(newItemId, tokenURI);
|
||||
|
||||
return newItemId;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue