0
点赞
收藏
分享

微信扫一扫

阿里云服务器租用一年多少钱?2024年最新阿里云租用价格

杰森wang 03-23 06:00 阅读 2

ERC-721

Smart Contact

// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import {ERC721URIStorage, ERC721} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";

contract GameItem is ERC721URIStorage {

    uint256 private _nextTokenId;

    constructor() ERC721("CryptoCat", "CAT") {}

    function awardItem(address player, string memory tokenURI)
        public
        returns (uint256)
    {
        uint256 tokenId = _nextTokenId++;
        _mint(player, tokenId);
        _setTokenURI(tokenId, tokenURI);

        return tokenId;
    }
}

编译&部署

deploy

scan查看合约信息

  • 部署合约的交易详情
  • Token详情

CAT

添加NFT

所需参数:

0x6e0eE795051b89193273f7A9df1B4393D97ba563,https://s21.ax1x.com/2024/03/19/pFRhlOf.png

add_nft

MetaMask中导入NFT

metamask

关注我,一起进入Web3的世界

举报

相关推荐

0 条评论