Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
FailedOpWithRevert AA23
Browse files Browse the repository at this point in the history
  • Loading branch information
porco-rosso-j committed Jul 3, 2024
1 parent c94c531 commit a07c223
Show file tree
Hide file tree
Showing 6 changed files with 1,957 additions and 5,833 deletions.
3 changes: 1 addition & 2 deletions packages/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@
"@account-abstraction/utils": "^0.6.0",
"@anon-aadhaar/contracts": "2.2.0",
"@anon-aadhaar/core": "2.2.0",
"@zk-email/helpers": "^6.1.1",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.0",
"@nomicfoundation/hardhat-ethers": "^3.0.0",
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^1.0.0",
"@nomiclabs/hardhat-ethers": "npm:hardhat-deploy-ethers",
"@thehubbleproject/bls": "^0.5.1",
"@typechain/ethers-v6": "^0.4.0",
"@typechain/hardhat": "^8.0.0",
Expand All @@ -35,6 +33,7 @@
"@types/node": ">=16.0.0",
"@typescript-eslint/eslint-plugin": ">=6.0.0",
"@typescript-eslint/parser": ">=6.0.0",
"@zk-email/helpers": "^6.1.1",
"chai": "^4.2.0",
"circomlibjs": "0.1.7",
"dotenv": "^16.3.1",
Expand Down
1 change: 0 additions & 1 deletion packages/plugins/src/safe/SafeAnonAadhaarPlugin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ pragma abicoder v2;

import {Safe4337Base, SIG_VALIDATION_FAILED} from "./utils/Safe4337Base.sol";
import {IEntryPoint, PackedUserOperation} from "account-abstraction/interfaces/IEntryPoint.sol";
import {PackedUserOperation} from "account-abstraction/interfaces/IEntryPoint.sol";
import {IAnonAadhaar} from "@anon-aadhaar/contracts/interfaces/IAnonAadhaar.sol";

interface ISafe {
Expand Down
17 changes: 16 additions & 1 deletion packages/plugins/test/e2e/SafeAnonAadhaarPlugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {
artifactUrls,
packGroth16Proof,
ArtifactsOrigin,
verify,
} from "@anon-aadhaar/core";
import fs from "fs";
import { getUserOpHash } from "./utils/userOpUtils";
Expand Down Expand Up @@ -178,6 +177,22 @@ describe("SafeAnonAadhaarPlugin", () => {
const anonAadhaarProof = anonAadhaarCore.proof;
const packedGroth16Proof = packGroth16Proof(anonAadhaarProof.groth16Proof);

// view call to AnonAadhaar contract to see if verification returns true
const ret = await anonAadhaar.verifyAnonAadhaarProof(
nullifierSeed,
anonAadhaarProof.nullifier,
anonAadhaarProof.timestamp,
userOpHash,
[
anonAadhaarProof.ageAbove18,
anonAadhaarProof.gender,
anonAadhaarProof.pincode,
anonAadhaarProof.state,
],
packedGroth16Proof
);
console.log("ret: ", ret);

// encode proof data into userOpSignature
const encoder = ethers.AbiCoder.defaultAbiCoder();
const userOpSignature = encoder.encode(
Expand Down
8 changes: 4 additions & 4 deletions packages/plugins/test/e2e/utils/createUserOp.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable prettier/prettier */
/* eslint-disable @typescript-eslint/comma-dangle */
import { ethers, getBytes, NonceManager, Signer } from "ethers";
import { AddressZero } from "@ethersproject/constants";

Expand Down Expand Up @@ -211,10 +213,8 @@ export const createAnonAadhaarOperation = async (
factoryData: undefined,
callData: userOpCallData,
callGasLimit: ethers.toBeHex(150000n),
// verificationGasLimit: ethers.toBeHex(1000000n),
// preVerificationGas: ethers.toBeHex(200000n),
verificationGasLimit: ethers.toBeHex(1500000n),
preVerificationGas: ethers.toBeHex(500000n),
verificationGasLimit: ethers.toBeHex(1000000n),
preVerificationGas: ethers.toBeHex(200000n),
maxFeePerGas,
maxPriorityFeePerGas,
signature: "0x",
Expand Down
Loading

0 comments on commit a07c223

Please sign in to comment.