20 lines
545 B
Solidity
20 lines
545 B
Solidity
// contracts/GameItem.sol
|
|
// SPDX-License-Identifier: MIT
|
|
pragma solidity ^0.8.20;
|
|
|
|
import {ERC721URIStorage, ERC721} from "../../../../token/ERC721/extensions/ERC721URIStorage.sol";
|
|
|
|
contract GameItem is ERC721URIStorage {
|
|
uint256 private _nextTokenId;
|
|
|
|
constructor() ERC721("GameItem", "ITM") {}
|
|
|
|
function awardItem(address player, string memory tokenURI) public returns (uint256) {
|
|
uint256 tokenId = _nextTokenId++;
|
|
_mint(player, tokenId);
|
|
_setTokenURI(tokenId, tokenURI);
|
|
|
|
return tokenId;
|
|
}
|
|
}
|