Skip to content

Conversation

@srunquist-certora
Copy link

No description provided.

Note that there are other ways to assess the quality of your rule.
You can mutate the rule to see if it is vacuous, you can check if the rule is a
tautology, and you can use UNSAT cores to understand what parts of the code were
covered by the rule.
Copy link
Author

@srunquist-certora srunquist-certora Oct 9, 2025

Choose a reason for hiding this comment

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

Do we have resources we can link to for these approaches?
If not, I think we can leave it out since it doesn't stand alone very well.

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

Updated - thanks!

],
"precise_bitwise_ops": true,
"prover_version": "master",
"server": "production"
Copy link
Author

Choose a reason for hiding this comment

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

Any reason to keep prover_version and server in the confs?
My tests with 8.1.1 worked ok without them, so seems better to simplify.

Choose a reason for hiding this comment

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

yes no good reason IMO

Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed! sorry this was my bad. Thanks for fixing.

#[rule]
fn transfer_is_correct(e: Env, to: Address, from: Address, amount: i64) {
cvlr_assume!(
e.storage().persistent().has(&from) && e.storage().persistent().has(&to) && to != from);
Copy link
Author

Choose a reason for hiding this comment

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

It makes logical sense to require these addresses to exist, but the rule passes without this:
https://prover.certora.com/output/7749274/46268bb1c02c41f4b86527108f9d2e1d?anonymousKey=c1e61c81e55a93cc3f7ea965a2e7996c264dbdd1

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can remove them! I think i was just trying to make something to show the usage of assume but might have been too contrived because at the time I didn't have as many examples.

e.storage().persistent().has(&from)
&& e.storage().persistent().has(&to)
&& to != from
&& Token::balance(&e, from.clone()) < amount);
Copy link
Author

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed, remove it!

Copy link

@urikirsh urikirsh left a comment

Choose a reason for hiding this comment

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

Minor nits. Please fix and wait for Chandra's review before merging.

Note that there are other ways to assess the quality of your rule.
You can mutate the rule to see if it is vacuous, you can check if the rule is a
tautology, and you can use UNSAT cores to understand what parts of the code were
covered by the rule.

Choose a reason for hiding this comment

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

.. important::

If you are not able to run certoraRun, see the `Sunbeam Troubleshooting`_ section in
If you are not able to run ``certoraSorobanProver``, see the `Sunbeam Troubleshooting`_ section in

Choose a reason for hiding this comment

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

good catch

],
"precise_bitwise_ops": true,
"prover_version": "master",
"server": "production"

Choose a reason for hiding this comment

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

yes no good reason IMO

Copy link
Collaborator

@chandrakananandi chandrakananandi left a comment

Choose a reason for hiding this comment

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

Sorry for the late review. Looks great to me. I think you can remove the assumes.

],
"precise_bitwise_ops": true,
"prover_version": "master",
"server": "production"
Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed! sorry this was my bad. Thanks for fixing.

#[rule]
fn transfer_is_correct(e: Env, to: Address, from: Address, amount: i64) {
cvlr_assume!(
e.storage().persistent().has(&from) && e.storage().persistent().has(&to) && to != from);
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can remove them! I think i was just trying to make something to show the usage of assume but might have been too contrived because at the time I didn't have as many examples.

e.storage().persistent().has(&from)
&& e.storage().persistent().has(&to)
&& to != from
&& Token::balance(&e, from.clone()) < amount);
Copy link
Collaborator

Choose a reason for hiding this comment

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

agreed, remove it!

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.

4 participants