Skip to content

feat: Add support for relayed transfers on CLPc#24

Merged
boris merged 4 commits intomainfrom
feat/reduce-tx-gas
Mar 16, 2026
Merged

feat: Add support for relayed transfers on CLPc#24
boris merged 4 commits intomainfrom
feat/reduce-tx-gas

Conversation

@boris
Copy link
Copy Markdown
Collaborator

@boris boris commented Mar 11, 2026

This pull request adds support for ERC-2771 meta-transactions to the CLPc token contract by introducing a configurable trusted forwarder. It also provides new Makefile tasks to manage and verify the trusted forwarder, and emits relevant events for transparency when the forwarder is changed. The most important changes are grouped below:

ERC-2771 Meta-transaction Support in CLPc:

  • Added a trustedForwarder state variable to the CLPc contract to store the address of the trusted forwarder.
  • Introduced the setTrustedForwarder function (admin-only) to configure the trusted forwarder, and the isTrustedForwarder view function to check if an address is the current trusted forwarder.
  • Overrode the internal _msgSender and _msgData functions to correctly extract the original sender and calldata when transactions are relayed through the trusted forwarder.

Event Emission for Forwarder Updates:

  • Added a TrustedForwarderUpdated event that is emitted whenever the trusted forwarder is changed, including both the old and new addresses.

Makefile Enhancements for Forwarder Management:

  • Added new Makefile tasks to set, check, and verify the trusted forwarder in the CLPc token, as well as to generate calldata for token transfers.

@boris boris merged commit 5817813 into main Mar 16, 2026
1 check passed
@boris boris deleted the feat/reduce-tx-gas branch March 16, 2026 14:29
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.

1 participant