编写 NFT 合约并铸造你的 NFT [Figment.io 学习]

Write an NFT Contract & mint your NFT [Figment.io Learning]

正在阅读 figment.io 上的学习文档,想知道我遗漏了什么。我的想法是这里的文档需要一些更新,但我可能是错的。首先,我们在本课中下载的 GitHub 存储库没有路径 /contracts/rust/Cargo.toml。其次,repo 还缺少 package.json,这会导致 yarn build:rs 的初始尝试失败。创建一个简单的 package.json,如下所示:

        {
            "name": "my-supercool-package"
        }

克服了指示无法找到 package.json 的错误,但失败并显示以下内容:

yarn run v1.22.17
error Command "build:rs" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

所有这些都是测试的一部分还是 figment.io 上的文档需要更新?

您是对的,Figment 中提到的 GitHub 存储库不包含您学习本教程所需的文件和文件夹。我猜 GitHub 存储库中的原始代码此后已更新。看起来 Figment 上的教程也已过时。指的是NEP-4标准

NEP-4, which is defined in a language-independent way that is more compatible with NEAR.

但是,不推荐使用,因为它已经过时并且不符合 NEAR SDK 目前设定的标准。最好遵循 NEP-171 标准。

话虽如此,我想我会直接按照 GitHub repo 上的说明进行操作。或许可以使用 Figment 教程作为补充,了解一般原理(虽然标准不同。)