Add multi-result ECM bind syntax#1874
Merged
Merged
Conversation
Contributor
| \n### CI Failure Hints\n\nFailed jobs: `checks`\n\nCopy-paste local triage:\n```bash\nmake check\nlake build\nFOUNDRY_PROFILE=difftest forge test -vv\n``` |
197299c to
6621277
Compare
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.
Summary
ecmBind [x, y] module [args]as a macro-surface do element for multi-result ECM modulesUint256locals to later statementsbn256AddModuleVerification
lake build Contracts.Smokegit diff --checkpython3 scripts/generate_print_axioms.py --checkpython3 scripts/check_axioms.pylake build Benchmark.Cases.UnlinkXyz.Pool.Compileinverity-benchmarkagainst this local Verity checkoutNote
Medium Risk
Extends the Verity macro surface and translation pipeline for ECM calls, which can affect compilation/semantic preservation for contracts using external modules. Changes are localized but touch core elaboration/validation logic and add new smoke coverage.
Overview
Adds a new do-element syntax,
ecmBind [x, y, ...] module [args], to bind multiple result words from an ECM module and introduce them as freshUint256locals for subsequent statements.Updates macro translation to typecheck
ecmBindarguments, validate that the bound names exactly match the module’s declaredresultVars, and lower the statement to a singleCompilationModel.Stmt.ecmwhile extending the local environment.Introduces a new smoke contract
GenericECMMultiResultSmoke(usingbn256AddModule) plus proof/model expectations, wires it into invariant + round-trip fuzz harness spec lists and selector/signature snapshots, and adds an auto-generated Solidity property test stub for the new smoke contract.Reviewed by Cursor Bugbot for commit 6621277. Bugbot is set up for automated code reviews on this repo. Configure here.