Skip to content

fix(sdk-coin-sui): skip splitCoins entirely when the full amount with…#9182

Merged
nvrakesh06 merged 1 commit into
masterfrom
CSHLD-1146
Jul 3, 2026
Merged

fix(sdk-coin-sui): skip splitCoins entirely when the full amount with…#9182
nvrakesh06 merged 1 commit into
masterfrom
CSHLD-1146

Conversation

@abhishekagrawal080

@abhishekagrawal080 abhishekagrawal080 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

…drawn

TICKET: CSHLD-1146

Root Cause:
Native SUI — already cleaned up: No changes is needed

MoveCall(redeem_funds, 0x2::sui::SUI) → addrCoin: Coin
SplitCoins(addrCoin, [amount]) → split: Coin
TransferObjects([split], recipient)
MergeCoins(GasCoin, [addrCoin]) ← GasCoin is also Coin ✓
MergeCoins(GasCoin, [addrCoin]) is type-valid because both operands are Coin. The zero-balance addrCoin is absorbed into gas — consumed, no unused value.

Token — no compatible merge target: Need handling

MoveCall(redeem_funds, 0x..::deep::DEEP) → addrCoin: Coin
SplitCoins(addrCoin, [amount]) → split: Coin
TransferObjects([split], recipient)
MergeCoins(GasCoin, [addrCoin]) ← GasCoin is Coin, addrCoin is Coin ✗ type error
Gas is always Coin. You can't merge a Coin into it. There's no existing coin of type Coin in the PTB to merge into either (we just drained the only one). So addrCoin sits unconsumed → UnusedValueWithoutDrop.

@abhishekagrawal080 abhishekagrawal080 requested a review from a team as a code owner July 3, 2026 08:10
@linear-code

linear-code Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

CSHLD-1146

nvrakesh06
nvrakesh06 previously approved these changes Jul 3, 2026
@nvrakesh06 nvrakesh06 merged commit 65c1183 into master Jul 3, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants