File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -506,7 +506,25 @@ const parseCCTPv2Receipt = async (
506506 // NOTE: the sender is the shim contract, not the user's wallet
507507 // so don't set that here
508508
509- txData . recipient = messageBody . mintRecipient . toNative ( receipt . to ) . toString ( ) ;
509+ if ( receipt . to === 'Solana' ) {
510+ if ( ! config . rpcs . Solana ) {
511+ throw new Error ( 'Missing Solana RPC' ) ;
512+ }
513+ // the recipient on the VAA is the ATA
514+ const ata = messageBody . mintRecipient . toNative ( receipt . to ) . toString ( ) ;
515+ const connection = new Connection ( config . rpcs . Solana ) ;
516+ try {
517+ const account = await splToken . getAccount ( connection , new PublicKey ( ata ) ) ;
518+ txData . recipient = account . owner . toBase58 ( ) ;
519+ } catch ( e ) {
520+ console . error ( e ) ;
521+ txData . recipient = ata ;
522+ }
523+ } else {
524+ txData . recipient = messageBody . mintRecipient
525+ . toNative ( receipt . to )
526+ . toString ( ) ;
527+ }
510528
511529 // The attestation doesn't have the destination token address, but we can deduce which it is
512530 // just based off the destination chain
Original file line number Diff line number Diff line change @@ -608,7 +608,12 @@ function Redeem() {
608608 receivingWallet . address !== recipient &&
609609 routeName &&
610610 // These routes set the recipient address to the associated token address
611- [ 'ManualTokenBridge' , 'ManualCCTP' ] . includes ( routeName )
611+ [
612+ 'ManualTokenBridge' ,
613+ 'ManualCCTP' ,
614+ 'CCTPv2FastExecutorRoute' ,
615+ 'CCTPv2StandardExecutorRoute' ,
616+ ] . includes ( routeName )
612617 ) {
613618 const { address : receiveTokenAddress } = tokenIdFromTuple ( receivedToken ) ;
614619
You can’t perform that action at this time.
0 commit comments