Skip to content
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

feat: add upgrade functionality for light account to msca #285

Conversation

avasisht23
Copy link
Contributor

@avasisht23 avasisht23 commented Nov 28, 2023

Pull Request Checklist

  • Did you add new tests and confirm existing tests pass? (yarn test)
  • Did you update relevant docs? (docs are found in the site folder, see guidleines below)
  • Do your commits follow the Conventional Commits standard?
  • Does your PR title also follow the Conventional Commits standard?
  • If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples? (e.g. feat!: breaking change)
  • Did you run lint (yarn lint:check) and fix any issues? (yarn lint:fix)
  • Is the base branch you're merging into development and not main?

PR-Codex overview

Focus of this PR:

This PR focuses on upgrading the Light Account implementation to a Modular Account implementation using the MultiOwnerPlugin.

Detailed summary:

  • Upgraded the LightSmartContractAccount implementation to a Modular Account implementation.
  • Added the ability to upgrade a deployed Light Account to a Modular Account using the MultiOwnerPlugin.
  • Added tests for upgrading deployed and undeployed Light Accounts to Modular Accounts.

The following files were skipped due to too many changes: packages/accounts/src/msca/abis/UpgradeableModularAccount.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@avasisht23
Copy link
Contributor Author

avasisht23 commented Nov 28, 2023

@avasisht23 avasisht23 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch from 8cb511a to 109c2c1 Compare November 28, 2023 05:26
@avasisht23 avasisht23 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch from bd93c3c to 7373bcc Compare November 29, 2023 18:18
@avasisht23 avasisht23 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch from 7373bcc to a3ed2b9 Compare November 29, 2023 18:23
Comment on lines +143 to +150
createMultiOwnerMSCA({
rpcClient,
factoryAddress: getDefaultMSCAFactoryAddress(provider.chain),
owner,
index: 0n,
chain: provider.chain,
accountAddress,
})
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is why making the upgrade function generic is difficult. the return type depends on the account type introduced to create a "connected" provider via .connect.

We ran into the same issue with the createLightAccountAlchemyProvider factory PR.

Any ideas on how to genericize without running into this error, which can only be resolved with an unknown cast:
image
Screenshot 2023-11-30 at 8 09 55 PM

@avasisht23 avasisht23 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch from 235df73 to 4873496 Compare December 1, 2023 01:23
Comment on lines +28 to +31
static readonly implementationAddress =
"0x5467b1947f47d0646704eb801e075e72aeae8113";
static readonly storageSlot =
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc";
Copy link
Contributor Author

Choose a reason for hiding this comment

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

might want to consider a subclass of Base/Simple like Upgradeable that has these fields

@avasisht23 avasisht23 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch 2 times, most recently from e4afc83 to af52780 Compare December 1, 2023 17:20
moldy530 and others added 14 commits December 1, 2023 12:39
…#290)

* docs: update CONTRIBUTING guide, fix PR template, and clean up README

* Update CONTRIBUTING.md

Co-authored-by: Ajay Vasisht <[email protected]>

* Update README.md

Co-authored-by: Ajay Vasisht <[email protected]>

* docs: make requested changes

---------

Co-authored-by: Ajay Vasisht <[email protected]>
…matic fee options for userops (#276)

* feat: aa-core smart account provider fee options to handle more systematic fee options for userops

* feat: remove fee options middleware and expose fee options to middleware functions

* feat: aa-alchemy ergonomic support for handling gas estimation (#243)

* feat: support updated overrides for alchemy request gas and paymaster and data

* feat: rebase parent where account middle func def is updated

* Update site/packages/aa-alchemy/middleware/withAlchemyGasManager.md

Co-authored-by: Ajay Vasisht <[email protected]>

* Update packages/core/src/utils/index.ts

Co-authored-by: Ajay Vasisht <[email protected]>

* Update packages/core/src/utils/index.ts

Co-authored-by: Ajay Vasisht <[email protected]>

* Update packages/core/src/provider/base.ts

Co-authored-by: Michael Moldoveanu <[email protected]>

* fix: alchemy gas manager 0x check for user op overrides

---------

Co-authored-by: Ajay Vasisht <[email protected]>
Co-authored-by: Michael Moldoveanu <[email protected]>
* feat: support one-off percentage overrides for user operations

* feat: apply user op override or fee option utils in aa-core
…errides (#277)

* feat: support one-off percentage overrides for user operations

* feat: apply user op override or fee option utils in aa-core

* docs: add documentation for smart account provider fee options and overrides

* docs: add glossary section and add general types doc in the section
denniswon and others added 7 commits December 1, 2023 12:39
* feat: add some plugin generation logic

* chore: add generate commands

* style: apply PR suggestion

Co-authored-by: Dennis Won <[email protected]>

* refactor: create plugin config concept

* feat: add multi-owner-msca impl that leverages the plugin gen (#263)

* feat: add multi-owner-msca impl that leverages the plugin gen

* feat: proposal for msca builder pattern (#264)

* feat: proposal for msca builder pattern

* refactor: rework plugin gen to create read methods for the account

---------

Co-authored-by: Dennis Won <[email protected]>
* feat: add initial skeleton for 6900 account support

* feat: add some plugin generation logic (#262)

* feat: add some plugin generation logic

* chore: add generate commands

* style: apply PR suggestion

Co-authored-by: Dennis Won <[email protected]>

* refactor: create plugin config concept

* feat: add multi-owner-msca impl that leverages the plugin gen (#263)

* feat: add multi-owner-msca impl that leverages the plugin gen

* feat: proposal for msca builder pattern (#264)

* feat: proposal for msca builder pattern

* refactor: rework plugin gen to create read methods for the account

---------

Co-authored-by: Dennis Won <[email protected]>

* chore: update plugin gen

* feat: add plugin manager decorator for MSCA

* feat: add a mechanism for adding provider decorators to accounts (#287)

* feat: add a mechanism for adding provider decorators to accounts

* chore: update lerna and package json to lint generated files

* refactor: rename MSCA to IMSCA

---------

Co-authored-by: Dennis Won <[email protected]>
Co-authored-by: avasisht23 <[email protected]>
@moldy530 moldy530 force-pushed the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch from af52780 to d22845c Compare December 1, 2023 17:50
@avasisht23 avasisht23 closed this Dec 3, 2023
@moldy530 moldy530 deleted the 11-28-feat_add_upgrade_functionality_for_light_account_to_msca branch January 30, 2024 22:43
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.

5 participants