Kontrol Formal Verification for SecurityCouncilAzorius#3
Draft
lisandrasilva wants to merge 5 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a formal verification specification for the
SecurityCouncilAzoriuscontract using Kontrol, the symbolic execution tool developed by Runtime Verification.Background
This specification was developed by Runtime Verification based on the existing Certora CVL specification. The two tools are complementary and the Kontrol spec extends coverage to properties that CVL cannot handle due to dynamic array limitations.
What is Kontrol?
Unlike Foundry fuzz tests, which sample a finite number of random inputs, Kontrol performs exhaustive symbolic execution using the K Framework and KEVM. This means:
All possible initial states are covered at once —
kevm.symbolicStoragemakes every storage slot symbolic, so proofs hold for any reachable state of the contract, not just the state produced by the constructor.All possible inputs are covered simultaneously — symbolic inputs represent every value a type can take, not a random sample.
Proofs are mathematical guarantees — if a proof passes, the property holds for every execution path, with no counterexamples missed.
vetoProposalunvetoProposalvetoTxunvetoTxmulticallcheckTransactioncheckAfterExecutionrenounceOwnershiptransferOwnershipsupportsInterfaceIn addition to per-function properties, four global invariants are checked after every state-changing call:
ownerIsNotZero— owner is never the zero addressazoriusIsNotZero— azorius is never the zero addressownerPreservation— only transferOwnership can change the ownerazoriusIsImmutable— azorius address never changesstoragePreservation— each function modifies only the expected storage slotsAdditional coverage beyond Certora
Two properties that the Certora spec could not cover due to dynamic array limitations are fully verified here:
In progress
T-13 test_multiCall is incomplete. calls: bytes[] is treated as symbolic raw bytes by KEVM, which cannot dispatch into the individual delegated functions. Full storage isolation and per-call effect verification require constructing calls as a symbolic array of properly ABI-encoded calls to known functions with symbolic arguments.