You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
545 B
20 lines
545 B
11 months ago
|
// 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;
|
||
|
}
|
||
|
}
|