Skip to content

Add curated CVL summaries for Solady SafeTransferLib, CREATE3, LibClone#51

Open
shellygr wants to merge 4 commits into
masterfrom
shelly/solady-safetransferlib-summary
Open

Add curated CVL summaries for Solady SafeTransferLib, CREATE3, LibClone#51
shellygr wants to merge 4 commits into
masterfrom
shelly/solady-safetransferlib-summary

Conversation

@shellygr

@shellygr shellygr commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Curated CVL summaries for three Solady libraries whose inline assembly breaks the prover:

  • SafeTransferLib — reroute safe wrappers to direct token calls (mirrors the OZ SafeERC20 summary).
  • CREATE3 & LibClone — NONDET the deterministic deploy/clone/predict functions (opaque create2 assembly). Limitation: exact-address / duplicate-salt-revert properties become unverifiable.

Gated by library name in function_summaries.json. Version/overload variants are handled by the existing prune pass (name/arity) + TypecheckerLoop backstop, so overloads absent from a project go inert.

🤖 Generated with Claude Code

shellygr and others added 4 commits July 4, 2026 18:21
Reroutes SafeTransferLib's assembly-based safe wrappers (safeTransfer,
safeTransferFrom, safeApprove/safeApproveWithRetry, balanceOf) to direct
token calls with require-success, mirroring the OpenZeppelin SafeERC20
summary. The library's inline assembly is what breaks the prover's pointer
analysis; the semantics are plain ERC20 calls, so a reroute is sound.

Uses an explicit `SafeTransferLib.` receiver (not the wildcard `_.` SafeERC20
uses) so the two summaries coexist without a redeclaration conflict when a
project imports both, and so each entry is covered by the summary_resolver
prune pass. ETH helpers, the balance-derived transfer-all variants, and the
Permit2 helpers are left unsummarized (documented in the spec header).

Registered via four function_summaries.json entries gated on
library_names = ["SafeTransferLib"].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summarizes CREATE3's deterministic-deployment functions as NONDET (arbitrary
address, no modeled side effects) — the raw create/create2 assembly is opaque
to the prover, so this is the sound over-approximation setups already apply by
hand to factory clone/predict calls. Documented limitation in the spec header:
exact-address and duplicate-salt-revert properties can't be verified under it.

deployDeterministic's argument order differs across Solady versions, so both
(initCode, salt) and (salt, initCode) orders are listed. A project has only one;
the summary_resolver prune pass keeps by (receiver, name, arity) and the
TypecheckerLoop backstop auto-disables the overload not present in the code, so
listing both is safe. predictDeterministicAddress signatures are version-stable.

Registered via two function_summaries.json entries gated on
library_names = ["CREATE3"].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Internal library summaries must spell reference-type params with their data
location (see the bundled ConsenSys BytesLib summary, `bytes memory b`). The
deployDeterministic entries used bare `bytes`, which would fail to match the
compiled signature and be auto-disabled by the TypecheckerLoop, leaving the
function unsummarized. predictDeterministicAddress was unaffected (value types).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summarizes LibClone's minimal-proxy / ERC-1967 clone factory functions as NONDET
(arbitrary address / (bool,address) / bytes32 code hash, no modeled side effects)
— the raw create/create2/extcodecopy assembly is opaque to the prover, so this is
the sound over-approximation setups apply by hand to a proxy factory's
deployDeterministicERC1967 / predictDeterministicAddress calls. Documented
limitation: exact-address and duplicate-salt-revert properties can't be verified.

Scope: the address-returning families (clone*, deploy*/create*ERC1967*, predict*,
implementationOf, erc1967Bootstrap) and the bytes32 initCodeHash* family (91
overloads). Excludes the immutable-arg readers (argsOnClone/argsOnERC1967*/argLoad)
and initCode* builders: those read a proxy's immutable args from its bytecode and
need per-project ghosts to stay correlated, so they're left to hand-written specs.

Signatures generated from a real Solady LibClone compilation. Overloads absent
from a project's Solady version are dropped by the prune pass (name/arity) or
auto-disabled by the TypecheckerLoop (type mismatch), so listing the full set is
safe. Registered via one function_summaries.json entry gated on ["LibClone"].

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@@ -0,0 +1,116 @@
// Summarization of Solady's LibClone (minimal-proxy / ERC-1967 clone factory library).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

these are quite aggressive. double check with previous projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant