Commit c395377
fix(bridge): correct Stellar deposit asset validation (#1094)
Three correctness fixes in the Stellar->TFChain deposit path
(processTransaction) and balance reporting (StatBridgeAccount):
1. Credited-effect asset check used && instead of ||, so a credit was
only skipped when BOTH the asset code and issuer were wrong. A credit
with the right code but a forged/wrong issuer (or vice-versa) passed
the gate and could be minted. Now requires both to match.
2. The per-operation loop did `return nil, nil` on the first non-payment
operation, abandoning the entire transaction and silently dropping any
legitimate payment operations after it (lost deposits / missing mints).
Now skips non-payment ops individually with `continue`.
3. Added operation-level asset validation: even after the effect check,
each payment amount must itself be TFT, otherwise a non-TFT payment to
the bridge in the same transaction would be summed and minted as TFT.
Non-TFT payments are now skipped and logged as an alert.
4. StatBridgeAccount matched the TFT balance with || (code OR issuer),
which could return an unrelated asset's balance; now matches on both.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 6375d96 commit c395377
1 file changed
Lines changed: 32 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
512 | 512 | | |
513 | 513 | | |
514 | 514 | | |
515 | | - | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
516 | 520 | | |
517 | 521 | | |
518 | 522 | | |
| |||
523 | 527 | | |
524 | 528 | | |
525 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
526 | 534 | | |
527 | | - | |
| 535 | + | |
528 | 536 | | |
529 | 537 | | |
530 | 538 | | |
531 | 539 | | |
532 | 540 | | |
533 | 541 | | |
534 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
535 | 561 | | |
536 | 562 | | |
537 | 563 | | |
| |||
677 | 703 | | |
678 | 704 | | |
679 | 705 | | |
680 | | - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
681 | 710 | | |
682 | 711 | | |
683 | 712 | | |
| |||
0 commit comments