Conversation
When an MPTokenIssuance has a non-zero TransferFee, rippled deducts Amount + ceil(Amount * fee / 100_000) from the sender. Without SendMax the tx fails with tecPATH_PARTIAL. This fix computes and sets SendMax correctly, and restores it across the multi-sig rebuild round-trip. Ticket: CHALO-802
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes broken withdrawal flow for XRP MPT tokens that have a non-zero
TransferFeeon theirMPTokenIssuanceledger object (e.g.txrp:feesec).Root cause: When an MPT issuance has
TransferFee > 0, rippled deductsAmount + ⌈Amount × fee / 100_000⌉from the sender. WithoutSendMaxset, the transaction fails withtecPATH_PARTIAL.Fix:
transferFee(fee: number)method toMPTokenTransferBuilderthat accepts theMPTokenIssuance.TransferFeeledger field (integer in [0, 50_000])SendMax = Amount + ⌈Amount × fee / 100_000⌉using ceiling division (BigInt)SendMaxacross the multi-sig rebuild round-trip so a second signer doesn't lose itIssue Number: CHALO-802
Type of change
How Has This Been Tested?
Added unit tests covering:
SendMaxset correctly whentransferFeeis non-zero (0.1% fee on 1,000,000 → SendMax = 1,001,000)SendMaxpreserved through serialize → rebuild round-trip (multi-sig path)transferFee(0)omitsSendMaxChecklist