Sui.

Post

Share your knowledge.

0xduckmove.
Jul 14, 2025
Expert Q&A

which runs successfully through devInspectTransactionBlock()

Hi all, I am using the Type Script SDK and receiving the error "UnusedValueWithoutDrop" after a tx.moveCall (flash_swap on MMT LP). I assume that I have to drop or transfer back the returned coins after the swap. Can someone tell me, how to efficiently drop / transfer the returned objects (currently NestedResult) after my moveCall? Appreciate any help, thanks!

Here is the code, which runs successfully through devInspectTransactionBlock()

let [returnCoinA, returnCoinB, returnReceip] = tx.moveCall({
            target: targetFunctionLP2,
            typeArguments: [suiTokenType, usdcTokenType],
            arguments: [
                tx.object(poolAddressLP2),
                tx.pure.bool(false),
                tx.pure.bool(true),
                tx.pure.u64(amountOutUSDNormalized),
                tx.pure.u128(limit_sqrt_priceB),
                tx.object(clockObjectAddressLP2),
                tx.object(versionAddressLP2),
            ],
        });
tx.transferObjects([returnCoinA, returnCoinB], tx.pure.address(sender))

  • Sui
4
3
Share
Comments
.

Answers

3
harry phan.
Jul 15 2025, 04:42

You need to do something with returnReceipt. I don't know what these objects are, but you can probably just add them to transferObjects if they aren't expected to be passed into another call

10
Best Answer
Comments
.
Meaning.Sui.
Jul 23 2025, 03:23

You're getting the UnusedValueWithoutDrop error because every object returned from a Move call must be either transferred, used, destroyed, or explicitly dropped — otherwise, Sui throws that error to ensure safe and deterministic object handling.

In your case, you’re handling returnCoinA and returnCoinB correctly by transferring them back to the sender. But you’re not doing anything with returnReceip, which is why the error is triggered.

To fix this, you should explicitly drop returnReceip if it’s not needed, or transfer it if it contains data the user should keep. Here's how you can handle it depending on the case:

6
Comments
.

Do you know the answer?

Please log in and share it.