Skip to content

Commit

Permalink
feat: added oidc zk verifier
Browse files Browse the repository at this point in the history
added auto generated code for verifier
added oidc validator and its deps to deploy scripts
touches to follow project style and make lint pass
  • Loading branch information
calvogenerico committed Feb 14, 2025
1 parent ca9fa35 commit c7dab6d
Show file tree
Hide file tree
Showing 4 changed files with 1,654 additions and 3 deletions.
1 change: 1 addition & 0 deletions cspell-config/cspell-sol.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ solady
xbatch
tload
tstore
Groth
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"**/test-results/**",
"**/playwright-report/**",
"**/blob-report/**",
"**/playwright/.cache/**"
"**/playwright/.cache/**",
"src/autogenerated/**"
],
"caseSensitive": true,
"dictionaries": [
Expand Down
9 changes: 7 additions & 2 deletions scripts/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { Wallet } from "zksync-ethers";
const WEBAUTH_NAME = "WebAuthValidator";
const SESSIONS_NAME = "SessionKeyValidator";
const GUARDIAN_RECOVERY_NAME = "GuardianRecoveryValidator";
const OIDC_RECOVERY_NAME = "OidcValidator";
const OIDC_VERIFIER_NAME = "Groth16Verifier";
const ACCOUNT_IMPL_NAME = "SsoAccount";
const FACTORY_NAME = "AAFactory";
const PAYMASTER_NAME = "ExampleAuthServerPaymaster";
Expand Down Expand Up @@ -84,9 +86,11 @@ task("deploy", "Deploys ZKsync SSO contracts")
const factory = await deploy(FACTORY_NAME, deployer, !cmd.noProxy, [beacon]);
const guardianInterface = new ethers.Interface((await hre.artifacts.readArtifact(GUARDIAN_RECOVERY_NAME)).abi);
const recovery = await deploy(GUARDIAN_RECOVERY_NAME, deployer, !cmd.noProxy, [webauth, factory], guardianInterface.encodeFunctionData("initialize", [webauth, factory]));
const paymaster = await deploy(PAYMASTER_NAME, deployer, false, [factory, sessions, recovery]);
const oidcKeyRegistryInterface = new ethers.Interface((await hre.artifacts.readArtifact(OIDC_KEY_REGISTRY_NAME)).abi);
await deploy(OIDC_KEY_REGISTRY_NAME, deployer, !cmd.noProxy, [], oidcKeyRegistryInterface.encodeFunctionData("initialize", []));
const oidcKeyRegistry = await deploy(OIDC_KEY_REGISTRY_NAME, deployer, !cmd.noProxy, [], oidcKeyRegistryInterface.encodeFunctionData("initialize", []));
const oidcVerifier = await deploy(OIDC_VERIFIER_NAME, deployer, false, []);
await deploy(OIDC_RECOVERY_NAME, deployer, !cmd.noProxy, [oidcKeyRegistry, oidcVerifier]);
const paymaster = await deploy(PAYMASTER_NAME, deployer, false, [factory, sessions, recovery]);

await fundPaymaster(paymaster, cmd.fund);
} else {
Expand All @@ -113,6 +117,7 @@ task("deploy", "Deploys ZKsync SSO contracts")
if (cmd.only == OIDC_KEY_REGISTRY_NAME) {
args = [];
}

const deployedContract = await deploy(cmd.only, deployer, false, args);

if (cmd.only == PAYMASTER_NAME) {
Expand Down
Loading

0 comments on commit c7dab6d

Please sign in to comment.