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 operation list #1098

Merged
merged 5 commits into from
Jun 7, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 20 additions & 3 deletions token-metadata/program/ProgrammableNFTGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Developer packages
Token Metadata
* :crab: Rust crate: [v1.9.0](https://crates.io/crates/mpl-token-metadata/1.9.0)
* :package: NPM package: [v2.9.0](https://www.npmjs.com/package/@metaplex-foundation/mpl-token-metadata/v/2.9.0)
* :crab: Rust crate: [v1.11.1](https://crates.io/crates/mpl-token-metadata/1.11.1)
* :package: NPM package: [v2.11.1](https://www.npmjs.com/package/@metaplex-foundation/mpl-token-metadata/v/2.11.1)

Token Authorization Rules
* :crab: Rust crate: [v1.2.0](https://crates.io/crates/mpl-token-auth-rules/1.2.0)
Expand Down Expand Up @@ -385,7 +385,7 @@ The latest release of the [Metaplex JS SDK v0.18.0](https://github.com/metaplex-

## 🏛️ Token Authorization Rules

There will be a separate Token Authorization Rules program that provides the ability to create and execute rules to restrict the token operations discussed above.
There is a separate Token Authorization Rules program that provides the ability to create and execute rules to restrict the token operations discussed above.

### Overview

Expand All @@ -398,6 +398,23 @@ There are **Primitive Rules** and **Composed Rules** that are created by combini

More details of the Token Authorization Rules program, including examples, can be found [here](https://github.com/metaplex-foundation/mpl-token-auth-rules/blob/main/README.md).

### Token Metadata Operations subject to Authorization Rules
febo marked this conversation as resolved.
Show resolved Hide resolved

Several operations involving `pNFT` on Token Metadata are subject to Token Authorization Rules – depending of the rule configured, the operation will be authorized or not. The creator (`update authority`) of an asset has the flexibility to manage these rules through the [`ProgrammableConfig`](https://github.com/metaplex-foundation/metaplex-program-library/blob/ad5f39c465676299951c91f8cf9216812b884531/token-metadata/program/src/state/metadata.rs#L364-L380) on a Metadata account.

The list of operations are:

- `Transfer:WalletToWallet`: operation representing a transfer between wallets (currently not in use)
- `Transfer:Owner`: operation representing a transfer initiated by the owner of the asset
- `Transfer:MigrationDelegate`: operation representing a transfer initiated by a `Migration` delegate
- `Transfer:SaleDelegate`: operation representing a transfer initiated by a `Sale` delegate
- `Transfer:TransferDelegate`: operation representing a transfer initiated by a `Transfer` delegate
- `Delegate:LockedTransfer`: operation representing the request to approve a `LockedTransfer` delegate, a delegate that can locked and transfer an asset to a predefined address
- `Delegate:Transfer`: operation representing the request to approve a `Transfer` delegate, a delegate that can transfer an asset
- `Delegate:Utility`: operation representing the request to approve a `Utility` delegate, a delegate that can lock and burn an asset
- `Delegate:Staking`: operation representing the request to approve a `Staking` delegate, a delegate that can lock an asset
- `Delegate:Sale`: operation representing the request to approve a `Sale` delegate, a delegate that can transfer an asset and disable transfers by the owner while the delegate is in place

## 🎬 Local Setup for Testing

The repository contains both Rust BPF and JavaScript/TypeScript. In order to setup the environment to run the tests, you will need to first clone the required repositories:
Expand Down