Skip to content

Commit 7f139d7

Browse files
authored
Update to latest contracts (#168)
* fix: rename package to zksync-sso-wagmi-connector Using a scope that doesn't exist requires more setup * fix: don't publish beta as latest Hard to undo since key is only in CI, but for future beta deploys * fix: save tag to github output wasn't getting picked up by the next step, attempt 3 * feat: update to latest contract abi Not updated in awhile, hopefully still passes? * feat: update to latest contracts Has audit fixes
1 parent 6fd5d0f commit 7f139d7

File tree

18 files changed

+392
-460
lines changed

18 files changed

+392
-460
lines changed

.github/workflows/deploy-package.yml

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,25 @@ jobs:
6868

6969
- name: Create .npmrc for NPM
7070
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPMJS_NPM_MATTERLABS_AUTOMATION_TOKEN }}" > ~/.npmrc
71+
72+
- name: Determine npm publish tag
73+
id: npm_tag
74+
run: |
75+
VERSION="${{ github.event.inputs.version }}"
76+
if [[ "$VERSION" =~ -([a-zA-Z0-9]+) ]]; then
77+
TAG="${BASH_REMATCH[1]}"
78+
else
79+
TAG="latest"
80+
fi
81+
echo "tag=$TAG" >> $GITHUB_OUTPUT
7182
7283
- name: Publish SDK to NPM
7384
working-directory: packages/sdk
74-
run: npm publish --access public
85+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
7586

76-
# - name: Publish connector-export to NPM
77-
# working-directory: packages/connector-export
78-
# run: npm publish --access public
87+
- name: Publish connector-export to NPM
88+
working-directory: packages/connector-export
89+
run: npm publish --access public --tag ${{ steps.npm_tag.outputs.tag }}
7990

8091
- name: Create .npmrc for GitHub Packages
8192
run: |
@@ -88,11 +99,11 @@ jobs:
8899
run: |
89100
# Update package name for GitHub Packages to be scoped to the organization
90101
npm pkg set name="@matter-labs/zksync-sso"
91-
npm publish --registry=https://npm.pkg.github.com
102+
npm publish --registry=https://npm.pkg.github.com --tag ${{ steps.npm_tag.outputs.tag }}
92103
93-
# - name: Publish connector-export to GitHub Packages
94-
# working-directory: packages/connector-export
95-
# run: |
96-
# # Update package name for GitHub Packages to be scoped to the organization
97-
# npm pkg set name="@matter-labs/zksync-sso-connector-export"
98-
# npm publish --registry=https://npm.pkg.github.com
104+
- name: Publish connector-export to GitHub Packages
105+
working-directory: packages/connector-export
106+
run: |
107+
# Update package name for GitHub Packages to be scoped to the organization
108+
npm pkg set name="@matter-labs/zksync-sso-connector-export"
109+
npm publish --registry=https://npm.pkg.github.com --tag ${{ steps.npm_tag.outputs.tag }}

examples/demo-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"wagmi": "^2.12.17",
2222
"zksync-ethers": "^6.15.0",
2323
"zksync-sso": "workspace:*",
24-
"@zksync-sso/connector-export": "workspace:*"
24+
"zksync-sso-wagmi-connector": "workspace:*"
2525
},
2626
"devDependencies": {
2727
"@nuxt/eslint": "^0.5.7",

examples/demo-app/pages/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
<script lang="ts" setup>
5858
import { disconnect, getBalance, watchAccount, sendTransaction, createConfig, connect, reconnect, waitForTransactionReceipt, type GetBalanceReturnType } from "@wagmi/core";
59-
import { zksyncSsoConnector, eraTestNode } from "@zksync-sso/connector-export";
59+
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";
6060
import { createWalletClient, http, parseEther, type Address } from "viem";
6161
import { privateKeyToAccount } from "viem/accounts";
6262
import { getGeneralPaymasterInput } from "viem/zksync";

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"typescript-eslint": "8.7.0",
4949
"viem": "^2.30.0",
5050
"zksync-sso": "workspace:*",
51-
"@zksync-sso/connector-export": "workspace:*"
51+
"zksync-sso-wagmi-connector": "workspace:*"
5252
},
5353
"nx": {
5454
"includedScripts": []

packages/auth-server/stores/era-sepolia.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"passkey": "0x006ecc2D79242F1986b7cb5F636d6E3f499f1026",
44
"accountFactory": "0xd122999B15081d90b175C81B8a4a9bE3327C0c2a",
55
"accountPaymaster": "0x4Cb1C15710366b73f3D31EC2b3092d5f3BFD8504",
6-
"recovery": "0x6AA83E35439D71F28273Df396BC7768dbaA9849D"
6+
"recovery": "0x6AA83E35439D71F28273Df396BC7768dbaA9849D",
7+
"recoveryOidc": "0x116A07f88d03bD3982eBD5f2667EB08965aAe98c",
8+
"oidcKeyRegistry": "0x0EEeA31EA37959316dc6b50307BaF09528d3fcc4"
79
}

