Skip to content

feat: add balance-not-verified-after-transfer check — external token transfer with no post-balance assertion - #389

Merged
luhrhenz merged 1 commit into
Veritas-Vaults-Network:mainfrom
jaynomyaro:yaro
Jun 19, 2026
Merged

luhrhenz merged 1 commit into
Veritas-Vaults-Network:mainfrom
jaynomyaro:yaro

Conversation

@jaynomyaro

Copy link
Copy Markdown
Contributor

Description

This PR introduces a defensive check that detects external token transfer flows where no post-transfer balance verification is performed. The new validation highlights transfer paths that assume success solely from an external call result, helping identify scenarios where token behavior may diverge from expectations.

Changes
Added a balance-not-verified-after-transfer check for external token transfers
Detects transfer flows that do not assert post-transfer balance changes
Flags cases where transfer success is inferred without balance verification
Added coverage for compliant and non-compliant transfer patterns
Documented the rationale and expected remediation approach
Motivation

External token contracts may exhibit non-standard behavior, including silent failures, transfer fees, rebasing mechanics, or unexpected return values. Relying only on an external transfer call without validating resulting balances can introduce accounting inconsistencies and hidden failure modes.

Benefits
Improves safety around external token interactions
Encourages explicit balance validation after transfers
Helps detect accounting discrepancies and silent transfer failures
Establishes a clear security guideline for token integration patterns
Reduces the risk of regressions in future transfer implementations
Example
Before
token.transfer(recipient, amount)?;
// No verification that balances changed..Closed #385

@luhrhenz

Copy link
Copy Markdown
Member

please recheck the codebase, your build and test is failing

@luhrhenz
luhrhenz merged commit 48ccb3c into Veritas-Vaults-Network:main Jun 19, 2026
1 of 2 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.

feat: add balance-not-verified-after-transfer check — external token transfer with no post-balance assertion

2 participants