substrate
substrate copied to clipboard
[NFTs] Rework permissions model
This PR changes the permissions model in the pallet-nfts:
- an Admin account will no longer be able to transfer or burn items it doesn't own;
- to destroy the collection, there should be 0 items left;
- some actions were moved from one role to another to simplify accounts management.
For simple collections, the same account usually has all the roles. But if we take complex collections, then each role here represents a separate service with its own responsibilities (e.g. items issuance), and it should be simple to rotate the keys of those services. At the same time, the main owner's account is usually used just to setup the collection and the private key is kept in cold storage afterwards. Given all that, a bunch of frequently called actions were moved from the Owner role to Admin or Issuer.
So, here is the list of the main actions each role will be able to do:
Owner
- destroy collection
- redeposit
- set_collection_max_supply
- lock_collection (moved from Freezer) - (make non-transferable, fix max supply, lock collection metadata/attributes) -> one time call
Admin
- set_attribute/set_metadata (in the CollectionOwner namespace) (moved from Owner)
- set_attributes_pre_signed (moved from Owner)
- lock_item_properties (moved from Owner) - (lock item metadata/attributes) -> one time call
Freezer
- lock_item_transfer
- unlock_item_transfer
Issuer
- mint
- force_mint (with custom item config)
- mint_pre_signed (moved from Owner)
- update_mint_settings (moved from Owner)
This PR closes: https://github.com/paritytech/substrate/issues/13171
@jsidorenko that looks great! Thanks for adapting so quickly.
One question:
- Why is this
B0-silentalthough it containsE0-runtime_migration?
@jsidorenko that looks great! Thanks for adapting so quickly.
One question:
- Why is this
B0-silentalthough it containsE0-runtime_migration?
It's because I'm still learning the labels science :)
bot rebase
Rebased
bot rebase
Rebased
bot bench $ pallet dev pallet_nfts
@jsidorenko https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2507636 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_nfts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 35-88256996-026f-445e-a2ff-4f87c0c19640 to cancel this command or bot cancel to cancel all commands in this pull request.
@jsidorenko Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_nfts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2507636 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2507636/artifacts/download.
bot bench $ pallet dev pallet_nfts
@jsidorenko https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2508377 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_nfts. Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.
Comment bot cancel 40-24f5b93a-3230-4f20-8b95-50edb54d8710 to cancel this command or bot cancel to cancel all commands in this pull request.
@jsidorenko Command "$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" pallet dev pallet_nfts has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2508377 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2508377/artifacts/download.
bot merge
This pull request has been mentioned on Polkadot Forum. There might be relevant details there:
https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-40/2468/1