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 entity id nonce logic #1209

Closed
wants to merge 6 commits into from
Closed

feat: add entity id nonce logic #1209

wants to merge 6 commits into from

Conversation

howydev
Copy link
Collaborator

@howydev howydev commented Dec 12, 2024

PR-Codex overview

This PR primarily focuses on updating the versions of various packages and components in the project, along with adding a new React Native example application. It includes improvements to the Android and iOS configurations, as well as updates to the smart contracts and utilities.

Detailed summary

  • Bumped version numbers across multiple packages to 4.6.1.
  • Added a new React Native example app with configuration files.
  • Updated AndroidManifest.xml and AppDelegate for proper app setup.
  • Introduced new utility functions and modules in smart contracts.
  • Enhanced project structure and build configurations for better performance.

The following files were skipped due to too many changes: examples/react-native-bare-example/ios/ReactNativeBareExample/LaunchScreen.storyboard, examples/react-native-bare-example/src/screens/Home.tsx, account-kit/smart-contracts/src/ma-v2/account/account.ts, account-kit/smart-contracts/src/ma-v2/modules/time-range-module/abis/timeRangeModule.ts, examples/react-native-bare-example/android/app/build.gradle, account-kit/smart-contracts/src/ma-v2/modules/single-signer-validation/abis/singleSignerValidationModule.ts, account-kit/smart-contracts/src/ma-v2/modules/webauthn-validation/abis/webauthnValidation.ts, account-kit/smart-contracts/src/ma-v2/modules/native-token-limit-module/abis/nativeTokenLimitModule.ts, examples/react-native-bare-example/android/gradlew, account-kit/smart-contracts/src/ma-v2/abis/accountFactoryAbi.ts, account-kit/smart-contracts/src/ma-v2/modules/allowlist-module/abis/allowlistModule.ts, account-kit/smart-contracts/src/ma-v2/abis/modularAccountAbi.ts, account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountBytecodeAbi.ts, account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountStorageAbi.ts, examples/react-native-bare-example/ios/ReactNativeBareExample.xcodeproj/project.pbxproj, yarn.lock

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

Copy link

vercel bot commented Dec 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 0:42am
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 14, 2024 0:42am

Copy link

graphite-app bot commented Dec 12, 2024

How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

