Skip to content

fix(statedb): guard SubBalance against underflow; make ParseAmount de… - #20

Open
Leekyungun wants to merge 1 commit into
KiiChain:mainfrom
Leekyungun:fix/statedb-balance-underflow-guard
Open

fix(statedb): guard SubBalance against underflow; make ParseAmount de…#20
Leekyungun wants to merge 1 commit into
KiiChain:mainfrom
Leekyungun:fix/statedb-balance-underflow-guard

Conversation

@Leekyungun

Copy link
Copy Markdown

Backports cosmos/evm#1176. Adds an underflow guard to stateObject.SubBalance so
a subtraction larger than the current balance panics (reverting the tx) instead
of wrapping the uint256 balance to a near-max value. Also makes precompile
bank-event amount parsing account for both the base and extended EVM-coin denoms.

This closes the class of issue used to drain MANTRA (delegate() with a tiny
amount triggering a balance underflow). Full fix is upstream cosmos/evm v0.6.2;
recommend rebasing this fork onto v0.6.2 for the complete set of changes.

Ref: cosmos/evm#1176

…nom-aware

Backports cosmos/evm#1176. Adds an underflow guard to stateObject.SubBalance so
a subtraction larger than the current balance panics (reverting the tx) instead
of wrapping the uint256 balance to a near-max value. Also makes precompile
bank-event amount parsing account for both the base and extended EVM-coin denoms.

This closes the class of issue used to drain MANTRA (delegate() with a tiny
amount triggering a balance underflow). Full fix is upstream cosmos/evm v0.6.2;
recommend rebasing this fork onto v0.6.2 for the complete set of changes.

Ref: cosmos/evm#1176
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b5de9655-8900-46cd-a327-c187a9eaab9a


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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