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

Add token transferable flag to NFT and SFT pallets #925

Closed
wants to merge 9 commits into from

Conversation

JasonTulp
Copy link
Contributor

@JasonTulp JasonTulp commented Feb 11, 2025

Description

  • This PR adds token level control over the ability to transfer NFT or SFT tokens. This is achieved by adding a set_token_transferable_flag extrinsic to each pallet.

Context & Background

  • Previously we had this functionality at the collection level, however in a move towards supporting Soulbound EIP-5484 tokens, this will need to be added at the token level.

Notes & Additional Information

  • To prevent storage migrations when adding soulbound tokens, and to optimise storage read/writes, the TokenUtilityFlags struct includes TokenBurnAuthority field which is currently unused.
  • Variable benchmarks have been added to the NFT.transfer benchmark to account for the extra storage read per serial_number
  • Currently the set_token_transferable_flag extrinsic is only callable by the collection owner. In future, this ownership model may be expanded to allow for more granular permissions control.

Related Issues


Release Notes

Key Changes

Type of Change

  • Runtime Changes
  • Client Changes

API Changes

Storage Changes

Added

  • Nft: TokenUtilityFlags
  • Sft: TokenUtilityFlags

Extrinsic Changes

Added

  • Nft: set_token_transferable_flag
  • Sft: set_token_transferable_flag

Event Changes

Added

  • Nft: TokenTransferableFlagSet
  • Sft: TokenTransferableFlagSet

@JasonTulp JasonTulp changed the title Add token transferable flag to NFT pallet Add token transferable flag to NFT and SFT pallets Feb 12, 2025
@JasonTulp JasonTulp marked this pull request as ready for review February 20, 2025 20:04
@JCSanPedro JCSanPedro mentioned this pull request Feb 23, 2025
2 tasks
@surangap surangap self-requested a review February 24, 2025 04:17
Copy link
Contributor

@surangap surangap left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. need ci bench

@JasonTulp
Copy link
Contributor Author

Changes from this PR are included in the soulbound changes: #928

@JasonTulp JasonTulp closed this Feb 26, 2025
@JasonTulp JasonTulp deleted the feat/token-transferrable-flag branch February 26, 2025 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants