Skip to content

Commit fdc98f7

Browse files
authored
Default Account Factory (#184)
1 parent 4b24a66 commit fdc98f7

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

Assets/Thirdweb/Core/Prefabs/ThirdwebManager.prefab

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ MonoBehaviour:
104104
walletConnectMobileWallets: []
105105
walletConnectThemeMode:
106106
factoryAddress:
107-
gasless: 0
107+
gasless: 1
108108
erc20PaymasterAddress:
109109
erc20TokenAddress:
110110
bundlerUrl:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ namespace Thirdweb.AccountAbstraction
22
{
33
public static class Constants
44
{
5+
public const string DEFAULT_FACTORY_ADDRESS = "0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00";
56
public const string DEFAULT_ENTRYPOINT_ADDRESS = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"; // v0.6
67
public const string DUMMY_SIG = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c";
78
public const string DUMMY_PAYMASTER_AND_DATA_HEX =

Assets/Thirdweb/Core/Scripts/ThirdwebManager.cs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -286,18 +286,16 @@ public void Initialize(string chainIdentifier)
286286
customScheme = string.IsNullOrEmpty(thirdwebConfig.customScheme) ? null : thirdwebConfig.customScheme,
287287
};
288288

289-
options.smartWalletConfig = string.IsNullOrEmpty(factoryAddress)
290-
? null
291-
: new ThirdwebSDK.SmartWalletConfig()
292-
{
293-
factoryAddress = factoryAddress,
294-
gasless = gasless,
295-
erc20PaymasterAddress = string.IsNullOrEmpty(erc20PaymasterAddress) ? null : erc20PaymasterAddress,
296-
erc20TokenAddress = string.IsNullOrEmpty(erc20TokenAddress) ? null : erc20TokenAddress,
297-
bundlerUrl = string.IsNullOrEmpty(bundlerUrl) ? $"https://{activeChainId}.bundler.thirdweb.com" : bundlerUrl,
298-
paymasterUrl = string.IsNullOrEmpty(paymasterUrl) ? $"https://{activeChainId}.bundler.thirdweb.com" : paymasterUrl,
299-
entryPointAddress = string.IsNullOrEmpty(entryPointAddress) ? Thirdweb.AccountAbstraction.Constants.DEFAULT_ENTRYPOINT_ADDRESS : entryPointAddress,
300-
};
289+
options.smartWalletConfig = new ThirdwebSDK.SmartWalletConfig()
290+
{
291+
factoryAddress = string.IsNullOrEmpty(factoryAddress) ? Thirdweb.AccountAbstraction.Constants.DEFAULT_FACTORY_ADDRESS : factoryAddress,
292+
gasless = gasless,
293+
erc20PaymasterAddress = string.IsNullOrEmpty(erc20PaymasterAddress) ? null : erc20PaymasterAddress,
294+
erc20TokenAddress = string.IsNullOrEmpty(erc20TokenAddress) ? null : erc20TokenAddress,
295+
bundlerUrl = string.IsNullOrEmpty(bundlerUrl) ? $"https://{activeChainId}.bundler.thirdweb.com" : bundlerUrl,
296+
paymasterUrl = string.IsNullOrEmpty(paymasterUrl) ? $"https://{activeChainId}.bundler.thirdweb.com" : paymasterUrl,
297+
entryPointAddress = string.IsNullOrEmpty(entryPointAddress) ? Thirdweb.AccountAbstraction.Constants.DEFAULT_ENTRYPOINT_ADDRESS : entryPointAddress,
298+
};
301299

302300
// Pass active chain rpc and chainId
303301

Assets/Thirdweb/Editor/ThirdwebManagerEditor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ public override void OnInspectorGUI()
317317
() =>
318318
{
319319
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
320-
EditorGUILayout.PropertyField(factoryAddressProperty);
321320
EditorGUILayout.PropertyField(gaslessProperty);
322321

323322
EditorGUI.BeginChangeCheck();
@@ -329,6 +328,7 @@ public override void OnInspectorGUI()
329328

330329
if (showSmartWalletOptionalFields)
331330
{
331+
EditorGUILayout.PropertyField(factoryAddressProperty);
332332
EditorGUILayout.PropertyField(erc20PaymasterAddressProperty);
333333
EditorGUILayout.PropertyField(erc20TokenAddressProperty);
334334
EditorGUILayout.PropertyField(bundlerUrlProperty);

0 commit comments

Comments
 (0)