feat: bind EIP-712 signed invites to recipient address#148
Open
Tranquil-Flow wants to merge 2 commits into
Open
feat: bind EIP-712 signed invites to recipient address#148Tranquil-Flow wants to merge 2 commits into
Tranquil-Flow wants to merge 2 commits into
Conversation
Update the EIP-712 invite typehash to include the recipient address, preventing any holder of a valid signed invite from redeeming it unless they are the intended recipient. The owner controls invite issuance; address-binding adds defence-in-depth with no protocol downside. - Update _INVITE_TYPEHASH to include recipient address - Update redeemInvite() to verify msg.sender matches the bound address - Add regression tests for both valid redemption and rejection of wrong sender - Add TASKS.md as project tracking file - Closes: #77
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.
Summary
Closes #77
Signed invites were not address-bound — anyone who obtained a valid signed invite could redeem it. This adds the intended recipient address to the EIP-712 typehash and verifies
msg.sendermatches at redemption time.Breaking change: The
InviteEIP-712 typehash changes fromInvite(uint256 id,uint256 nonce)toInvite(uint256 id,uint256 nonce,address recipient). Any previously signed invites will be invalidated.Changes
_INVITE_TYPEHASH: updated to includeaddress recipient_hashInvite(): accepts_recipientparameter, encodes it in the struct hashredeemInvite(): passesmsg.senderas recipient — signature recovery fails if sender doesn't matchtest_RedeemInviteRejectsWrongSender,test_RedeemInviteAcceptsCorrectRecipientTest plan
forge testpasses (142 tests)