Skip to content

Add macro event declarations#1867

Merged
Th0rgal merged 1 commit into
mainfrom
codex/macro-event-defs
May 14, 2026
Merged

Add macro event declarations#1867
Th0rgal merged 1 commit into
mainfrom
codex/macro-event-defs

Conversation

@Th0rgal
Copy link
Copy Markdown
Member

@Th0rgal Th0rgal commented May 14, 2026

Summary

  • add event_defs declarations to verity_contract
  • translate macro event declarations into CompilationModel.events
  • cover indexed and unindexed macro event metadata in feature tests

Checks

  • lake build Compiler.CompilationModelFeatureTest
  • lake build Contracts.Smoke Compiler.CompilationModelFeatureTest Contracts.MacroTranslateInvariantTest
  • lake build PrintAxioms
  • python3 scripts/generate_print_axioms.py --check
  • python3 scripts/check_axioms.py
  • git diff --check

Note

Medium Risk
Extends the verity_contract macro surface syntax and spec generation to carry event definitions, which may affect downstream compilation/ABI outputs for contracts using the macro. Changes are additive but touch core macro translation paths.

Overview
verity_contract now supports an event_defs section with per-parameter @indexed annotations, and macro translation threads these declarations through parsing/elaboration into CompilationModel.spec.events.

Adds translation support in Verity/Macro/Translate.lean (new EventDecl/EventParamDecl parsing and model term generation) and updates the contract elaborator to pass event declarations into spec generation.

Updates Compiler/CompilationModelFeatureTest.lean with a smoke contract that declares Transfer and asserts the resulting spec carries correct indexed vs unindexed event metadata.

Reviewed by Cursor Bugbot for commit 9f5e2de. Bugbot is set up for automated code reviews on this repo. Configure here.

@Th0rgal Th0rgal merged commit bd211c5 into main May 14, 2026
6 checks passed
@Th0rgal Th0rgal deleted the codex/macro-event-defs branch May 14, 2026 14:09
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.

1 participant