Skip to content

Conversation

@blishko
Copy link
Collaborator

@blishko blishko commented Oct 15, 2025

Description

To make the core method simpler we always require postcondition to be given.
If there is no postcondition, we are not really "verifying". However, there is a use case where we don't want to verify anything, we just want to explore a contract.
For such use case, we provide a new helper method to do exactly that. exploreContract executes the contract symbolically, and returns its Expr representation.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

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

LGTM! I added a comment, more as a reminder than anything else :)

Comment on lines +566 to +579
exploreContract :: forall m . App m
=> SolverGroup
-> Maybe Fetch.Session
-> ByteString
-> Maybe Sig
-> [String]
-> VeriOpts
-> Maybe (Precondition RealWorld)
-> Maybe (Postcondition RealWorld)
-> m (Expr End, [VerifyResult])
verifyContractWithSession solvers sess theCode signature' concreteArgs opts maybepre maybepost = do
-> m (Expr End)
exploreContract solvers theCode signature' concreteArgs opts maybepre = do
calldata <- mkCalldata signature' concreteArgs
preState <- liftIO $ stToIO $ abstractVM calldata theCode maybepre False
let fetcher = Fetch.oracle solvers sess opts.rpcInfo
verify solvers fetcher opts preState maybepost
let fetcher = Fetch.oracle solvers Nothing opts.rpcInfo
executeVM fetcher opts.iterConf preState

Copy link
Collaborator

Choose a reason for hiding this comment

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

this is only used in one test. It will also need to be removed when we return an [Expr End], rather than an Expr End with a bunch of ITE's in it. So we can also remove it now, if you like, along with the test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can keep it for now and remove/adjust later.

@blishko
Copy link
Collaborator Author

blishko commented Oct 16, 2025

I guess I should add a changelog entry, since we are changing the signature of a function exposed to the outside world.

@msooseth
Copy link
Collaborator

I guess I should add a changelog entry, since we are changing the signature of a function exposed to the outside world.

I think we should always add a changelog entry unless it's a trivial PR :) But yeah. And then we can merge :)

To make the core method simpler we always require postcondition to be
given.
If there is no postcondition, we are not really "verifying".
However, there is a use case where we don't want to verify anything, we
just want to explore a contract.
For such use case, we provide a new helper method to do exactly that.
`exploreContract` executes the contract symbolically, and returns its
Expr representation.
@blishko blishko merged commit acb72d0 into main Oct 21, 2025
5 of 7 checks passed
@blishko blishko deleted the symex-cleanup branch October 21, 2025 15:01
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