Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions contracts/NFTContract.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";

contract NFTContract is ERC721 {

uint256 private _tokenIds = 0;
uint256 public PRICE_PER_TOKEN = 0.01 ether;

constructor() ERC721("NFTContract", "NFT")
{}

function mintNFT( address owner )
payable
external
returns (uint256)
{
require(PRICE_PER_TOKEN <= msg.value, "Ether paid is incorrect");
uint256 newItemId = _tokenIds;
_safeMint(owner, newItemId);

_tokenIds++;
return newItemId;
}
}