Skip to content

[ETHEREUM-CONTRACTS] ClearMacro forwarder (+ Permit2 variant)#2148

Draft
d10r wants to merge 33 commits intodevfrom
2026-03-permit2_and_macro
Draft

[ETHEREUM-CONTRACTS] ClearMacro forwarder (+ Permit2 variant)#2148
d10r wants to merge 33 commits intodevfrom
2026-03-permit2_and_macro

Conversation

@d10r
Copy link
Collaborator

@d10r d10r commented Mar 9, 2026

Summary

Introduces a ClearMacro Forwarder that runs macros via EIP-712 signed payloads (action + security). Includes an optional Permit2 variant for flows where the user also transfers/upgrades tokens in the same signature.

ClearMacro Forwarder

  • Contract: ClearMacroForwarder — executes macros on behalf of a signer. Payload: macro-specific action (opaque; macro defines EIP-712 type/struct hash) and security (domain, provider, validity window, ERC-4337-style nonce).
  • Flow: Relayer or signer calls runMacro(macro, params, signer, signature). Forwarder verifies signature, validates validity window and nonce, enforces provider ACL, then runs the macro.
  • Interfaces: IClearMacroForwarder (payload, runMacro, encodeParams, type getters), IClearMacro (extends IMacro with EIP-712 metadata: getPrimaryTypeName, getActionTypeDefinition, getActionStructHash).
  • Scripts for deployment and macro-provider ACL; Foundry tests for signature, nonce, validity, provider checks and encoding.

Permit2 variant (optional)

  • Contract: Permit2ClearMacroForwarder — same ClearMacro payload, bound via Permit2 witness; entrypoint runPermit2AndMacro(...).
  • Use case: One signature: pull via Permit2 → optional upgrade to SuperToken (forwarder) → run macro. For users who already have a Permit2 allowance.

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Changelog Reminder

Reminder to update the CHANGELOG.md for any of the modified packages in this PR.

  • CHANGELOG.md modified
  • Double check before merge

@codecov
Copy link

codecov bot commented Mar 10, 2026

@d10r d10r changed the base branch from 2026-01-only712 to dev March 17, 2026 11:22
@d10r d10r changed the title Add variant of Only712MacroForwarder which can be used via Permit2 witness [ETHEREUM-CONTRACTS] ClearMacro forwarder (+ Permit2 variant) Mar 17, 2026
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.

2 participants