You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/Transceiver.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
The Transceiver is intended to offer a protocol-agnostic interface for sending and receiving cross-chain messages. For Native Token Transfers, this entails initiating attestation generation on the source chain, verifying the resulting attestation on the destination chain, and delivering the message to the associated `NttManager`.
6
6
7
-
In the provided implementations ([EVM](/evm/src/Transceiver/Transceiver.sol)/[SVM](/solana/programs/example-native-token-transfers/src/transceivers/wormhole/)), Transceiver are intended to have a many-to-one or one-to-one relationship with Managers.
7
+
In the provided implementations ([EVM](/evm/src/Transceiver/Transceiver.sol)/[SVM](/solana/programs/ntt-transceiver/src/wormhole/)), Transceivers are intended to have a many-to-one relationship with Managers.
Copy file name to clipboardexpand all lines: solana/README.md
+61-51
Original file line number
Diff line number
Diff line change
@@ -1,21 +1,5 @@
1
1
# Solana
2
2
3
-
## Prequisities
4
-
5
-
Ensure that you are using the correct version of the Solana and Anchor CLI tools by consulting `Anchor.toml`.
6
-
7
-
```toml
8
-
[toolchain]
9
-
anchor_version = "0.29.0"# CLI
10
-
solana_version = "1.18.10"
11
-
```
12
-
13
-
You will also need to install the toolchain listed in `rust-toolchain`. You can verify this by running:
14
-
15
-
```sh
16
-
rustup show
17
-
```
18
-
19
3
## Design Overview
20
4
21
5
### Message Lifecycle (Solana)
@@ -41,14 +25,14 @@ The program checks rate limits via the `consume_or_delay` function during the tr
41
25
42
26
If the transfer amount fits within the current capacity:
43
27
44
-
- Reduce the current capacity
45
-
- Refill the inbound capacity for the destination chain
28
+
- Reduce the current capacity.
29
+
- Refill the inbound capacity for the destination chain.
46
30
- Add the transfer to the outbox with `release_timestamp` set to the current timestamp, so it can be released immediately.
47
31
48
32
If the transfer amount does not fit within the current capacity:
49
33
50
-
- If `shouldQueue = true`, add the transfer to the outbox with `release_timestamp` set to the current timestamp plus the configured `RATE_LIMIT_DURATION`.
51
-
- If `shouldQueue = false`, revert with a `TransferExceedsRateLimit` error
34
+
- If `should_queue = true`, add the transfer to the outbox with `release_timestamp` set to the current timestamp plus the configured `RATE_LIMIT_DURATION`.
35
+
- If `should_queue = false`, revert with a `TransferExceedsRateLimit` error.
52
36
53
37
3.**Send**
54
38
@@ -76,7 +60,7 @@ The following will be produced in the program logs:
76
60
Program log: Instruction: ReceiveMessage
77
61
```
78
62
79
-
[`redeem`] checks the inbound rate limit and places the message in an Inbox. Logic works the same as the outbound rate limit we mentioned previously.
63
+
[`redeem`] checks the inbound rate limit and places the message in an Inbox. The logic works the same as the outbound rate limit we mentioned previously.
80
64
81
65
The following will be produced in the program logs:
82
66
@@ -109,51 +93,77 @@ The additional payload field should then have your custom struct available every
109
93
110
94
You can then modify [release_outbound](./programs/example-native-token-transfers/src/transceivers/wormhole/instructions/release_outbound.rs) and [redeem](./programs/example-native-token-transfers/src/instructions/redeem.rs) to generate and process the additional payload.
111
95
112
-
## Testing
96
+
## SPL Multisig Support
97
+
98
+
Using [SPL Multisig](https://docs.rs/spl-token/latest/spl_token/state/struct.Multisig.html), you can enable multiple minters on Solana. For example, this allows NTT to burn/mint tokens without being the only authority to do so, i.e. the asset issuer can also retain mint authority.
99
+
100
+
1.**Create valid SPL Multisig**
101
+
102
+
The SPL Multisig should meet the following criteria to qualify as a valid mint authority for NTT:
103
+
104
+
- Number of signers required ([m](https://docs.rs/spl-token/latest/spl_token/state/struct.Multisig.html#structfield.m)) should be `1`
105
+
- One of the [signers](https://docs.rs/spl-token/latest/spl_token/state/struct.Multisig.html#structfield.signers) must be the `token_authority` PDA
106
+
107
+
2.**Set valid SPL Multisig as mint authority**
108
+
109
+
You can set the created multisig as the mint authority via the [`accept_token_authority`] instruction.
110
+
111
+
> If the current mint authority is also an SPL Multisig, use the [`accept_token_authority_from_multisig`] instruction instead.
112
+
113
+
3.**Use [`*_multisig`] instruction variants**
113
114
114
-
The test files are loacated in the `sdk/solana/__tests__/` directory
115
+
To initialize NTT, use the [`initialize_multisig`] instruction instead.
115
116
116
-
In order to run them, the Solana programs must be built and their IDL made available to the SDK.
117
+
In `burning` mode, to release the inbound transfer and the mint tokens to the recipient, use the [`release_inbound_mint_multisig`] instruction instead.
117
118
118
-
To ensure the SDK has the generated IDL, run the tests with the make command:
119
+
## Prerequisites
120
+
121
+
### Installation
122
+
123
+
Ensure that you are using the correct version of the Solana and Anchor CLI tools by consulting `Anchor.toml`.
124
+
125
+
```toml
126
+
[toolchain]
127
+
anchor_version = "0.29.0"# CLI
128
+
solana_version = "1.18.10"
129
+
```
130
+
131
+
Install the toolchain listed in `rust-toolchain`. You can verify this by running:
119
132
120
133
```sh
121
-
make test
134
+
rustup show
122
135
```
123
136
124
-
### Troubleshooting
137
+
Install [`jq`](https://jqlang.github.io/jq/) and [`tsx`](https://www.npmjs.com/package/tsx) globally as they are required by build scripts.
125
138
126
-
<details>
127
-
<summary><code>make: *** No rule to make target `test'. Stop.</code></summary>
139
+
### Build
128
140
129
-
- Ensure `Makefile` has target `test`
130
-
</details>
141
+
Run the following command to install necessary dependencies and to build the programs:
131
142
132
-
<details>
133
-
<summary><code>tsx: command not found</code></summary>
143
+
```sh
144
+
make build
145
+
```
134
146
135
-
- Screenshot:
136
-
<imgsrc="images/tsx-command-not-found.png"alt="tsx command not found screenshot">
- This occurs due to Typescript files failing compilation.
157
-
-[`patch-idl` script](https://github.com/wormhole-foundation/example-native-token-transfers/blob/main/solana/scripts/patch-idl) requires [`jq`](https://jqlang.github.io/jq/) to be installed. Install `jq` and retry.
0 commit comments