wormhole-foundation / wormhole-sdk-ts

Wormhole TypeScript SDK
https://wormhole-foundation.github.io/wormhole-sdk-ts/
Apache License 2.0
49 stars 51 forks source link

CCTP transfer to Solana does not work if the target wallet USDC ATA is not already created #691

Closed evgeniko closed 2 months ago

evgeniko commented 2 months ago

The following error message is returned when the target wallet on Solana does not have an already created usdc associated token account. So a USDC transfer from Chain X to Solana, will always fail with that at the moment, with the sdk.

transactionMessage: 'Transaction simulation failed: Error processing Instruction 0: custom program error: 0xbc4',
transactionLogs: [
  'Program CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd invoke [1]',
  'Program log: Instruction: ReceiveMessage',
  'Program CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3 invoke [2]',
  'Program log: Instruction: HandleReceiveMessage',
  'Program log: AnchorError caused by account: recipient_token_account. Error Code: AccountNotInitialized. Error Number: 3012. Error Message: The program expected this account to be already initialized.',
  'Program CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3 consumed 10141 of 60551 compute units',
  'Program CCTPiPYPc6AsJuwueEnWgSgucamXDZwBd53dQ11YiKX3 failed: custom program error: 0xbc4',
  'Program CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd consumed 149590 of 200000 compute units',
  'Program CCTPmbSD7gX1bxKPAmg77w8oFzNFpaQiQUWD43TKaecd failed: custom program error: 0xbc4'
]
obumnwabude commented 2 months ago

@evgeniko This seems not to be specific to USDC, but to all SPL tokens seemingly. If you also send ETH from Sepolia, as it arrives Solana as WETH, the same error is thrown.

kev1n-peters commented 2 months ago

Fixed in https://github.com/wormhole-foundation/wormhole-sdk-ts/pull/692