Skip to content

Commit d044424

Browse files
Clarify token receiver security pattern for PTT to Solana (#3469)
1 parent e9e0900 commit d044424

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

src/content/ccip/llms-full.txt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18539,9 +18539,17 @@ Use this configuration when sending only data messages to SVM:
1853918539
Use this configuration when sending both tokens and data in a single message:
1854018540

1854118541
<Aside type="note" title="Key Requirements">
18542-
- `tokenReceiver` must be a PDA the program has authority over
18543-
- `accounts` must include all accounts required by the receiver program
18544-
- The program must contain logic to handle the received data and tokens
18542+
- **Token Security**: The `tokenReceiver` must be an Associated Token Account (ATA) that the receiver program has authority over. Since the program cannot verify that tokens were sent to a specific address, it should validate it received the expected tokens at its own ATA, then forward them to the final destination.
18543+
18544+
- **Account References**: The `accounts` array must include:
18545+
- The program's own ATA (for validation that tokens were received)
18546+
- The final token destination ATA (to forward tokens to)
18547+
- Any other accounts required by the receiver program's `ccip_receive` instruction
18548+
18549+
- **Validation Pattern**: The receiver program should:
18550+
1. Check that it received the expected tokens at its controlled ATA
18551+
2. Forward the tokens to the final destination
18552+
1854518553
- `allowOutOfOrderExecution` **MUST** be set to `true`
1854618554
</Aside>
1854718555

src/content/ccip/tutorials/svm/destination/build-messages.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,17 @@ Use this configuration when sending both tokens and data in a single message:
476476

477477
<Aside type="note" title="Key Requirements">
478478

479-
- `tokenReceiver` must be a PDA the program has authority over
480-
- `accounts` must include all accounts required by the receiver program
481-
- The program must contain logic to handle the received data and tokens
479+
- **Token Security**: The `tokenReceiver` must be an Associated Token Account (ATA) that the receiver program has authority over. Since the program cannot verify that tokens were sent to a specific address, it should validate it received the expected tokens at its own ATA, then forward them to the final destination.
480+
481+
- **Account References**: The `accounts` array must include:
482+
- The program's own ATA (for validation that tokens were received)
483+
- The final token destination ATA (to forward tokens to)
484+
- Any other accounts required by the receiver program's `ccip_receive` instruction
485+
486+
- **Validation Pattern**: The receiver program should:
487+
1. Check that it received the expected tokens at its controlled ATA
488+
2. Forward the tokens to the final destination
489+
482490
- `allowOutOfOrderExecution` **MUST** be set to `true`
483491

484492
</Aside>

0 commit comments

Comments
 (0)