diff --git a/wormhole-connect/src/routes/cctpManual/chains/evm.ts b/wormhole-connect/src/routes/cctpManual/chains/evm.ts index a1bf14ae4..a510f187f 100644 --- a/wormhole-connect/src/routes/cctpManual/chains/evm.ts +++ b/wormhole-connect/src/routes/cctpManual/chains/evm.ts @@ -145,7 +145,17 @@ export default class ManualCCTPEvmImpl const destContext = config.wh.getContext(toChain); let recipient = destContext.parseAddress(parsedCCTPLog.args.mintRecipient); if (toChain === 'solana') { - recipient = await solanaContext().getTokenAccountOwner(recipient); + try { + console.log(recipient); + recipient = await solanaContext().getTokenAccountOwner(recipient); + } catch (e: any) { + // we'll promp them to create it before claiming it + if (e.name === 'TokenAccountNotFoundError') { + recipient = ''; + } else { + throw e; + } + } } const fromChain = toChainName(chain); const tokenId: TokenId = { diff --git a/wormhole-connect/src/routes/cctpManual/chains/solana.ts b/wormhole-connect/src/routes/cctpManual/chains/solana.ts index 32d8a14b4..f09fe80c8 100644 --- a/wormhole-connect/src/routes/cctpManual/chains/solana.ts +++ b/wormhole-connect/src/routes/cctpManual/chains/solana.ts @@ -12,9 +12,7 @@ import { addComputeBudget, ChainId, ChainName, - SolanaContext, TokenId, - WormholeContext, } from '@wormhole-foundation/wormhole-connect-sdk'; import { BigNumber, utils as ethUtils } from 'ethers'; import { PayloadType, solanaContext, toChainId, toChainName } from 'utils/sdk'; @@ -71,9 +69,7 @@ const findProgramAddress = ( }; function getMessageTransmitter(): Program { - const context = config.wh.getContext( - CHAIN_ID_SOLANA, - ) as SolanaContext; + const context = solanaContext(); const connection = context.connection; const contracts = context.contracts.mustGetContracts(CHAIN_ID_SOLANA).cctpContracts; @@ -88,9 +84,7 @@ function getMessageTransmitter(): Program { } function getTokenMessenger(): Program { - const context = config.wh.getContext( - CHAIN_ID_SOLANA, - ) as SolanaContext; + const context = solanaContext(); const connection = context.connection; const contracts = context.contracts.mustGetContracts(CHAIN_ID_SOLANA).cctpContracts; @@ -502,7 +496,7 @@ export class ManualCCTPSolanaImpl implements ManualCCTP { // get the nonce flag index and build a bitmask const nonceBitIndex = nonceIndex % 64; - const mask = new BN(1 << nonceBitIndex); + const mask = new BN((BigInt(1) << BigInt(nonceBitIndex)).toString()); const nonceByte = usedNonces[nonceElementIndex]; if (!nonceByte) throw new Error('Invalid nonce byte index');