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 allowlist module #912

Merged
merged 2 commits into from
Aug 13, 2024
Merged

Conversation

adamegyed
Copy link
Collaborator

@adamegyed adamegyed commented Aug 8, 2024

Add the AllowlistModule from the ERC-6900 reference implementation as a built-in module.

Provide a fork test that uses the allowlist module as a pre-validation hook over a SingleSignerValidation key.

Update the exports in @account-kit/smart-contracts to:

  • Export the types of actions: AccountLoupeV08Actions and InstallValidationActions.
  • Export the value of the enum HookType, not just the type.
  • Reorganizes modules to their own section at the bottom.

Pull Request Checklist


PR-Codex overview

The focus of this PR is to add two new modules, SingleSignerValidationModule and AllowlistModule, along with their ABIs and tests.

Detailed summary

  • Added SingleSignerValidationModule with ABI and encode functions
  • Added AllowlistModule with ABI and encode functions
  • Updated exports in index.ts for new modules

The following files were skipped due to too many changes: account-kit/smart-contracts/src/6900-v08-RI/modules/allowlist/module.test.ts

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

Copy link

vercel bot commented Aug 8, 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 Aug 12, 2024 4:12pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 12, 2024 4:12pm

@@ -10,8 +12,10 @@ const meta = {
addresses,
};

// Todo: some unified type for ERC-6900 v0.8 modules. I couldn't figure out how to parameterize the class itself over the abi type parameters for onInstall and onUninstall.
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you explain this? what's your ideal devex?

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 this is just a todo for later, but basically it'd be nice to have a base "class" or other util for creating module definitions that just takes in:

  • An address record
  • Name / meta info
  • The parameter formats for onInstall / onUninstall

And it could produce something that fits the interface I created and have been using so far. I don't think it needs to be as heavyweight as the old plugingen, since most config formats are now off-chain rather than in the manifest, but it would be nice to have an enforced interface / type for the modules.

@adamegyed adamegyed merged commit 772a0aa into contract-v0.8 Aug 13, 2024
6 checks passed
@adamegyed adamegyed deleted the adam/add-allowlist-module branch August 13, 2024 17:20
fangting-alchemy pushed a commit that referenced this pull request Aug 13, 2024
* feat: add allowlist module and tests

* test: increase timeout
adamegyed added a commit that referenced this pull request Aug 14, 2024
* feat: add allowlist module and tests

* test: increase timeout
jaypaik pushed a commit that referenced this pull request Oct 30, 2024
* feat: add allowlist module and tests

* test: increase timeout
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.

2 participants