getwax / wax

Wallet Account eXperiments Monorepo
MIT License
26 stars 13 forks source link

Plugin improvements #208

Open JohnGuilding opened 9 months ago

JohnGuilding commented 9 months ago

MVP

  1. Decide approach on deploying accounts via initCode
  2. Add functionality from CompatibilityFallbackHandler
  3. Decide on using singletons or non-singletons for plugins. Delete/add factories based on this decision
  4. Add disable module functionality
  5. Add Natspec comments
  6. Add interfaces
  7. Ensure events and errors are sufficient
  8. The enable() function was pretty much copied from kernel, we should double check we’re happy with this code

Nice to have

  1. Handle multiple 4337-compatible plugins. Most likely option is we write a routing fallback handler. We can take inspiration from CoW swaps’ extensible fallback handler
  2. Based off of this, validateUserOp should be supported in each 4337-compatible module.

Other features to consider

  1. Consider _packValidationData to pack validAfter and validUntil
  2. Decide whether to use EIP-712 typed hash for signature verification
  3. Helper function to check if module has been enabled for a specific wallet
  4. ERC-1271 support. Safe supports ERC-1271, but how would things work if you wanted to sign something with a signer on one of your modules? Seen 1271 supported in some validator modules
  5. Should/can we support batched transactions? e.g. executeBatch function as well as an execute function
  6. Do we distinguish between validator modules and executor modules?
  7. Consider ERC-165

Security

Once feature complete, we should ensure the code is well tested. Regarding security, here is a helpful resource with a 4337-specific audit checklist and links to project audits https://github.com/aviggiano/security/blob/main/audit-checklists/ERC-4337.md