Permission settings

There are three kinds of permissions in the PPL-NFT program, namely MINT_AUTHORITY, FREEZE_AUTHORITY, CLOSE_AUTHORITY. FREEZE_AUTHORITY and CLOSE_AUTHORITY have been seen in the above example-change account status, which are mainly used to verify whether the freeze and burn instruction permissions are valid.

MINT_AUTHORITY is the operation permission of mint account, which can be used to perform mint_to operation, and update FREEZE_AUTHORITY and other mint account attribute operations.

Eg. Set FREEZE_AUTHORITY. As NFT- 62Tt6NNUxQbBYx6x5P1s42t7KWQdDamn9ATb6Ls5HYVv account has been closed, we mint a new NFT account to complete the following example, the new NFT address- 8ZXhM6qBQe8GZJNs9dxvwM1RrmAnCr2y66P7azodR2gU. Use the authorize instruction to change the account permissions.

$ ppl-nft authorize --address 2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7
XQg9aug6uKs --type freeze --auth-keypair /root/.config/put/id2.
json 
authorize a FreezeAccount authority to  2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7XQg9aug6uKs
address 2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7XQg9aug6uKs auth_type authority change to 97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
Signature: 5wVUYysw645YqQMRLjnrBvoqEDQtz3cgih4xKEfqPNXVoHHZyZZnyJ12jELP5sP8yjx6jHR2WS7bj5LUUoqzpKaX

Authorize instruction parameter where address is mint account address, type specifies which type of permission is updated.

The optional values are freeze, close, mint corresponding to FREEZE_AUTHORITY, CLOSE_AUTHORITY, MINT_AUTHORITY permission. auth-keypair is the new permission signer file, if it is not set, the corresponding permission will become None.

To query mint account information after setting freeze permissions:

$ ppl-nft mint-info 2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7XQg9aug6uKs

Already Supply: 2
Total Supply: 100
Mint: 2ZYMxZojdocSbwcGg4W92H3hVE9qgMBo7XQg9aug6uKs
Name: moon
Symbol: put-nft1
Icon uri: http://puttest.com/nft/icon/best-nft-icon
Mint authority: BRxWruwQv3berDJELRM73dtp7f4712aiodZ6KCY4RLkq
Freeze authority: 97pqCNMq4NUBVa6DSabNiRPQAbtM8ixEDvXYWQCPLxBi
Initialized: true

After setting FREEZE_AUTHORITY only through freeze permission to freeze NFT, using mint permission will report the error.

The permission does not match. The freeze operation can be completed with the freeze authority permission.

Check the NFT status.

You can see that the freeze operation has taken effect.

Setting CLOSE_AUTHORITY and MINT_AUTHORITY is the same as the freeze method, please refer to the ppl-nft help information for details.

Last updated