Skip to content

[Certora] fix delegation spec - #114

Open
QGarchery wants to merge 1 commit into
mainfrom
certora-delegation
Open

[Certora] fix delegation spec#114
QGarchery wants to merge 1 commit into
mainfrom
certora-delegation

Conversation

@QGarchery

Copy link
Copy Markdown
Contributor

Turns out the rule that is failing was never going through. It was introduced in #105, but this PR did not run the CI

@QGarchery QGarchery self-assigned this Aug 26, 2026
Comment on lines +217 to +218
requireInvariant sumOfVotesStartsAtZero();
requireInvariant sumOfVotesMonotone();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to show that sumOfVotes is non-negative. It's easy to construct a counter-example otherwise

rule updatedDelegatedVPLTEqTotalSupply(address from, address to) {
requireInvariant sumOfVotesStartsAtZero();
requireInvariant sumOfVotesMonotone();
requireInvariant delegatedVotingPowerLTEqTotalVotingPower();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last one is needed for the delegatee(from) == 0 case. If it doesn't hold because one account has a greater balance than the total supply, that account could delegate to itself and it would also break the property of this rule

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.

2 participants