fix(bank): add LockedCoins check to SubWei to enforce vesting invariant#3655
fix(bank): add LockedCoins check to SubWei to enforce vesting invariant#3655Sahil-4555 wants to merge 1 commit into
Conversation
PR SummaryMedium Risk Overview Before the rest of the deduction logic, it loads
Reviewed by Cursor Bugbot for commit 2132c63. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2132c63. Configure here.

What this fixes
SubWeiwas not checking locked coins before deducting the balance.SubUnlockedCoinsalready does this check properly, butSubWeiwas missing it. This means the wei deduction path was not respecting vesting locks at the keeper level.This PR adds the locked coins check to
SubWeiso that it behaves the same way asSubUnlockedCoins. The spendable balance is calculated using the same formula that the EVM keeper uses inGetBalance.Fixes #3654