feat: Add support for relayed transfers on CLPc#24
Merged
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.
This pull request adds support for ERC-2771 meta-transactions to the
CLPctoken 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:trustedForwarderstate variable to theCLPccontract to store the address of the trusted forwarder.setTrustedForwarderfunction (admin-only) to configure the trusted forwarder, and theisTrustedForwarderview function to check if an address is the current trusted forwarder._msgSenderand_msgDatafunctions to correctly extract the original sender and calldata when transactions are relayed through the trusted forwarder.Event Emission for Forwarder Updates:
TrustedForwarderUpdatedevent that is emitted whenever the trusted forwarder is changed, including both the old and new addresses.Makefile Enhancements for Forwarder Management:
CLPctoken, as well as to generate calldata for token transfers.