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

PBH 4337 Module #87

Merged
merged 25 commits into from
Dec 23, 2024
Merged

PBH 4337 Module #87

merged 25 commits into from
Dec 23, 2024

Conversation

karankurbur
Copy link
Contributor

@karankurbur karankurbur commented Dec 18, 2024

  • Use the latest release of safe-modules as older version use v6 of account-abstraction.
  • remove --via-ir in foundry.toml as it causes stack too deep in safe modules
  • support signature verification in both off-chain simulation and on-chain execution

TODO: Fork safe-modules inside worldcoin GH and add virtual modifier to _validateSignatures

original impl of _validateSignatures - https://github.com/safe-global/safe-modules/blob/main/modules/4337/contracts/Safe4337Module.sol#L275-L299

@karankurbur
Copy link
Contributor Author

karankurbur commented Dec 23, 2024

I have to disable --via-ir else i get stack trace too deep. Removing this from foundry causes several other tests to fail locally. Any suggestions?

@karankurbur karankurbur marked this pull request as ready for review December 23, 2024 06:10
// We need to remove the proof from the signature before validation
if (isPBH && userOp.signature.length > expectedLength) {
// 352 bytes is the size of the encoded proof
require(userOp.signature.length - expectedLength == 352, "Invalid proof size in signature");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we use a custom error here?

Copy link
Contributor

@0xOsiris 0xOsiris left a comment

Choose a reason for hiding this comment

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

Nice work, LGTM

0xKitsune and others added 5 commits December 23, 2024 12:16
chore(contracts): Combine `PBHEntryPointImplV1` and `PBHVerifier` logic into a single contract
@karankurbur karankurbur merged commit 253612f into main Dec 23, 2024
4 of 5 checks passed
@karankurbur karankurbur deleted the karan-pbh-4337-module-2 branch December 23, 2024 17:49
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