Skip to content

Certora: prove balanceOf(account) ≤ totalSupply - #952

Merged
MathisGD merged 7 commits into
mainfrom
claude/certora-balance-leq-totalsupply
Jul 28, 2026
Merged

Certora: prove balanceOf(account) ≤ totalSupply#952
MathisGD merged 7 commits into
mainfrom
claude/certora-balance-leq-totalsupply

Conversation

@claude

@claude claude Bot commented Jul 24, 2026

Copy link
Copy Markdown

Requested by Mathis GD · Slack thread

Proves that every account's balanceOf is bounded by totalSupply, addressing the "prove balances is less than totalSupply, potentially using ghostmappingsums" item of the Certora wish list (#137).

In Invariants.spec, the totalSupplyIsSumOfBalances invariant now sums balances with CVL's native usum (totalSupply == usum(balances)), replacing the previous manual mathint accumulator. A new balanceOfLeqTotalSupply rule derives balanceOf(account) <= totalSupply() from it — usum guarantees the sum is at least any single balance.

@claude
claude Bot marked this pull request as ready for review July 24, 2026 13:05
@MathisGD MathisGD self-assigned this Jul 24, 2026
Comment thread certora/specs/Invariants.spec Outdated
Co-authored-by: Quentin Garchery <garchery.quentin@gmail.com>
Signed-off-by: MathisGD <74971347+MathisGD@users.noreply.github.com>
@MathisGD
MathisGD merged commit d54e0f4 into main Jul 28, 2026
42 checks passed
@MathisGD
MathisGD deleted the claude/certora-balance-leq-totalsupply branch July 28, 2026 11:34
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.

3 participants