Add raise-slot helper and example#7
Closed
Th0rgal wants to merge 22 commits into
Closed
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| Stmt.if_ (Expr.gt a b) (Stmt.sstore slot a) (Stmt.sstore slot b) | ||
|
|
||
| def sstoreMin (slot a b : Expr) : Stmt := | ||
| Stmt.if_ (Expr.lt a b) (Stmt.sstore slot a) (Stmt.sstore slot b) |
There was a problem hiding this comment.
New sstoreMin helper is unused dead code
Low Severity
sstoreMin is defined but never referenced anywhere in the codebase. Grep confirms the only match is its definition. Its counterpart sstoreMax is actively used in maxStoreFun, but sstoreMin has zero callers — none of the new examples (updateMin, capSlot) use it, as they rely on sstoreIfLt instead.
3 tasks
Th0rgal
pushed a commit
that referenced
this pull request
Feb 22, 2026
…ypoints
check_selectors.py hardcodes _INTERNAL_FUNCTION_PREFIX ("internal_")
and _SPECIAL_ENTRYPOINTS ({"fallback", "receive"}) used in collision
and filtering checks. These were validated only by code comments
saying "Must match ContractSpec.lean" — no automated enforcement.
Add checks #10 and #11 that regex-extract the canonical Lean
definitions and validate both Python constants match, following
the same pattern as checks #7–9.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 tasks
Th0rgal
added a commit
that referenced
this pull request
Feb 22, 2026
…ypoints (#674) check_selectors.py hardcodes _INTERNAL_FUNCTION_PREFIX ("internal_") and _SPECIAL_ENTRYPOINTS ({"fallback", "receive"}) used in collision and filtering checks. These were validated only by code comments saying "Must match ContractSpec.lean" — no automated enforcement. Add checks #10 and #11 that regex-extract the canonical Lean definitions and validate both Python constants match, following the same pattern as checks #7–9. Co-authored-by: Claude <noreply@anthropic.com>
Th0rgal
pushed a commit
that referenced
this pull request
Apr 4, 2026
- evalIntent: reject non-void binding functions (Codex #4) - Eval eq/ne: return none for cross-type comparisons (Bugbot #5) - Circom: unique signal prefixes for repeated helper calls (Bugbot #13) - isUint256Expr: check constant value instead of assuming uint256 (Bugbot #10) - dedup: preserve first-occurrence order for Poseidon inputs (Bugbot #11) - Remove dead code: remapCtx, countEmitsExpr (Bugbot #12, #30) - compileStmts .call: skip non-void functions (Codex #24) - compileExpr .call: emit error comment for missing/bodyless fns (Codex #7) - validateParams: enforce positional order matching ABI (Codex #21) - evalConstInt: fuel-bounded to prevent cycles (Codex #22) - Update E2E test Poseidon orderings to match new dedup behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
sstoreIfGtfor monotonic raisesraiseSlotexample + Foundry testupdateMaxto use helperTesting
PATH=/opt/lean-4.27.0/bin:$PATH lake build./scripts/end_to_end.sh./scripts/foundry_test_generated.shNote
Medium Risk
Touches the example compiler/dispatcher and the hand-written
EvmAsmprogram, so selector/tag wiring or stack-order mistakes could break end-to-end bytecode or tests. Changes are mostly additive and covered by new Lean proofs and Foundry tests, but the assembly jumpdest layout is inherently brittle.Overview
Adds a much richer
DumbContracts.Stdliblayer (guard combinators likerequire*/revertIf, cachedletSload, and storage helpers likesstoreIfGt/sstoreIfLt/sstoreIfZero/sstoreIfEq,sstoreAdd/sstoreSub/sstoreInc,sstoreMax/sstoreMin) and refactors existing examples to use them.Introduces many new small example contracts (e.g.
raiseSlot,capSlot,updateMax/updateMin,setIf*,addIf*,init*,bump*,subIfEnough,clearIfEq,compareAndSwap) each with correspondingSpec/SpecRproofs, and wires them into the aggregatedExamples.leanimport list.Extends
Compiler.lean’sexampleEntriesdispatch table with new selectors and updatesEvmAsm.leanto include the expanded dispatcher + function bodies (switching label pushes toPUSH2and adjusting tag ordering/layout to match solc). Adds a large set of new generated Foundry tests for the new selectors/examples, and updates docs/status logs to reflect the iteration.Written by Cursor Bugbot for commit 5dac4af. This will update automatically on new commits. Configure here.