Skip to content

fix(stamp): cast before min initial balance multiply#313

Open
0xCardiE wants to merge 1 commit into
masterfrom
fix/postagestamp-min-balance-overflow
Open

fix(stamp): cast before min initial balance multiply#313
0xCardiE wants to merge 1 commit into
masterfrom
fix/postagestamp-min-balance-overflow

Conversation

@0xCardiE
Copy link
Copy Markdown
Contributor

Summary

  • Cast minimumValidityBlocks and lastPrice to uint256 before multiplying in minimumInitialBalancePerChunk().
  • Prevents silent uint64 overflow when computing the minimum required per-chunk balance.

Test plan

  • Run existing PostageStamp unit tests
  • Verify minimumInitialBalancePerChunk() matches uint256(minimumValidityBlocks) * uint256(lastPrice) at high lastPrice values
  • Confirm batch create/topup/expiry checks still enforce the minimum balance correctly

Cast minimumValidityBlocks and lastPrice to uint256 before multiplying
so minimumInitialBalancePerChunk cannot silently overflow in uint64 space.
0xCardiE added a commit that referenced this pull request May 22, 2026
Move minimumInitialBalancePerChunk overflow fix to #313.
@0xCardiE 0xCardiE self-assigned this May 22, 2026
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