Skip to content

Commit 5b590dd

Browse files
authored
[Cross-Platform] ZkCandy Sepolia AA Support (#201)
1 parent 5026d3d commit 5b590dd

File tree

4 files changed

+92
-87
lines changed

4 files changed

+92
-87
lines changed

Assets/Thirdweb/Core/Scripts/AccountAbstraction/Core/SmartWallet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class SmartWallet
5151
public bool IsDeploying => _deploying;
5252

5353
private readonly ThirdwebSDK _sdk;
54-
private bool IsZkSync => _sdk.Session.ChainId == 300 || _sdk.Session.ChainId == 324;
54+
private bool IsZkSync => Utils.IsZkSyncChain(_sdk.Session.ChainId);
5555

5656
public SmartWallet(IThirdwebWallet personalWallet, ThirdwebSDK sdk)
5757
{

Assets/Thirdweb/Core/Scripts/Utils.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -780,5 +780,10 @@ public static Nethereum.Contracts.Function GetFunctionMatchSignature(Nethereum.C
780780
}
781781
throw new UnityException($"Can't find function {functionName} in contract {contract.Address}, that takes: {paramsCount} arguments");
782782
}
783+
784+
public static bool IsZkSyncChain(BigInteger chainId)
785+
{
786+
return chainId == 324 || chainId == 300 || chainId == 302;
787+
}
783788
}
784789
}

Assets/Thirdweb/Core/Scripts/Wallet.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ public async Task<string> SignTypedDataV4<T, TDomain>(T data, TypedData<TDomain>
493493
if (_sdk.Session.ActiveWallet.GetProvider() == WalletProvider.SmartWallet)
494494
{
495495
// Zk AA
496-
if (_sdk.Session.ChainId == 300 || _sdk.Session.ChainId == 324)
496+
if (Utils.IsZkSyncChain(_sdk.Session.ChainId))
497497
{
498498
var hashToken = jsonObject.SelectToken("$.message.data");
499499
if (hashToken != null)

Assets/WebGLTemplates/Thirdweb/lib/thirdweb-unity-bridge.js

Lines changed: 85 additions & 85 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)