Skip to content

Commit 0abe9a4

Browse files
authored
Update docs w/ metadata sync info (#280)
1 parent 1bc9172 commit 0abe9a4

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

README.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
# SPL Token Wrap Program
22

33
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/solana-program/token-wrap/main.yml?logo=GitHub)](https://github.com/solana-program/token-wrap/actions/workflows/main.yml)
4+
[![Crates.io](https://img.shields.io/crates/v/spl-token-wrap-cli)](https://crates.io/crates/spl-token-wrap-cli)
5+
[![npm](https://img.shields.io/npm/v/@solana-program/token-wrap)](https://www.npmjs.com/package/@solana-program/token-wrap)
46

5-
This program enables the creation of "wrapped" versions of existing SPL tokens, facilitating interoperability
6-
between different token standards. If you are building an app with a mint/token and find yourself wishing you could take
7+
This program enables the creation of "wrapped" versions of existing SPL tokens, facilitating interoperability between
8+
different token standards. If you are building an app with a mint/token and find yourself wishing you could take
79
advantage of some of the latest features of a specific token program, this might be for you!
810

11+
- **Program ID:** `TwRapQCDhWkZRrDaHfZGuHxkZ91gHDRkyuzNqeU5MgR`
12+
- **IDL:** [`./program/idl.json`](./program/idl.json)
13+
- **Docs & SDK Guide:** https://www.solana-program.com/docs/token-wrap
14+
915
## Features
1016

1117
* **Bidirectional Wrapping:** Convert tokens between SPL Token and SPL Token 2022 standards in either direction,
@@ -17,13 +23,15 @@ advantage of some of the latest features of a specific token program, this might
1723
* **Confidential Transfers by Default:** All wrapped tokens created under the Token-2022 standard automatically include
1824
the `ConfidentialTransferMint` extension, enabling the option for privacy-preserving transactions. This feature is
1925
immutable and requires no additional configuration.
20-
* **Transfer Hook Compatibility:** Integrates with tokens that implement the SPL Transfer Hook interface,
26+
* **Transfer Hook Compatibility:** Integrates with tokens that implement the SPL Transfer Hook interface,
2127
enabling custom logic on token transfers.
2228
* **Multisignature Support:** Compatible with multisig signers for both wrapping and unwrapping operations.
29+
* **Metadata Synchronization:** Syncs metadata from unwrapped tokens (both Metaplex and Token-2022 standards) to their
30+
wrapped counterparts.
2331

2432
## How It Works
2533

26-
It supports four primary operations:
34+
It supports the following primary operations:
2735

2836
1. **`CreateMint`:** This operation initializes a new wrapped token mint and its associated backpointer account. Note,
2937
the caller must pre-fund this account with lamports. This is to avoid requiring writer+signer privileges on this
@@ -60,6 +68,20 @@ It supports four primary operations:
6068
mint.
6169
* After closing the stuck escrow, the client is responsible for recreating the ATA with the correct extensions.
6270

71+
5. **`SyncMetadataToToken2022`**: This operation copies metadata from an unwrapped mint to its wrapped Token-2022
72+
mint's `TokenMetadata` extension.
73+
* It initializes the `TokenMetadata` extension on the wrapped mint if it doesn't already exist.
74+
* The caller is responsible for pre-funding the wrapped mint account with enough lamports to cover the rent for the
75+
added space.
76+
* Supports: `SPL Token -> Token-2022` and `Token-2022 -> Token-2022`.
77+
78+
6. **`SyncMetadataToSplToken`**: This operation copies metadata from an unwrapped mint to the Metaplex metadata
79+
account of its wrapped SPL Token mint.
80+
* It can create the Metaplex metadata account if it doesn't exist or update an existing one.
81+
* The `wrapped_mint_authority` PDA acts as the payer for the Metaplex program CPI and must be pre-funded with
82+
sufficient lamports to cover rent for the Metaplex account.
83+
* Supports: `Token-2022 -> SPL Token` and `SPL Token -> SPL Token`.
84+
6385
The 1:1 relationship between wrapped and unwrapped tokens is maintained through the escrow mechanism, ensuring that
6486
wrapped tokens are always fully backed by their unwrapped counterparts.
6587

0 commit comments

Comments
 (0)