EVM: Add settler function to set safeguards with a signature - #84
Merged
Conversation
Adds setSafeguardWithSignature so a safeguard can be set on behalf of a user by anyone holding the user's EIP-712 signature, instead of requiring the user to be msg.sender. The signature is bound to a per-user nonce and a deadline to prevent replays of stale authorizations. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
lgalende
reviewed
Aug 26, 2026
Co-authored-by: lgalende <63872655+lgalende@users.noreply.github.com>
lgalende
reviewed
Aug 26, 2026
lgalende
approved these changes
Aug 26, 2026
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.
Lets anyone submit a safeguard on a user's behalf with that user's EIP-712 signature. Previously
setSafeguardtook the user frommsg.sender, so users had to send the tx themselves.Decisions worth review
User-chosen nonces (
isUserSafeguardNonceUsed[user][nonce]), not a sequential counter. A counter forces signatures to be consumed in issue order, so one unsubmitted signature blocksevery later one. Each signature stays single-use; the deadline bounds how long an unsubmitted one lives.
ERC-1271 is supported, so Safe and other smart accounts work. ECDSA is tried first, unlike OZ's
isValidSignatureNowwhich branches oncode.length— post-Pectra anEIP-7702-delegated EOA has code, and OZ's ordering would reject its valid ECDSA signature.
Two things integrators need to know: clients must sign through Safe's own message flow (
protocol-kit), not by signing our digest directly; and an empty signature is valid for accountsthat record approved messages on-chain, so it must not be treated as a skip.
via-IR is now required, not an optimization. Every way of adding ERC-1271 overflowed EIP-170 under the legacy pipeline (24,726–24,823 vs. the 24,576 limit — externalizing the check was
the worst of them). With
viaIR: true,Settleris 23,248 with 1,328 bytes spare.