0

Is there a pattern that Safe advises for adding multiple 4337-compatible modules to a Safe?

4337-compatible module meaning a module that can be added/removed to a Safe that can be called through a user operation submitted to the entrypoint. The end goal would be to have a Safe with multiple modules, with functions on each module can be called via a userOp. An example use case might be wanting to add a recovery module as well as the existing canonical safe 4337 module.

It appears as though the current flow outlined here relies on the call going through the fallback handler to the 4337 module. Perhaps adding multiple modules in this flow would be difficult because the existing 4337 module is also the fallback handler.

2 Answers 2

1

You are right, this would create problems. Currently, you can only have one 4337 module, as it would create routing problems with the default fallback handler. If you change it to a dedicated "routing" fallback handler, to handle this, it could theoretically work though.

Hope it helps, Louis

1
  • Ok got it. That's helpful to know it's theoretically possible - thanks Commented Jan 4 at 14:14
2

An example of such a routing fallback handler can be found here (if the link is dead, google CoW ExtensibleFallbackHandler.sol). More details are available in this blog post.

This fallback handler might not be compatible with erc4337 specs because it'd have to access its storage, and 4337 doesn't allow access to 3rd party storage during the validation phase (unless it's associated with the account address; there are ways around it).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.