Skip to content

Conversation

colin-morpho
Copy link
Contributor

@colin-morpho colin-morpho commented Aug 8, 2025

Based on #621

Slack thread.

Replaces #617

Copy link
Contributor Author

@colin-morpho colin-morpho left a comment

Choose a reason for hiding this comment

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

Notes about this PR.


definition max_int256() returns int256 = (2 ^ 255) - 1;

strong invariant allocationIsInt256(bytes32 id)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Informational: this definition is here only to make it possible to require in other rules. Importing Invariants.spec makes the process fail for a yet to be explained reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest we track this in an issue and merge it as is until Certora comes up a fix/explanation.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The reason is that storage analysis fails for this Certora run. It's ok as it's sound, but then it prevents to hook on storage. The problem comes from the fact that Invariants does hook on storage (but it's respective run doesn't fail storage analysis, so it goes through ok).

The current workaround works fine (it just duplicates an invariant).
An alternative is to separate the Invariants job into 2, one that does not hook on storage that we would import here, and another one with the hook on storage (to prove totalSupplyIsSumOfBalances). But in the end this may be even more overhead

Signed-off-by: Colin | Morpho 🦋 <[email protected]>
@QGarchery QGarchery changed the base branch from main to certora/import-chainsecurity-specs September 23, 2025 11:55
@QGarchery QGarchery marked this pull request as ready for review September 23, 2025 15:55
@QGarchery QGarchery changed the title [Certora] Allocations [Certora] Allocations from adapters Sep 23, 2025
@lilCertora
Copy link
Collaborator

Looks good for us , munging is absolutely necessary since the real code uses the extsload function that we don’t support
Rules are making sense, we need to cross check with the chainsecurity ones that there is no dupplicate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants