Skip to content

Commit

Permalink
fix: always set memo for SIP10, ref #5436
Browse files Browse the repository at this point in the history
  • Loading branch information
pete-watters committed May 24, 2024
1 parent d910b9a commit fe1b75f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/app/store/transactions/token-transfer.hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,9 @@ export function useGenerateFtTokenTransferUnsignedTx(info: Sip10CryptoAssetInfo)
const { contractId } = info;
const { contractAddress, contractAssetName, contractName } =
getStacksContractIdStringParts(contractId);

return useCallback(
async (values?: StacksSendFormValues | StacksTransactionFormValues) => {
try {
debugger;
if (!account) return;

const functionName = 'transfer';
Expand All @@ -102,7 +100,7 @@ export function useGenerateFtTokenTransferUnsignedTx(info: Sip10CryptoAssetInfo)
const memo =
values && 'memo' in values && values.memo !== ''
? someCV(bufferCVFromString(values.memo || ''))
: noneCV();
: noneCV(); // memo set to noneCV here

const amountAsFractionalUnit = ftUnshiftDecimals(amount, info.decimals || 0);
const postConditionOptions = {
Expand All @@ -122,9 +120,7 @@ export function useGenerateFtTokenTransferUnsignedTx(info: Sip10CryptoAssetInfo)
standardPrincipalCVFromAddress(recipient),
];

if (info.hasMemo) {
functionArgs.push(memo);
}
functionArgs.push(memo);

const options = {
txData: {
Expand All @@ -145,15 +141,13 @@ export function useGenerateFtTokenTransferUnsignedTx(info: Sip10CryptoAssetInfo)

return generateUnsignedTransaction(options);
} catch (error) {
debugger;
logger.error('Failed to generate unsigned transaction', error);
return;
}
},
[
account,
info.decimals,
info.hasMemo,
network,
nextNonce?.nonce,
contractName,
Expand Down

0 comments on commit fe1b75f

Please sign in to comment.