Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

[NFTs] Allow to set the role to None #13591

Merged
merged 4 commits into from
Mar 14, 2023
Merged

Conversation

jsidorenko
Copy link
Contributor

This PR allows setting the Issuer/Admin/Freezer accounts to None without the ability to change it back (except for root calls).
This is useful for cases when the collection is created, all the items are minted and now we want to be 100% sure no one will mint any more items, or change the metadata, or disable some item's transfer.

@jsidorenko jsidorenko added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Mar 13, 2023
Copy link
Contributor

@gilescope gilescope left a comment

Choose a reason for hiding this comment

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

Love PRs that minimise trust.

@jsidorenko
Copy link
Contributor Author

bot rebase

@paritytech-processbot
Copy link

Rebased

@ruseinov
Copy link
Contributor

Curious why there isn’t any change to the logic that checks those roles, since they’re optional now - that should have reflected on the check logic?
One other question - what happens if the admin unsets itself?

@ruseinov ruseinov self-requested a review March 13, 2023 19:19
Copy link
Contributor

@ruseinov ruseinov left a comment

Choose a reason for hiding this comment

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

looks good, would still be nice to make sure the answers to my questions make it to github for posterity.

@jsidorenko
Copy link
Contributor Author

Curious why there isn’t any change to the logic that checks those roles, since they’re optional now - that should have reflected on the check logic?

That's the beauty of that PR :) All the business logic is already in place and was mostly set here: #13482, so now if you remove the Admin role and the previous admin will try to call some admin-related method, the validation won't allow that.

@jsidorenko
Copy link
Contributor Author

One other question - what happens if the admin unsets itself?

Only the collection's owner could unset the admin.

@jsidorenko
Copy link
Contributor Author

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 4f28d29 into master Mar 14, 2023
@paritytech-processbot paritytech-processbot bot deleted the js/unset-roles branch March 14, 2023 07:55
ukint-vs pushed a commit to gear-tech/substrate that referenced this pull request Apr 10, 2023
* Allow to unset the role

* Chore

* Array instead of vec

---------

Co-authored-by: parity-processbot <>
@redzsina redzsina added D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited and removed D5-nicetohaveaudit ⚠️ PR contains trivial changes to logic that should be properly reviewed. labels Apr 14, 2023
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* Allow to unset the role

* Chore

* Array instead of vec

---------

Co-authored-by: parity-processbot <>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders. D1-audited 👍 PR contains changes to fund-managing logic that has been properly reviewed and externally audited
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants