-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix to
field in delegation quickstart
#2158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -146,7 +146,7 @@ const userOperationHash = await bundlerClient.sendUserOperation({ | |||
account: delegateSmartAccount, | |||
calls: [ | |||
{ | |||
to: delegateSmartAccount.address, | |||
to: delegatorSmartAccount.address, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Delegation Redemption Redirects to Incorrect Account
The to
address for delegation redemption was incorrectly changed from the delegate's smart account to the delegator's smart account. This forces the delegate to call the delegator's account, which is logically incorrect and assumes the delegator's account is always available. This breaks redemption functionality in environments where the delegator's account may not be present (e.g., servers), as the delegate should directly execute the DelegationManager
call through their own account, as originally designed.
delegation-toolkit/get-started/delegation-quickstart.md#L148-L149
metamask-docs/delegation-toolkit/get-started/delegation-quickstart.md
Lines 148 to 149 in c42da6b
{ | |
to: delegatorSmartAccount.address, |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Description
Fix incorrect
to
field in the redeem delegation step in the delegation quickstart.Issue(s) fixed
Fixes #2082
Preview
https://metamask-docs-me6d08aa4-consensys-ddffed67.vercel.app/delegation-toolkit/development/get-started/delegation-quickstart/#7-redeem-the-delegation
Checklist
Complete this checklist before merging your PR: