Skip to content

fix to field in redeem delegations guide#2158

Merged
alexandratran merged 5 commits into
mainfrom
2082-fix-dtk-quickstart
Jul 23, 2025
Merged

fix to field in redeem delegations guide#2158
alexandratran merged 5 commits into
mainfrom
2082-fix-dtk-quickstart

Conversation

@alexandratran

@alexandratran alexandratran commented Jul 18, 2025

Copy link
Copy Markdown
Contributor

Description

Fix to field in the Redeem delegations guide to make it consistent with the quickstart.

Issue(s) fixed

Fixes #2082

Checklist

Complete this checklist before merging your PR:

  • If this PR contains a major change to the documentation content, I have added an entry to the top of the "What's new?" page.
  • The proposed changes have been reviewed and approved by a member of the documentation team.

@alexandratran alexandratran requested review from a team as code owners July 18, 2025 21:54
@vercel

vercel Bot commented Jul 18, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
metamask-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 22, 2025 11:39pm

calls: [
{
to: delegateSmartAccount.address,
to: delegatorSmartAccount.address,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not actually sure if we should document delegatorSmartAccount. It assumes the delegatorSmartAccount will be present always which is not the case, if the delegations are stored, or if delegations are used in different environment to redeem like server, it won't stand true. Hence it was using delegateSmartAccount.address. Maybe we should change the documentation for redeemDelegation rather than quickstart. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we keep delegateSmartAccount here, what about the issue stated in #2082?

Using the delegate's address causes the UserOperation to fail, often with no clear error unless debugged deeply. The delegation signature isn't validated on the delegate’s account, which leads to invalid operations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work fine, when redeemDelegations is called on Smart Account, it just works as a proxy for delegation manager. So all the calls are passed and processed by Delegation manager.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've switched to updating the Redeem delegation guide instead, lmk if this is correct.

cursor[bot]

This comment was marked as outdated.

@Rahul-cyber26 Rahul-cyber26 mentioned this pull request Jul 19, 2025
2 tasks
@alexandratran alexandratran changed the title fix to field in delegation quickstart fix to field in redeem delegations guide Jul 21, 2025
cursor[bot]

This comment was marked as outdated.

@AyushBherwani1998 AyushBherwani1998 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Delegation Redemption Targets Incorrect Contract

The smart account example for delegation redemption incorrectly targets the delegate's smart account (delegateSmartAccount.address) instead of the DelegationManager contract. The redeemDelegationCalldata is encoded for DelegationManager.redeemDelegations(). Sending this calldata to the delegate's account causes the UserOperation to fail, as the delegate's account does not implement the redeemDelegations function or validate delegation signatures. This logical error occurs in two places and contradicts the EOA example, which correctly targets the DelegationManager.

delegation-toolkit/how-to/redeem-delegation.md#L68-L69

{
to: delegateSmartAccount.address,

delegation-toolkit/how-to/redeem-delegation.md#L258-L259

{
to: delegateSmartAccount.address,

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@alexandratran alexandratran merged commit a441e61 into main Jul 23, 2025
19 checks passed
@alexandratran alexandratran deleted the 2082-fix-dtk-quickstart branch July 23, 2025 03:46
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.

to field in sendUserOperation() is incorrect in Quick Start example

2 participants