opensea的介紹和發(fā)布NFT
介紹
一個(gè)開源solidity合集倉(cāng)庫(kù)
https://github.com/qdwds/smart-contracts
以太坊ERC721全棧開發(fā)開NFT合集從入門到項(xiàng)目實(shí)戰(zhàn)項(xiàng)目
https://learnblockchain.cn/course/31
https://edu.51cto.com/course/33566.html
一起學(xué)習(xí)吧
我們一起溝通、交流、學(xué)習(xí)吧!
openseaOpenSea 是一個(gè)
數(shù)字商品交易市場(chǎng),允許用戶交易非同質(zhì)化代幣(NFT)和其他數(shù)字商品。在 OpenSea 上,任何人都可以創(chuàng)建和出售自己的NFT,也可以購(gòu)買其他用戶創(chuàng)建的NFT。允許用戶在全球范圍內(nèi)進(jìn)行交易。此外,OpenSea 還為創(chuàng)作者和藝術(shù)家提供了一個(gè)展示他們作品的平臺(tái),讓更多人知道和欣賞他們的作品。
opensea上發(fā)行NFT
文檔
https://docs.opensea.io/docs/metadata-standards
{
"description": "YOUR DESCRIPTION",
"external_url": "YOUR URL",
"image": "IMAGE URL",
"name": "TITLE",
"attributes": [
{
"trait_type": "Base",
"value": "Starfish"
},
{
"trait_type": "Eyes",
"value": "Big"
}]
}
opensea網(wǎng)址
https://testnets.opensea.io/account
https://opensea.io/zh-CN
代碼實(shí)現(xiàn)
// https://raw.githubusercontent.com/qdwds/NFT-metadata/master/metadata/donkey/json/1.json
// contracts/GameItem.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
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)
{
uint256 newItemId = _tokenIds.current();
_mint(player, newItemId);
_setTokenURI(newItemId, tokenURI);
_tokenIds.increment();
return newItemId;
}
}
創(chuàng)建NFT
輸入要mint的地址和uri點(diǎn)擊transact等待上鏈
評(píng)論
圖片
表情
