-
Notifications
You must be signed in to change notification settings - Fork 196
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
Proposal: account delegation via callFrom
#1358
Comments
I'm curious about what I imagine will be the most common use case: account delegation from EOA to burner wallet for an indefinite period of time. I assume this path would mean extra gas via |
if the delegation is not limited to certain functions, the |
Ohh got it! I glossed over the unlimited delegation bit. 👌 |
from your perspective, what would be the most "ERC-4337" native way of doing this? |
In my mind this proposal is mostly orthogonal to ERC-4337. There are some overlapping use cases (e.g. “session wallets” could also be implemented as a type of 4337 account), but other use cases are different. Most notably the use case of temporary approvals for specific function calls isn’t really a design goal of 4337, while it’s one of the core design goals of callFrom (i.e. support “atomic swaps” with any system akin to ERC-20’s approve/transferFrom pattern, or allow modules to set up stuff in your name, or allow a system to call other lower level systems in your name). It would definitely be possible to create a 4337 account that implements logic to temporarily delegate access to certain functions to other accounts, but it wouldn’t be the most straightforward solution, and it would be outside the MUD protocol, so other protocol features couldn’t build on top of it. |
Abstract
This proposal introduces a modular mechanism allowing accounts to delegate other accounts to execute functions on their behalf. By modularizing the delegation logic, we can cater to various use cases, from simple unlimited delegations to complex, conditional ones.
Design Goals
Sample use cases
approve
+transferFrom
mechanism.registerHook
without transferring namespace ownership.Proposed solution
Overview
callFrom
entry point.Implementation
Any contract implementing the
DelegationCheck
interface can be associated with a limited delegation.For efficiency, a constant (
address(1)
) can represent unlimited delegations, circumventing the need for contract calls in this case.Once a delegation is registered, the “grantee” can call functions on behalf of the “grantor” using
callFrom
. The world checks the validity of a delegation by calling the delegation check system registered for this grantee/grantor. There may be a different delegation check contract for each grantee, and/or a default delegation check for each grantor.With this setup in place delegation types such as limiting the number of calls can be added via a module.
registerLimitedDelegation
function to include a parameter for arbitrary bytes, which are passed to the system’s init function. This would simplify the UX of creating and initializing a limited delegationRelated issues
The text was updated successfully, but these errors were encountered: