Skip to content

fix: add BurnAmountExceedsBalance check in burn function#155

Merged
Ejirowebfi merged 3 commits into
Favourorg:mainfrom
Austinaminu2:fix/burn-amount-exceeds-balance
Mar 24, 2026
Merged

fix: add BurnAmountExceedsBalance check in burn function#155
Ejirowebfi merged 3 commits into
Favourorg:mainfrom
Austinaminu2:fix/burn-amount-exceeds-balance

Conversation

@Austinaminu2

Copy link
Copy Markdown
Contributor

Closes #92

The burn function was calling TokenClient::burn without first verifying the caller had sufficient balance, leaving Error::BurnAmountExceedsBalance unused.

Changes:

Fetch the from address balance via TokenClient::balance before the cross-contract burn call
Return Error::BurnAmountExceedsBalance early if amount > balance
Add test_burn_amount_exceeds_balance test that mints 100 tokens to a user and asserts burning 200 returns the expected error

@drips-wave

drips-wave Bot commented Mar 24, 2026

Copy link
Copy Markdown

@Austinaminu2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ejirowebfi Ejirowebfi merged commit 0d1827f into Favourorg:main Mar 24, 2026
0 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.

Add BurnAmountExceedsBalance Check in Contract

2 participants