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: transfer_ownership_v2 #488

Merged
merged 15 commits into from
May 13, 2024
Merged

feat: transfer_ownership_v2 #488

merged 15 commits into from
May 13, 2024

Conversation

VGabriel45
Copy link
Collaborator

@VGabriel45 VGabriel45 commented May 13, 2024

Added moduleAddress parameter to transferOwnership() method.


PR-Codex overview

The focus of this PR is to enhance ownership transfer functionality in the smart account module.

Detailed summary

  • Added a new TransferOwnershipCompatibleModule type for specifying validation modules.
  • Modified transfer ownership functions to include the module address parameter.
  • Updated tests to reflect the changes in ownership transfer functionality.

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

Copy link
Collaborator

@joepegler joepegler left a comment

Choose a reason for hiding this comment

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

lgtm. just some logs. Nice work

tests/account/write.test.ts Outdated Show resolved Hide resolved
@VGabriel45 VGabriel45 changed the title feat:transfer ownership v2 feat: transfer_ownership_v2 May 13, 2024
Copy link

github-actions bot commented May 13, 2024

size-limit report 📦

Path Size
core (esm) 52.33 KB (0%)
core (cjs) 56.93 KB (0%)
account (tree-shaking) 51.29 KB (0%)
bundler (tree-shaking) 2.33 KB (0%)
paymaster (tree-shaking) 2.27 KB (0%)
modules (tree-shaking) 40.05 KB (0%)

bundlerUrl: `https://bundler.biconomy.io/api/v2/84532/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44`,
chainId: 84532,
accountAddress: await smartAccount.getAccountAddress()
})
* ```
*/
async transferOwnership(
Copy link
Contributor

Choose a reason for hiding this comment

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

since you want to modularize it,
I'd say instead of newOwner make it an object called newOwnershipInfo and have eoa pubkey (newOwner) as one of possible args
encodedCall call also be just passed optional which will directly call the chosen module. currently encoded call only builds for transferOwnership(address _newower) which is only applicable for moduleAddress passed as ECDSA or Multi-chain

or we can just let it be as this is. food for thought :)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The usecase is only for ECDSA and Multi Chain anyway, I would prefer to let it as it is. If we allow encodedCall as an argument, then anything can be passed to it, this method should only allow to do what it says, a transfer of ownership. Lmk what you think @livingrockrises

Copy link
Contributor

Choose a reason for hiding this comment

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

yes we can let it be and be precise on the description that module address passed would be ecdsa or multi-chain (any module which has single eoa owner and has transferOwnership method in it)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added a type for this argument, to allow only ECDSA and Multichain module address

Copy link
Contributor

@livingrockrises livingrockrises left a comment

Choose a reason for hiding this comment

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

reviewed

@VGabriel45 VGabriel45 merged commit 76be2c0 into develop May 13, 2024
5 of 6 checks passed
VGabriel45 added a commit that referenced this pull request May 13, 2024
* feat: gas offset param for sendTransaction and sendUserOp (#474)

* feat - gas offset param for sendTransaction

* added percentage based gas offsets

* added dummyPndOverride

* refactor gas offset percentage

* refactor names and ts doc + lint

* improved tsdoc & fixed comments

* refactor sendTransaction example tsdoc comment

* refactor sendTransaction test

---------

Co-authored-by: GabiDev <gv@popoo.io>

* feat: transfer ownership (#484)

feat: transfer ownership (#484)

* feat: transfer_ownership_v2 (#488)

* feat/transfer_ownership(in progress)

* cleanup

* fix linting

* added test for transferOwnership with session key manager module

* Fix linting

* refactor: refactor based on PR review

* improve ts doc + refactor tests

* added "moduleAddress" param to transferOwnership()

* fix module tests

* removed console.logs

* fixed lint + removed unused import

* remove unused import

* added argument type for module address

---------

Co-authored-by: GabiDev <gv@popoo.io>

---------

Co-authored-by: GabiDev <gv@popoo.io>
VGabriel45 added a commit that referenced this pull request May 14, 2024
* feat: gas offset param for sendTransaction and sendUserOp (#474)

* feat - gas offset param for sendTransaction

* added percentage based gas offsets

* added dummyPndOverride

* refactor gas offset percentage

* refactor names and ts doc + lint

* improved tsdoc & fixed comments

* refactor sendTransaction example tsdoc comment

* refactor sendTransaction test

---------

Co-authored-by: GabiDev <gv@popoo.io>

* feat: transfer ownership (#484)

feat: transfer ownership (#484)

* feat: transfer_ownership_v2 (#488)

* feat/transfer_ownership(in progress)

* cleanup

* fix linting

* added test for transferOwnership with session key manager module

* Fix linting

* refactor: refactor based on PR review

* improve ts doc + refactor tests

* added "moduleAddress" param to transferOwnership()

* fix module tests

* removed console.logs

* fixed lint + removed unused import

* remove unused import

* added argument type for module address

---------

Co-authored-by: GabiDev <gv@popoo.io>

* chore: release v4.3.0 (#491)

* release v4.3.0

* refactor: increase timeout for transferOwnership tests

---------

Co-authored-by: GabiDev <gv@popoo.io>

---------

Co-authored-by: GabiDev <gv@popoo.io>
Co-authored-by: Joe Pegler <joepegler123@gmail.com>
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.

4 participants