const getAccountNonce = async (nonceKey?: bigint): Promise<bigint> => {
// uint32 entityId + (bytes1 options) makes a uint40
const nonceKeySuffix: bigint =
entityId * 256n + (isGlobalValidation ? 1n : 0n);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sanity check: is there a convention/preference to build a bytes40 from a (bytes32 << 8 | bytes8)?

Copy link
Contributor

Choose a reason for hiding this comment

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

You're actually making a bytes5 I think?

You can do something like:

fromHex(concat(pad(toHex(entityId), 4), pad(toHex(isGlobalValidation), 1)), "bigint")

More verbose but maybe clearer to see what's going on?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

like it, prefer this over the current implementation


if (nonceKey) {
// comparing the end 40 bytes to suffix
if (nonceKey % 2n ** 40n != nonceKeySuffix) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sanity check: is there a better convention or preferred way to do this?

Copy link
Collaborator

@Blu-J Blu-J left a comment

Choose a reason for hiding this comment

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

Adding some comments just to get involved, most of these are meant as discussion and not for fixing things. Probably would need a real reviewer for approval, not familiar enough with the codespace.

@@ -49,6 +50,8 @@ export type CreateSMAV2AccountAccountParams<
initialOwner?: Address;
accountAddress?: Address;
entryPoint?: EntryPointDef<TEntryPointVersion, Chain>;
isGlobalValidation?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

💬 I always question when booleans are passed around. In this case the global validation is just for the nonce creation in the getAccountNonce right. And At these points I think of other potential apis, like maybe the name could have been NonceBytes, with constants of GLOBAL_VALIDATION_NONCE = 1n, NO_OPS_NONCE = 0n. Or another could have been nonceModifiers (a: nonce) => nonce, basically a fn instead. I don't know what the correct choice is, but every time I see a flag param, I have these questions.

Copy link
Collaborator Author

@howydev howydev Dec 13, 2024

Choose a reason for hiding this comment

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

Very thought provoking!

This current flag flips a bit in a byte in getAccountNonce, but there would eventually be another flag (isDeferredAction) that toggles a second bit in the same byte. I was thinking of using the two booleans to create the final byte like this: isDeferredAction ? 1 << 8 : 0 | isGlobalValidation ? 1 : 0

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Which implementation would you choose for the above?

Copy link
Collaborator

Choose a reason for hiding this comment

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

So, funny enough, I might still do the boolean flags.
I am trying to create a good thought provoking.
Given that I would probably choose the easiest like has been done, the other would be the fixed point operator as a function would still work.

nonceModifier: NonceModifiers.None,
nonceModifier: NonceModifiers.DefferedAction,
nonceModifier: NonceModifiers.GlobalValidation,
nonceModifier: NonceModifiers.compose(NonceModifiers.GlobalValidation, NonceModifiers.DefferedAction),
nonceModifier: NonceModifiers.GlobalValidationAndDefferedAction,

I would go away from the single bit operator. But again, I'm just trying to give another tool for the toolbox.
The problem with the isDefferedAction is seen that we add another flag, and we may add another in the future. If we had two places where the flags where being used, and a new flag was added. The chances of missing the other location for the flag is there. While this fn style lets us do the same operation in multiple areas.

And if we wanted this to be a typed with phantom, we could have done

nonceModifier: NonceModifier

type NonceModifier = <N extends  bigint & {__type: "NONCE"}>(nonce: N) => N & {__type: "MODIFED_NONCE}
/// Implement the type for each of the NonceModifiers
NonceModifiers.compose = (...as: NonceModifiers) => as.reduce((a, b) => (nonce) => a(b(nonce)), NonceModifiers.None) as NonceModifier

} = config;

if (entityId >= 2n ** 32n) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

💬 I see validation then wonder if we should have done a parse instead. There are many articles + videos, but it comes from a more type driven programming. https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
And in this case the phantom types could be the parsed proof https://matheusvellone.medium.com/using-phantom-types-to-extreme-type-guard-bec685d6695c
And all this was just to bring up the topic with an example, not to decide what is right and wrong. I usually just like showing other ways of doing things. Getting something out faster, this is usually the better approach.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Love this! Is there a uint32 type we could use here instead of bigint?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah, phantom types, i see. Ok I'll read up and implement this in! (next week, will leave these in for now)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please leave them in for now, I just
A. Wanted to show the phantom types
B. Get people a new tool

Because now we have the ability to make an API that reduces the chances of the wrong things fitting into other holes. While not removing the previous tools and API's used previously.

Copy link
Collaborator

Choose a reason for hiding this comment

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

In rust this would be a Newtype https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html
But it suffers from more issues compared to TS because TS doesn't care of ordering. There could be some trait type tricks but those also have issues that TS doesn't have.

const nonceKeySuffix: bigint =
entityId * 256n + (isGlobalValidation ? 1n : 0n);

if (nonceKey) {
Copy link
Collaborator

@Blu-J Blu-J Dec 12, 2024

Choose a reason for hiding this comment

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

💬 Please don't change anything, I just want a discussion.
I also tend to see mutation in TS and think of a fn.

const _globalNonce = (nonceKey?: bigint) => {
const nonceKeySuffix: bigint =
      entityId * 256n + (isGlobalValidation ? 1n : 0n);
      if (nonceKey) {
         if (nonceKey % 2n ** 40n !== nonceKeySuffix) {
            throw new Error("Invalid nonceKey");
          }
      }
      return nonceKeySuffix

Then in the entryPointContract, which is the only place that we use the nonce

return entryPointContract.read.getNonce([
      accountAddress,
      __globalNonce(nonceKey),
    ]) as Promise<bigint>;

Or could have set it to a variable w/o setting the original

const globalNonce = _globalNonce(nonceKey)

Or something like that. In TS I have an aversion to setting variables, yet in rust I do it all the time. I don't know the correct solution.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Interesting approach. I don't think there is a correct solution in general, but I have a feeling that some of the code here would change once @moldy530 takes a look :P

Copy link
Collaborator

Choose a reason for hiding this comment

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

I also like the solution that @jaypaik has as well with ?? #1209 (comment), it also works in the similar vain of avoid re-assigning a variable.

} = config;

if (entityId >= 2n ** 32n) {
throw new Error("Entity ID must be less than uint32.max");
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefer to use errors that inherit from BaseError, like this one:

/**
* Represents an error thrown when a client is not compatible with the expected client type for a specific method. The error message provides guidance on how to create a compatible client.
*/
export class IncompatibleClientError extends BaseError {
override name = "IncompatibleClientError";
/**
* Throws an error when the client type does not match the expected client type.
*
* @param {string} expectedClient The expected type of the client.
* @param {string} method The method that was called.
* @param {Client} client The client instance.
*/
constructor(expectedClient: string, method: string, client: Client) {
super(
[
`Client of type (${client.type}) is not a ${expectedClient}.`,
`Create one with \`createSmartAccountClient\` first before using \`${method}\``,
].join("\n")
);
}
}

If an appropriate custom error doesn't exist, let's create one!

} = config;

if (entityId >= 2n ** 32n) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated, but you can instead do

Suggested change
if (entityId >= 2n ** 32n) {
if (entityId > maxUint32) {

import from viem.

const getAccountNonce = async (nonceKey?: bigint): Promise<bigint> => {
// uint32 entityId + (bytes1 options) makes a uint40
const nonceKeySuffix: bigint =
entityId * 256n + (isGlobalValidation ? 1n : 0n);
Copy link
Contributor

Choose a reason for hiding this comment

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

You're actually making a bytes5 I think?

You can do something like:

fromHex(concat(pad(toHex(entityId), 4), pad(toHex(isGlobalValidation), 1)), "bigint")

More verbose but maybe clearer to see what's going on?


if (nonceKey) {
// comparing the end 40 bytes to suffix
if (nonceKey % 2n ** 40n !== nonceKeySuffix) {
Copy link
Contributor

@jaypaik jaypaik Dec 13, 2024

Choose a reason for hiding this comment

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

Something else you could do:

const nonceKeySuffix = concat(pad(toHex(entityId), 4), pad(toHex(isGlobalValidation), 1));
// may need extra checks to ensure nonceKey is of sufficient length and also that both share the same casing
if (nonceKey != null && slice(toHex(nonceKey), -5) !== nonceKeySuffix) {
  // throw error
}
...
return entryPointContract.read.getNonce([
  accountAddress,
  nonceKey ?? nonceKeySuffix, // may need to convert to bigint
]);

Copy link
Collaborator Author

howydev commented Dec 13, 2024

Merge activity

  • Dec 13, 11:13 AM EST: The merge label 'graphite-merge-queue' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Dec 13, 4:55 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 5:49 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 5:50 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 5:52 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 5:55 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 7:35 PM EST: Graphite rebased this pull request after merging its parent, because this pull request is set to merge when ready.
  • Dec 13, 7:35 PM EST: A user added this pull request to the Graphite merge queue.
  • Jan 7, 2:39 PM EST: A user removed this pull request from the Graphite merge queue.

@graphite-app graphite-app bot changed the base branch from howy/add-mav2-account to main December 13, 2024 16:13
@howydev howydev changed the base branch from main to howy/add-mav2-account December 13, 2024 16:27
@linnall linnall mentioned this pull request Dec 13, 2024
7 tasks
Copy link
Collaborator Author

howydev commented Dec 13, 2024


How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@howydev howydev changed the base branch from howy/add-mav2-account to main December 13, 2024 22:51
@howydev howydev changed the base branch from main to graphite-base/1209 December 13, 2024 22:52
@howydev howydev changed the base branch from graphite-base/1209 to howy/add-mav2-account December 13, 2024 22:52
@howydev howydev changed the base branch from howy/add-mav2-account to main December 13, 2024 22:55
@howydev howydev changed the base branch from main to graphite-base/1209 December 13, 2024 22:55
* fix: rn stamper was returning stamp instead of response (#1201)

* chore(release): publish v4.6.1 [skip-ci]

* feat: add react-native-bare implementation (#1202)

* feat: add react-native-bare implementation

* fix: fix linting

* fix: fix linting

* fix: remove unnecessary console.log statements

* feat: add signer and account addresses to user logged in screen

* fix: updates facebook icon used in ui component (#1196)

* feat: add mav2 signer (#1203)

# 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, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md))
- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard?
- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 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:write`)
- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)?

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new `SingleSignerValidation` module and related utilities for signature packing and handling user operation signing. It enhances the smart contract framework by implementing various functions and defining the ABI for the module.

### Detailed summary
- Added `PackSignatureParams` type and `packSignature` utility in `utils.ts`.
- Created `SingleSignerValidationModule` with metadata and encoding functions in `single-signer-validation/module.ts`.
- Implemented `singleSignerMessageSigner` function in `single-signer-validation/signer.ts` for signature management.
- Defined the ABI for `singleSignerValidation` in `abis/singleSignerValidation.ts`.
- Added `MAV2FactoryAbi` and `smaV2Abi` with functions and events related to account management in respective ABI files.

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

<!-- end pr-codex -->

---------

Co-authored-by: Michael Moldoveanu <michael.moldoveanu@alchemy.com>
Co-authored-by: Alchemy Bot <alchemy-bot@alchemy.com>
Co-authored-by: Iyk Azorji <iykazorji@gmail.com>
# Pull Request Checklist

- [x] Did you add new tests and confirm existing tests pass? (`yarn test`)
- [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md))
- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard?
- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 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:write`)
- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)?

<!-- start pr-codex -->

---

## PR-Codex overview
This PR focuses on renaming and restructuring several ABI files and exports in the smart contracts directory, enhancing clarity and consistency in the codebase.

### Detailed summary
- Renamed `MAV2FactoryAbi` to `accountFactoryAbi` in `accountFactoryAbi.ts`.
- Renamed `smaV2Abi` to `semiModularAccountBytecodeAbi` in `semiModularAccountBytecodeAbi.ts`.
- Renamed `singleSignerValidationAbi` to `singleSignerValidationModuleAbi` in `singleSignerValidationModule.ts`.
- Updated import statements to reflect the new names.
- Added a new `addresses` export containing various module addresses in `utils.ts`.
- Introduced new ABI definitions for `paymasterGuardModule`, `timeRangeModule`, `webauthnValidationModule`, `nativeTokenLimitModule`, and `allowlistModule`.
- Added ABI definitions for events and error types in the newly created ABI files.

> The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountStorageAbi.ts`

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

<!-- end pr-codex -->
uses a placeholder signer for now

<!-- start pr-codex -->

---

## PR-Codex overview
This PR introduces a new smart contract account type called `SMAV2Account`, along with its creation function `createSMAV2Account`. It includes types, parameters, and logic for initializing accounts using a bundler client, handling initial owners, and generating account addresses.

### Detailed summary
- Added type `SMAV2Account` for smart contract accounts.
- Introduced type `CreateSMAV2AccountParams` for account creation parameters.
- Implemented `createSMAV2Account` function to create a new account.
- Added logic to handle account initialization and owner address retrieval.
- Utilized `createBundlerClient` for client creation.
- Integrated `standardExecutor` and `multiOwnerMessageSigner` for account functionality.

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

<!-- end pr-codex -->
@howydev howydev force-pushed the howy/add-get-nonce branch 4 times, most recently from 69be16f to de6e837 Compare December 14, 2024 00:34
@howydev howydev changed the base branch from graphite-base/1209 to main December 14, 2024 00:35
- [ ] Did you add new tests and confirm existing tests pass? (`yarn test`)
- [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md))
- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard?
- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 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:write`)
- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)?

<!-- start pr-codex -->

---

This PR introduces a new module for single signer validation in the `account-kit` smart contracts. It adds functionality for packing signatures and validating user operations, along with defining the ABI for the single signer validation module and related contracts.

- Added `PackSignatureParams` type and `packSignature` utility in `utils.ts`.
- Created `SingleSignerValidationModule` with metadata and encoding functions in `single-signer-validation/module.ts`.
- Implemented `singleSignerMessageSigner` function in `single-signer-validation/signer.ts` for signing operations.
- Defined the ABI for `singleSignerValidation` in `abis/singleSignerValidation.ts`.
- Added ABI for `MAV2Factory` and `smaV2` in their respective files.

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

<!-- end pr-codex -->

feat: add all mav2 contract addrs, abis (#1207)

- [x] Did you add new tests and confirm existing tests pass? (`yarn test`)
- [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md))
- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard?
- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 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:write`)
- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)?

<!-- start pr-codex -->

---

This PR focuses on renaming and restructuring various ABI exports and imports in the `account-kit/smart-contracts` project, enhancing clarity and organization in the codebase.

- Renamed `MAV2FactoryAbi` to `accountFactoryAbi` in `accountFactoryAbi.ts`.
- Renamed `smaV2Abi` to `semiModularAccountBytecodeAbi` in `semiModularAccountBytecodeAbi.ts`.
- Renamed `singleSignerValidationAbi` to `singleSignerValidationModuleAbi` in `singleSignerValidationModule.ts`.
- Updated import statement in `module.ts` for `singleSignerValidationModuleAbi`.
- Added new `addresses` export with various module addresses in `utils.ts`.
- Introduced `paymasterGuardModuleAbi` in `paymasterGuardModule.ts`.
- Added `timeRangeModuleAbi` in `timeRangeModule.ts`.
- Added `webauthnValidationModuleAbi` in `webauthnValidation.ts`.
- Added `nativeTokenLimitModuleAbi` in `nativeTokenLimitModule.ts`.
- Added `allowlistModuleAbi` in `allowlistModule.ts`.
- Introduced `modularAccountAbi` in `modularAccountAbi.ts`.
- Introduced `semiModularAccountStorageAbi` in `semiModularAccountStorageAbi.ts`.

> The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/semiModularAccountStorageAbi.ts`

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

<!-- end pr-codex -->

feat: add scaffold for ma v2

chore: lint

feat: add scaffold for ma v2

feat: add all mav2 contract addrs, abis (#1207)

- [x] Did you add new tests and confirm existing tests pass? (`yarn test`)
- [ ] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md))
- [ ] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard?
- [ ] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) 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:write`)
- [ ] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)?

<!-- start pr-codex -->

---

This PR introduces several new smart contract ABIs and address constants for a modular account system, enhancing functionality for various modules, including validation and execution.

- Added `addresses` constant with various module addresses in `addresses.ts`.
- Introduced ABIs for `paymasterGuardModule`, `timeRangeModule`, `webauthnValidation`, `nativeTokenLimitModule`, `allowlistModule`, and `maV2`.
- Each ABI includes functions, events, and errors relevant to their respective modules.

> The following files were skipped due to too many changes: `account-kit/smart-contracts/src/ma-v2/abis/smaStorage.ts`

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

<!-- end pr-codex -->

feat: add mav2 account

feat: add entity id nonce logic

feat: x

feat: a

feat: x
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