File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed 
programs/portal/src/instructions Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use earn::state::GLOBAL_SEED;
44use  ext_swap:: accounts:: SwapGlobal ; 
55use  ext_swap:: program:: ExtSwap ; 
66
7+ use  crate :: error:: NTTError ; 
78use  crate :: instructions:: { ext_swap,  release_inbound_mint_common} ; 
89use  crate :: instructions:: { ReleaseInboundArgs ,  ReleaseInboundMint } ; 
910use  crate :: ReleaseInboundMintBumps ; 
@@ -113,6 +114,22 @@ pub fn release_inbound_mint_extension<'info>(
113114
114115    ctx. accounts . common . recipient . reload ( ) ?; 
115116
117+     // Ensure target extensions is correct 
118+     // (only validate if we know the extension exists) 
119+     let  target_mint = & ctx. accounts . common . inbox_item . destination_mint ; 
120+     if  ctx
121+         . accounts 
122+         . swap_global 
123+         . whitelisted_extensions 
124+         . iter ( ) 
125+         . find ( |ext| ext. mint . eq ( target_mint) ) 
126+         . is_some ( ) 
127+     { 
128+         if  !ctx. accounts . ext_mint . key ( ) . eq ( target_mint)  { 
129+             return  err ! ( NTTError :: InvalidMint ) ; 
130+         } 
131+     } 
132+ 
116133    let  wrap_amount = ctx
117134        . accounts 
118135        . common 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments