代码拉取完成,页面将自动刷新
This repository contains an example implementation of a non-fungible token contract in Rust which uses near-contract-standards and workspaces-rs tests.
Note: If you'd like to learn how to create an NFT contract from scratch that explores every aspect of the NEP-171 standard including an NFT marketplace, check out the NFT Zero to Hero Tutorial.
Install cargo-near
and run:
cargo near build
Note: to avoid issues, be sure to update your Rust compiler with
rustup update stable
cargo test
To deploy manually, install cargo-near
and run:
# Create a new account
cargo near create-dev-account
# Deploy the contract on it
cargo near deploy <account-id>
# Initialize the contract
near call <account-id> new_default_meta '{"owner_id": "<account-id>"}' --accountId <account-id>
# View metadata
near view <account-id> nft_metadata
# Mint a NFT
near call <account-id> nft_mint '{"token_id": "0", "token_owner_id": "<account-id>", "token_metadata": { "title": "Olympus Mons", "description": "Tallest mountain in charted solar system", "media": "https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Olympus_Mons_alt.jpg/1024px-Olympus_Mons_alt.jpg", "copies": 1}}' --accountId <account-id> --deposit 0.1
# View tokens for owner
near view <account-id> nft_tokens_for_owner '{"account_id": "<owner_id>"}'
# Transfer a NFT
near call <account-id> nft_transfer '{"token_id": "0", "receiver_id": "<receiver-id>", "memo": "transfer ownership"}' --accountId <account-id> --depositYocto 1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型