packages/connector-export/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @zksync-sso/connector-export
1+
# zksync-sso-wagmi-connector
22

33
This package exports the ZKsync SSO connector with embedded Era Test Node
44
support, eliminating the need to manually import and configure the era-test-node
@@ -7,11 +7,11 @@ chain.
77
## Installation
88

99
```bash
10-
npm install @zksync-sso/connector-export
10+
npm install zksync-sso-wagmi-connector
1111
# or
12-
pnpm add @zksync-sso/connector-export
12+
pnpm add zksync-sso-wagmi-connector
1313
# or
14-
yarn add @zksync-sso/connector-export
14+
yarn add zksync-sso-wagmi-connector
1515
```
1616

1717
## Usage
@@ -23,7 +23,7 @@ configuration:
2323

2424
```typescript
2525
import { createConfig, http } from "@wagmi/core";
26-
import { zksyncSsoConnector, eraTestNode } from "@zksync-sso/connector-export";
26+
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";
2727

2828
const wagmiConfig = createConfig({
2929
chains: [eraTestNode], // Era test node is now exported directly
@@ -53,7 +53,7 @@ You can disable the automatic Era Test Node inclusion if you want to configure
5353
chains manually:
5454

5555
```typescript
56-
import { zksyncSsoConnector } from "@zksync-sso/connector-export";
56+
import { zksyncSsoConnector } from "zksync-sso-wagmi-connector";
5757
import { zksyncSepoliaTestnet } from "@wagmi/core/chains";
5858

