File tree Expand file tree Collapse file tree
solana/programs/example-native-token-transfers/src/instructions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,6 +43,20 @@ pub struct Redeem<'info> {
4343 constraint = ValidatedTransceiverMessage :: <NativeTokenTransfer <Payload >>:: message( & transceiver_message. try_borrow_data( ) ?[ ..] ) ?. recipient_ntt_manager( ) == config. key( ) . to_bytes( ) @ NTTError :: InvalidRecipientNttManager ,
4444 // NOTE: we don't replay protect VAAs. Instead, we replay protect
4545 // executing the messages themselves with the [`released`] flag.
46+ // Cryptographically bind this account to the instance: since
47+ // receive_message seeds transceiver_message with config.key(), a message
48+ // created for instance A cannot be passed here for instance B.
49+ seeds = [
50+ ValidatedTransceiverMessage :: <NativeTokenTransfer <Payload >>:: SEED_PREFIX ,
51+ config. key( ) . as_ref( ) ,
52+ ValidatedTransceiverMessage :: <NativeTokenTransfer <Payload >>:: from_chain( & transceiver_message) ?. id. to_be_bytes( ) . as_ref( ) ,
53+ ValidatedTransceiverMessage :: <NativeTokenTransfer <Payload >>:: message( & transceiver_message. try_borrow_data( ) ?[ ..] ) ?. ntt_manager_payload( ) . id. as_ref( ) ,
54+ ] ,
55+ seeds:: program = transceiver. transceiver_address,
56+ bump,
57+ // `owner` is implied by the seeds check above (a valid PDA of
58+ // `transceiver.transceiver_address` must be owned by it), but kept
59+ // here for clarity.
4660 owner = transceiver. transceiver_address
4761 ) ]
4862 /// CHECK: `transceiver_message` has to be manually deserialized as Anchor
You can’t perform that action at this time.
0 commit comments