ERC721:官方对 IERC721 提供的默认实现。 IERC721Metadata:定义合约的元数据信息;诸如:合约名字、标志、以及每个代币的 tokenURI。 Context:抽象合约,上下文;主要对msg对象做一些封装;例如:msg.Sender代表当前调用合约的用户。 IERC721Enumerable:提高合约的可访问性(非必须实现,但是一般我们的合约都会实现以提高可访问...
We can then invoke the smart contract to mint a non-fungible token with a unique token ID 101: peer chaincode invoke $TARGET_TLS_OPTIONS -C mychannel -n token_erc721 -c '{"function":"MintWithTokenURI","Args":["101", "https://example.com/nft101.json"]}' The mint function valid...
ERC721标准的 Token,每个 Token 均有不同的ID,不同ID可以有不同的解释,属于 no-fungible token(非同质化 Token,不可互换 Token)。 ERC1410标准的 Token 属于Partially-Fungible Token (部分可互换 Token ),将 ERC20/ERC777 中不存在解释属性的余额,附加额外的信息,从而划分成不同的部分,就可以做一些操作上的...
一个可接收NFT的合约必须实现ERC721TokenReceiver接口: interface ERC721TokenReceiver { /// @return `bytes4(keccak256("onERC721Received(address,uint256,bytes)"))` function onERC721Received(address _from, uint256 _tokenId, bytes data) external returns(bytes4); } transferFrom(): 用来转移NFTs, 方...
Counters.Counter private _tokenIds; constructor() ERC721("NFT-Example", "NEX") {} function mintNft(address receiver, string memory tokenURI) external onlyOwner returns (uint256) { _tokenIds.increment(); uint256 newNftTokenId = _tokenIds.current(); ...
Code Issues Pull requests The reference implementation of the ERC-721 non-fungible token standard. ethereum smart-contracts contract standard tokens token contracts implementation eth hacktoberfest erc721 non-fungible erc-721 Updated Aug 10, 2022 Solidity joan...
To work with ERC721 token as normal ERC20 token we need to create aERC20Adapterthat implements standard ERC20 methods, as for examplebalanceOfmethod. functionbalanceOf(address_owner)publicviewreturns(uint256) But in our case due to ERC721 structure for each_ownerthere can be many non-fungible...
Counter private _tokenIds; constructor() ERC721("NFT-Example", "NEX") {} function mintNft(address receiver, string memory tokenURI) external onlyOwner returns (uint256) { _tokenIds.increment(); uint256 newNftTokenId = _tokenIds.current(); _mint(receiver, newNftTokenId); _setTokenURI(...
ERC721 基本元数据,包括name、symbol、代币资源定位符tokenURI。 name:NFT 的名称 symbol:NFT 的符号表示 tokenURI:NFT 的图片资源定位符。 基本元数据是可以访问但不可以修改的,访问接口定义在 IERC20Metadata.sol 文件中。 OpenZeppelin 定义的 IERC20Metadata.sol 代码如下: pragma solidity ^0.8.0; import "...
}returnt.Ctx.ERC721Token.IsInTokenSysRoleMember(role, accountId) } 参数: role: string- 要检查的TokenSys角色的名称。 orgId: string- 当前组织中用户的成员服务提供者 (MSP) ID。 userId: string- 用户的用户名或电子邮件 ID。 返回: 成功后,将显示包含操作相关详细信息的消息。