Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
一个在 mint 时需要消耗自定义 Coin (SnowCoin) 的 NFT 合约。
目录
1. 获取 mint NFT 所需的 SnowCoin
执行成功后查询余额。
可以看到目前余额为 10000,成功获取到了 SnowCoin。
2. 创建 Collection
观察输出中出现了 CreateCollectionEvent,说明创建 Collection 成功。
使用 event_id 查询 Collection 的 ObjectId
可以得到 Collection ObjectId 为
0x175fccfc454a288ea37f54fa00dd79e8bad13f2de5cfeb24d9787bb0ca0ebeef
。点击展开详细输出
3. mint NFT
使用第一步得到的 Collection ObjectId mint NFT:
rooch move run --function default::nft::mint_entry --args object_id:0x175fccfc454a288ea37f54fa00dd79e8bad13f2de5cfeb24d9787bb0ca0ebeef --args String:'Snow NFT 0001'
观察输出中 status 为 executed,说明 mint NFT 成功。
4. 查询账号拥有的 NFT 信息
可以从输出中看到 NFT 的 name 为 Snow NFT 0001,这就是刚刚 mint 的 NFT。