#Ethereum #Projekt #NFT #TragbarNFT
INTRODUCTION TO SMART CONTRACTS
INTERACT WITH OTHER CONTRACTS FROM SOLIDITY
DEPLOYING YOUR FIRST SMART CONTRACT
HOW TO IMPLEMENT AN ERC-721 MARKET
2 Factor authentication with Smart Contracts
Node.js Tutorial for Beginners: Learn Node in 1 Hour
Learn Express Middleware In 14 Minutes
Live Server Extension in Visual Studio Code
Using nodemon with NodeJS Servers
Node.js Tutorial for Beginners: Learn Node in 1 Hour
Learn Express Middleware In 14 Minutes
Live Server Extension in Visual Studio Code
Using nodemon with NodeJS Servers
// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
contract GameItem is ERC721URIStorage {
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
constructor() ERC721("GameItem", "ITM") {}
function awardItem(address player, string memory tokenURI)
public
returns (uint256)
{
_tokenIds.increment();
uint256 newItemId = _tokenIds.current();
_mint(player, newItemId);
_setTokenURI(newItemId, tokenURI);
return newItemId;
}
}