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

feat(pop-api): nonfungibles use case #335

Open
5 of 20 tasks
Tracked by #330
chungquantin opened this issue Oct 10, 2024 · 1 comment · Fixed by #382 or #391 · May be fixed by #380, #388 or #389
Open
5 of 20 tasks
Tracked by #330

feat(pop-api): nonfungibles use case #335

chungquantin opened this issue Oct 10, 2024 · 1 comment · Fixed by #382 or #391 · May be fixed by #380, #388 or #389
Assignees
Labels

Comments

@chungquantin
Copy link
Collaborator

chungquantin commented Oct 10, 2024

Description

In an effort to provide a unifying experience for developers to access runtime functionality for non-fungible tokens, APIs compliant to the PSP34 standard will be provided, as well as a set of extra functions (see Management). The interface as defined by this specification will be accessible for smart contracts via:

use pop_api::nonfungibles::<function>;

Note that the lack of version equals latest. As an example, the user could explicitly specify the version as:

use pop_api::v0::nonfungibles::<function>;

The introduced changes includes changes made to the forked pallet-nfts following what has been discussed in the internal spec. Adding and making changes to two new pallets:

  • pallets/nfts: Changes made to the forked version to add new storage items to optimize the performance for the contract functionalities
  • pallets/api/nonfungibles: Built on top of the pallet-nfts to expose neccessary functions for the contract API implementation.

API Development Tracking

  • Contract size before: N/A
  • Contract size after: N/A
  • Does it follow any contract standard?

  • Does it require a new pallet implementation?

    • Name of the pallet: pallet-api/nonfungibles
  • Does it require forking any upstream dependencies?

    • Name of the pallet: pallet-nfts
    • Link to reference: https://docs.rs/pallet-nfts/latest/pallet_nfts/
    • Reason why forking the pallet: The upstream pallet-nfts module is primarily intended for integration as a runtime pallet, which introduces inefficiencies when used within the context of smart contracts. To create a high-performance pop-api/nonfungibles library that adheres to the PSP34 standard, the optimizations and changes are required.
      • PSP34 interface compatibility: The pallet-nfts interface is not directly aligned with the PSP34 standard.
      • The storage structure in pallet-nfts is optimized for runtime operations, which may involve redundant read/write operations when accessed via contracts.
  • Does it require changes made to pop-drink crate?

Related Issues & Pull Requests

  • Specification

Runtime

Pallet

Contract

Drink (optional)

@chungquantin chungquantin changed the title feat(devnet): non-fungibles use case feat(devnet): pop-api + non-fungibles use case Oct 10, 2024
@chungquantin
Copy link
Collaborator Author

chungquantin commented Nov 13, 2024

@chungquantin chungquantin self-assigned this Nov 14, 2024
@chungquantin chungquantin linked a pull request Nov 19, 2024 that will close this issue
@chungquantin chungquantin linked a pull request Nov 19, 2024 that will close this issue
12 tasks
@chungquantin chungquantin changed the title feat(devnet): pop-api + non-fungibles use case feat(devnet): non-fungibles use case Nov 19, 2024
@chungquantin chungquantin changed the title feat(devnet): non-fungibles use case feat(pop-api): nonfungibles use case Nov 29, 2024
@chungquantin chungquantin linked a pull request Nov 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment