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

account V2 implementation first version + dev notes #255

Merged
merged 18 commits into from
Aug 22, 2023

Conversation

livingrockrises
Copy link
Contributor

@livingrockrises livingrockrises commented Aug 18, 2023

Description

BiconomySmartAccountV2
which follows new BaseSmartAccount abstract class design and IBaseSmartAccount interface.
This account relies on validation module classes to perform signing related operations and retrieve information required specific to modules.
init is not specifically overridden (basic init exists in super class) - unlike BiconomyAccountV1
I also commented out init, initializeAtIndex and setupContracts etc methods because currently I don't see the need for them.

setInitCode doesnt need to be part of init to set local var called initcode.
generally you should be able to query getAccountAddress and _getAccountContract() to get account / proxy information (contract or address)
similarly this.factory would be initiased as part of this.getAccountAddress which only relies on the initCode.

currently nodeClient is part and accessible but it's not used to query any address config or account info. maybe once we have smartAccountAddress maybe we can query it and perform some init checks. but should not use the nodeclient method getSmartaccountByOwner() (basically any more or owner passing)

please review and check relevant method implementations in userOperation creation and dispatch lifecycle. some trace back to implementation written in abstract class.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@linear
Copy link

linear bot commented Aug 18, 2023

packages/account/src/BaseSmartAccount.ts Outdated Show resolved Hide resolved
packages/account/src/BiconomySmartAccount.ts Outdated Show resolved Hide resolved
packages/account/src/BiconomySmartAccountV2.ts Outdated Show resolved Hide resolved
}

async buildUserOp(
transactions: Transaction[],
Copy link
Collaborator

Choose a reason for hiding this comment

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

If it's more than one parameter, convert the method param into single object with multiple fields.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

wasn't this for more than 3?
I can make object input but V1 clients are used to not passing the object right now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm 3 is also fine, but looking at the last parameter it looks like more such flags can be introduced in the future.

packages/account/src/BiconomySmartAccountV2.ts Outdated Show resolved Hide resolved
packages/account/src/BiconomySmartAccountV2.ts Outdated Show resolved Hide resolved
packages/account/src/BiconomySmartAccountV2.ts Outdated Show resolved Hide resolved
this.factoryAddress = biconomySmartAccountConfig.factoryAddress
// Review: if it's really needed to supply factory address
this.factoryAddress =
biconomySmartAccountConfig.factoryAddress ?? DEFAULT_BICONOMY_FACTORY_ADDRESS // This would be fetched from V2
Copy link
Contributor

Choose a reason for hiding this comment

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

do we plan to call these by backend or we will be using the default ones in sdk from now on?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

currently I don't see value in fetching it from backend. so it's either provided in config, from constants using provided version or default from constant.

Copy link
Contributor

@AmanRaj1608 AmanRaj1608 left a comment

Choose a reason for hiding this comment

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

Can remove commented code and merge

@livingrockrises
Copy link
Contributor Author

Can remove commented code and merge

which part?

@livingrockrises livingrockrises merged commit 89804df into feat/modular-SA-V2-integration Aug 22, 2023
@AmanRaj1608 AmanRaj1608 deleted the SMA-58-BSA-V2-class branch September 29, 2023 03:33
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.

3 participants