Conversation
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.
Two additions to the curated summary catalogue.
Solady
SafeTransferLib— scoping fix, no new CVL.OZ_SafeERC20.specalready summarises through a wildcard receiver, and Solady's
safeTransfer/safeTransferFromcarry the same signatures and the same revert-on-failurecontract (checked against Solady's source: it raises
TransferFailed()whereOpenZeppelin raises
SafeERC20FailedOperation). The entry never matched becauselibrary_nameslisted onlySafeERC20, and_library_matchesgates on themethod's defining/originating contract. Both libraries stay on one
summary_file: a project can use both, and two copies of the same wildcardsummary imported into one scene would be a duplicate declaration.
AuthorityUtils.canCallWithDelay— new spec. It is the gate behindOpenZeppelin AccessManager's
restrictedmodifier, so it sits on the entry pathof every access-controlled function in an AccessManaged contract, and its body is
a hand-written
staticcallinto anIAuthoritythe Prover cannot resolve. Thenew spec keys an unconstrained ghost pair on all four arguments — authority,
caller, target, selector. That is the sound abstraction of a genuine external
call: the ghosts can take any value, including the
(false, 0)the real libraryreturns when the staticcall fails or returns short data. Keying on fewer
arguments forces a single answer across call sites a real authority can answer
differently, which removes reachable behaviour and can make an access-control
rule pass vacuously.
SafeERC20.forceApprove— deliberately excluded. Its whole purpose is therecovery path: when
approve(value)fails it retriesapprove(0)thenapprove(value). A single dispatchedapproveprunes the case the libraryexists to handle, and a ghost allowance model assumes
approvenever reverts andwrites to a ghost rather than the token in scene. Either way an approximation
lands inside autosetup, which the precision boundary exists to prevent.
Validation
Ran autosetup end-to-end against a Solady-using project, with the same invocation
the pipeline uses: the generated
<Main>_base_summaries.specgainsimport "OpenZeppelin/OZ_SafeERC20.spec";. Not merely imported —summary_resolverreported dropped entries for the other imported specs andnone for this one, so both wildcard summaries resolved against the scene and
were kept.
OZ_AuthorityUtils.spectypechecks (certoraRun --compilation_steps_only) butis not exercised end-to-end; the project used for validation does not use
AccessManager.
Tests
4 added to
tests/test_curated_library_scene_matching.py(4 -> 8, all pass),including an end-to-end match through the shipped registry and a check that every
registry entry names a spec file that exists.
pytest tests/ -k "summar or curated or autosetup or registry": 44 passed.Risk and follow-ups
Widens where an existing wildcard summary is imported; the CVL is unchanged.
Scenes using Solady's SafeTransferLib now dispatch token calls to the real token
instead of leaving unresolved raw calls.
Two things found and not fixed here:
safeApprove,safeIncreaseAllowanceandsafeDecreaseAllowanceare registryentries pointing at
OZ_SafeERC20.spec, which does not define them — theymatch and then import a file that summarises nothing. The new file-existence
test does not catch this (the file exists, the function does not); closing it
needs a check of entries against the summaries their spec actually declares.
SafeERC20entry can fail to match on projects that do use it, leavingthe curated summary unapplied. Separate from this change.
Note for the next curated entry: a wildcard method entry may not declare return
types in its signature — the result type goes in
expect. The first draft of thenew spec failed to typecheck on exactly that.