Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRC-721; Non-Fungible Token Standard #2

Closed
bitzoic opened this issue May 1, 2023 · 1 comment
Closed

SRC-721; Non-Fungible Token Standard #2

bitzoic opened this issue May 1, 2023 · 1 comment
Labels
Draft This standard is currently in draft. Experimentation and feedback is encouraged. SRC 721 Label used to filter for the standard issue

Comments

@bitzoic
Copy link
Member

bitzoic commented May 1, 2023

Abstract

The following standard allows for the implementation of a standard API for Native Non-Fungible Tokens (NFT) using the Sway Language. This standard provides basic functionality as well as on-chain metadata for other applications to use.

A Non-Fungible Token is a unique token that has an identifier that distinguishes itself from other tokens within the same token contract. These tokens are not fungible with one another and may contain metadata or other traits giving them distinctive characteristics.

Some common applications of an NFT include artwork/collectibles, DeFi short positions, deeds, and more.

Motivation

A standard interface for Non-Fungible Tokens on Fuel allows external applications to interact with each token individually, whether that be decentralized exchanges, wallets, or Fuel's Scripts and Predicates.

Prior Art

The SRC-721 Non-Fungible Token Standard naming pays homage to the ERC-721 Non-Fungible Token Standard seen on Ethereum.

There has been a discussion of the Non-Fungile Token Standard on the Fuel Forum. This discussion can be found here.

There has also been a Non-Fungile Token Standard implementation added to the Sway-Libs repository before the creation of the Sway-Standards repository. The introduction of this standard in the Sway-Standards repository will deprecate the Sway-Libs Non-Fungible Token Standard.

Specification

The Non-Fungible Token Standard inherits the specification and functionality from the SRC-20 standard. Non-Fungible Tokens on Fuel are Native Assets.

Restrictions

  • Non-Fungible Tokens SHALL have a total supply of one per asset.
  • Non-Fungible Tokens SHALL have a decimal of 0u8.

Rationale

As the SRC-721 Fungible Token Standard leverages Native Assets on Fuel, we do not require the implementation of certain functions such as transfer. This is done directly within the FuelVM and there is no smart contract that requires updating of balances. As Fuel is UTXO based, any transfer events may be indexed on transaction receipts.

Following this, we have omitted the inclusion of any transfer functions or events. The provided specification outlines only the required functions and events to implement fully functional Non-Fungible tokens on the Fuel Network. Additional functionality and properties may be added as needed.

Backwards Compatibility

This standard extends the SRC-20 standard.

Security Considerations

This standard does not introduce any security concerns, as it does not call external contracts, nor does it define any mutations of the contract state.

Example ABI

abi MyNFT {
    #[storage(read)]
    fn total_supply(asset: b256) -> u64;
    #[storage(read)]
    fn total_assets() -> u64;
    fn decimals(asset: b256) -> u8;
    #[storage(read)]
    fn name(asset: b256) -> String;
    #[storage(read)]
    fn symbol(asset: b256) -> String;
}

This draft standard is to be released as v0.1.

@bitzoic bitzoic added the SRC 721 Label used to filter for the standard issue label May 1, 2023
@bitzoic bitzoic pinned this issue May 1, 2023
@bitzoic bitzoic added the Draft This standard is currently in draft. Experimentation and feedback is encouraged. label May 2, 2023
@bitzoic
Copy link
Member Author

bitzoic commented Jun 22, 2023

This issue has been closed in favor of #1 with applied restrictions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Draft This standard is currently in draft. Experimentation and feedback is encouraged. SRC 721 Label used to filter for the standard issue
Projects
None yet
Development

No branches or pull requests

1 participant