Skip to content

fix(wallet): enforce the native-DERO burn guard on the token-send path#19

Merged
DHEBP merged 1 commit into
devfrom
fix/transfertoken-burn-guard
Jun 17, 2026
Merged

fix(wallet): enforce the native-DERO burn guard on the token-send path#19
DHEBP merged 1 commit into
devfrom
fix/transfertoken-burn-guard

Conversation

@DHEBP

@DHEBP DHEBP commented Jun 17, 2026

Copy link
Copy Markdown
Owner

What

Routes TransferToken through the same native-DERO burn guard the other
send paths already use, so the check is applied consistently across every
path that can build a transfer.

Why

TransferToken builds its transfer directly and calls TransferPayload0
without going through InternalWalletCall, where shouldBlockBurn runs.
That left it as the one send path the guard didn't cover. This change
closes that gap so the guard is enforced everywhere, not just on the
XSWD path.

Changes

  • Extract the transfer construction into buildTokenTransfer (credits
    Amount, Burn 0), making the exact production construction testable
    without a live wallet.
  • Run shouldBlockBurn at the chokepoint before building the transaction,
    so a native-DERO (zero-SCID) burn is rejected here too.
  • Add TestTransferTokenCannotBurnNativeDero, which exercises the real
    constructor: asserts a normal token send is non-destructive and that a
    zero-SCID burn is blocked.

Verification

  • go build ./..., go vet, and the full test suite pass.
  • Confirmed the new test has teeth by temporarily reintroducing the
    destructive construction and observing it fail.

TransferToken builds its transfer directly rather than through
InternalWalletCall, so it did not share the centralized burn guard the
other send paths use. This routes it through the same check.

Extract the transfer construction into buildTokenTransfer (credits
Amount, Burn 0) and run shouldBlockBurn before building the transaction,
so a native-DERO (zero-SCID) burn is consistently rejected across every
send path, not just the XSWD path.

Add TestTransferTokenCannotBurnNativeDero covering the real constructor:
a normal token send is non-destructive and a zero-SCID burn is blocked.
@DHEBP DHEBP merged commit 1ef155e into dev Jun 17, 2026
2 checks passed
@DHEBP DHEBP deleted the fix/transfertoken-burn-guard branch June 17, 2026 06:45
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.

1 participant