5959
const connector = zksyncSsoConnector({
@@ -129,7 +129,7 @@ const wagmiConfig = createConfig({
129129
**After:**
130130

131131
```typescript
132-
import { zksyncSsoConnector, eraTestNode } from "@zksync-sso/connector-export";
132+
import { zksyncSsoConnector, eraTestNode } from "zksync-sso-wagmi-connector";
133133

134134
const wagmiConfig = createConfig({
135135
chains: [eraTestNode], // Now exported directly from the connector package

packages/connector-export/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@zksync-sso/connector-export",
2+
"name": "zksync-sso-wagmi-connector",
33
"type": "module",
44
"version": "0.1.0",
55
"description": "Exports only the connector from the zksync-sso SDK.",

packages/connector-export/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export type ZksyncSsoConnectorWithEraOptions = ZksyncSsoConnectorOptions;
2121
* Example usage:
2222
* ```typescript
2323
* import { createConfig } from '@wagmi/core'
24-
* import { zksyncSsoConnector, eraSepolia, eraMainnet } from '@zksync-sso/connector-export'
24+
* import { zksyncSsoConnector, eraSepolia, eraMainnet } from 'zksync-sso-wagmi-connector'
2525
*
2626
* const config = createConfig({
2727
* chains: [eraSepolia, eraMainnet],

packages/sdk/src/abi/GuardianRecoveryValidator.ts

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,6 @@ export const GuardianRecoveryValidatorAbi = [
44
stateMutability: "nonpayable",
55
type: "constructor",
66
},
7-
{
8-
inputs: [
9-
{
10-
internalType: "uint256",
11-
name: "value",
12-
type: "uint256",
13-
},
14-
],
15-
name: "ADDRESS_CAST_OVERFLOW",
16-
type: "error",
17-
},
187
{
198
inputs: [
209
{
@@ -28,7 +17,7 @@ export const GuardianRecoveryValidatorAbi = [
2817
type: "address",
2918
},
3019
],
31-
name: "AccountAlreadyGuardedByGuardian",
20+
name: "ACCOUNT_ALREADY_GUARDED",
3221
type: "error",
3322
},
3423
{
@@ -44,75 +33,70 @@ export const GuardianRecoveryValidatorAbi = [
4433
type: "address",
4534
},
4635
],
47-
name: "AccountNotGuardedByAddress",
48-
type: "error",
49-
},
50-
{
51-
inputs: [],
52-
name: "AccountRecoveryInProgress",
53-
type: "error",
54-
},
55-
{
56-
inputs: [],
57-
name: "GuardianCannotBeSelf",
36+
name: "ACCOUNT_NOT_GUARDED_BY_ADDRESS",
5837
type: "error",
5938
},
6039
{
6140
inputs: [
6241
{
63-
internalType: "address",
64-
name: "guardian",
65-
type: "address",
42+
internalType: "uint256",
43+
name: "value",
44+
type: "uint256",
6645
},
6746
],
68-
name: "GuardianNotFound",
47+
name: "ADDRESS_CAST_OVERFLOW",
6948
type: "error",
7049
},
7150
{
72-
inputs: [
73-
{
74-
internalType: "address",
75-
name: "guardian",
76-
type: "address",
77-
},
78-
],
79-
name: "GuardianNotProposed",
51+
inputs: [],
52+
name: "GUARDIAN_CANNOT_BE_SELF",
8053
type: "error",
8154
},
8255
{
8356
inputs: [],
84-
name: "InvalidAccountToGuardAddress",
57+
name: "GUARDIAN_INVALID_ACCOUNT",
8558
type: "error",
8659
},
8760
{
8861
inputs: [],
89-
name: "InvalidAccountToRecoverAddress",
62+
name: "GUARDIAN_INVALID_ADDRESS",
9063
type: "error",
9164
},
9265
{
9366
inputs: [],
94-
name: "InvalidGuardianAddress",
67+
name: "GUARDIAN_INVALID_RECOVERY_CALL",
9568
type: "error",
9669
},
9770
{
9871
inputs: [],
99-
name: "InvalidWebAuthValidatorAddress",
72+
name: "GUARDIAN_INVALID_WEBAUTH_VALIDATOR",
10073
type: "error",
10174
},
10275
{
10376
inputs: [
10477
{
105-
internalType: "uint256",
106-
name: "chainId",
107-
type: "uint256",
78+
internalType: "address",
79+
name: "guardian",
80+
type: "address",
10881
},
10982
],
110-
name: "NO_TIMESTAMP_ASSERTER",
83+
name: "GUARDIAN_NOT_FOUND",
84+
type: "error",
85+
},
86+
{
87+
inputs: [
88+
{
89+
internalType: "address",
90+
name: "guardian",
91+
type: "address",
92+
},
93+
],
94+
name: "GUARDIAN_NOT_PROPOSED",
11195
type: "error",
11296
},
11397
{
11498
inputs: [],
115-
name: "NonFunctionCallTransaction",
99+
name: "GUARDIAN_RECOVERY_IN_PROGRESS",
116100
type: "error",
117101
},
118102
{
@@ -123,12 +107,23 @@ export const GuardianRecoveryValidatorAbi = [
123107
type: "bytes32",
124108
},
125109
],
126-
name: "UnknownHashedOriginDomain",
110+
name: "GUARDIAN_UNKNOWN_DOMAIN",
111+
type: "error",
112+
},
113+
{
114+
inputs: [
115+
{
116+
internalType: "uint256",
117+
name: "chainId",
118+
type: "uint256",
119+
},
120+
],
121+
name: "NO_TIMESTAMP_ASSERTER",
127122
type: "error",
128123
},
129124
{
130125
inputs: [],
131-
name: "WebAuthValidatorNotEnabled",
126+
name: "WEBAUTH_VALIDATOR_NOT_INSTALLED",
132127
type: "error",
133128
},
134129
{
@@ -597,7 +592,7 @@ export const GuardianRecoveryValidatorAbi = [
597592
],
598593
name: "onInstall",
599594
outputs: [],
600-
stateMutability: "nonpayable",
595+
stateMutability: "view",
601596
type: "function",
602597
},
603598
{

0 commit comments

Comments
 (0)