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(devnet): non-fungibles use case #335

Open
5 tasks
Tracked by #330
chungquantin opened this issue Oct 10, 2024 · 1 comment · Fixed by #382 · 4 remaining pull requests
Open
5 tasks
Tracked by #330

feat(devnet): non-fungibles use case #335

chungquantin opened this issue Oct 10, 2024 · 1 comment · Fixed by #382 · 4 remaining pull requests
Assignees
Labels

Comments

@chungquantin
Copy link
Collaborator

chungquantin commented Oct 10, 2024

Nonfungible contracts size:

Original wasm size: 61.5K, Optimized: 21.7K

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 PR includes changes made to the forked pallet-nfts following what has been discussed in the internal spec. Introducing two new pallets;

  • pallets/nfts: Changes made to the forked version to add new storage items AccountBalance and Allowances and update the following logic + unit tests to support the new storage items.
  • pallets/api/nonfungibles: Built on top of the pallet-nfts to expose READs and DISPATCHs for pop-api library.

The Nonfungible API provides the contract ability to mint / burn a new item, transfer and approve following the PSP34 Standard.
There are additional features to manage the Nonfungible such as create / destroy a collection, set / clear metadata, set / clear / approve / cancel_approve item attribute.

pallet + pop-api

example contracts

pop-drink

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment