ERC-721 Standardı
Benzersiz olmayan belirteçler
ERC-721 Standardı, CoddyKit'te ücretsiz bir Web3 & DApp Development Fundamentals dersidir. Bu, 4 dersinin 1. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Web3 & DApp Development Fundamentals öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Web3 & DApp Development Fundamentals kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
What Is ERC-721?
ERC-721 is the standard for non-fungible tokens (NFTs). Unlike ERC-20, each token is unique and identified by a distinct tokenId.
NFTs represent ownership of one-of-a-kind items: art, collectibles, in-game assets, and more.
Fungible vs Non-Fungible
The key contrast:
- ERC-20 - all tokens identical and interchangeable, tracked by balance
- ERC-721 - each token unique, tracked by owner per tokenId
You own specific token #42, not a fraction of a pool.
Core Ownership Functions
ERC-721 tracks ownership with two key views:
ownerOf(tokenId)- who owns a specific tokenbalanceOf(owner)- how many tokens an address owns
<code>function ownerOf(uint256 tokenId) external view returns (address);
function balanceOf(address owner) external view returns (uint256);</code>Transfer Functions
ERC-721 provides transferFrom and the safer safeTransferFrom, which checks that a receiving contract can handle NFTs.
<code>function transferFrom(address from, address to, uint256 tokenId) external;
function safeTransferFrom(address from, address to, uint256 tokenId) external;</code>Approval Functions
Owners can authorize others to transfer specific tokens with approve, or grant blanket permission over all their tokens with setApprovalForAll.
<code>function approve(address to, uint256 tokenId) external;
function setApprovalForAll(address operator, bool approved) external;
function getApproved(uint256 tokenId) external view returns (address);
function isApprovedForAll(address owner, address operator) external view returns (bool);</code>Required Events
ERC-721 defines three events: Transfer, Approval, and ApprovalForAll. Note the tokenId is indexed so transfers of a specific NFT are easy to track.
<code>event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);</code>safeTransferFrom and onERC721Received
safeTransferFrom protects against NFTs getting stuck. If the recipient is a contract, it must implement onERC721Received and return the correct magic value, otherwise the transfer reverts.
<code>// receiving contract must implement:
function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data)
external returns (bytes4);</code>The Metadata Extension
Most NFTs implement the optional metadata extension adding name(), symbol(), and crucially tokenURI(tokenId), which points to the token's off-chain JSON metadata.
<code>function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);</code>ERC-165 Interface Detection
ERC-721 builds on ERC-165, which lets contracts advertise which interfaces they support via supportsInterface. Marketplaces use it to detect NFTs.
<code>function supportsInterface(bytes4 interfaceId) external view returns (bool);</code>Using OpenZeppelin ERC721
As with ERC-20, the practical approach is to inherit OpenZeppelin's audited ERC721 implementation and add your minting logic.
<code>// import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
// contract MyNFT is ERC721 {
// constructor() ERC721('MyNFT', 'MNFT') {}
// }</code>Where the Asset Lives
An NFT on-chain is just an id and an owner. The actual image or media usually lives off-chain (often on IPFS), referenced by the tokenURI. The chain proves ownership, not the file itself.
Quick Check
Test your understanding of the ERC-721 standard.
Recap
You learned the ERC-721 standard:
- NFTs are unique, identified by tokenId, tracked via
ownerOf - Transfers use
transferFromand safersafeTransferFrom - Approvals: per-token
approveand blanketsetApprovalForAll - Metadata extension adds
tokenURI; ERC-165 enables interface detection - Assets usually live off-chain, referenced by the URI
Yapay zeka eğitmeniyle Web3 & DApp Development Fundamentals öğren — ücretsiz
Tarayıcında gerçek kod yaz ve çalıştır, 7/24 yapay zeka eğitmeninden anında yardım al; web'de ya da uygulamada kaldığın yerden devam et.
- Kurslar
- 29
- Dersler
- 105
Sıkça Sorulan Sorular
“ERC-721 Standardı” dersi ücretsiz mi?
Evet — “ERC-721 Standardı” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Web3 & DApp Development Fundamentals kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Web3 & DApp Development Fundamentals kursu toplamda 4 dersten oluşur.
“ERC-721 Standardı” dersinde ne öğreneceğim?
Benzersiz olmayan belirteçler Web3 & DApp Development Fundamentals ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Web3 & DApp Development Fundamentals öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Web3 & DApp Development Fundamentals, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 1. dersidir.
“ERC-721 Standardı” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Web3 & DApp Development Fundamentals dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Web3 & DApp Development Fundamentals dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- ERC-721 Standardı
- NFT Üretme
- Belirteç Üst Verileri
- Pazar Yerleri