From 3717d2316b0eb1f482d78eb9666ef7812b184899 Mon Sep 17 00:00:00 2001 From: 0xFirekeeper <0xFirekeeper@gmail.com> Date: Tue, 18 Jun 2024 04:16:25 +0300 Subject: [PATCH 1/2] Default AA Factory --- Thirdweb/Thirdweb.Utils/Constants.cs | 1 + Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Thirdweb/Thirdweb.Utils/Constants.cs b/Thirdweb/Thirdweb.Utils/Constants.cs index 822c997..a20182b 100644 --- a/Thirdweb/Thirdweb.Utils/Constants.cs +++ b/Thirdweb/Thirdweb.Utils/Constants.cs @@ -9,6 +9,7 @@ public static class Constants internal const string VERSION = "0.4.0"; internal const int DEFAULT_FETCH_TIMEOUT = 60000; internal const string DEFAULT_ENTRYPOINT_ADDRESS = "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789"; // v0.6 + internal const string DEFAULT_FACTORY_ADDRESS = "0x85e23b94e7F5E9cC1fF78BCe78cfb15B81f0DF00"; // v0.6 internal const string DUMMY_SIG = "0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"; internal const string DUMMY_PAYMASTER_AND_DATA_HEX = "0x0101010101010101010101010101010101010101000000000000000000000000000000000000000000000000000001010101010100000000000000000000000000000000000000000000000000000000000000000101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101"; diff --git a/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs b/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs index 299a4c0..8a5be71 100644 --- a/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs +++ b/Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs @@ -68,6 +68,7 @@ public static async Task Create( bundlerUrl ??= $"https://{chainId}.bundler.thirdweb.com"; paymasterUrl ??= $"https://{chainId}.bundler.thirdweb.com"; entryPoint ??= Constants.DEFAULT_ENTRYPOINT_ADDRESS; + factoryAddress ??= Constants.DEFAULT_FACTORY_ADDRESS; ThirdwebContract entryPointContract = null; ThirdwebContract factoryContract = null; From 72e141f697421b8404a58bf860f8d6f05a872fe5 Mon Sep 17 00:00:00 2001 From: 0xFirekeeper <0xFirekeeper@gmail.com> Date: Tue, 18 Jun 2024 04:17:26 +0300 Subject: [PATCH 2/2] Update Thirdweb.SmartWallet.Tests.cs --- Thirdweb.Tests/Thirdweb.SmartWallet.Tests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Thirdweb.Tests/Thirdweb.SmartWallet.Tests.cs b/Thirdweb.Tests/Thirdweb.SmartWallet.Tests.cs index bf0d73c..c62feb6 100644 --- a/Thirdweb.Tests/Thirdweb.SmartWallet.Tests.cs +++ b/Thirdweb.Tests/Thirdweb.SmartWallet.Tests.cs @@ -24,6 +24,15 @@ public async Task Initialization_Success() Assert.NotNull(await account.GetAddress()); } + [Fact] + public async Task Initialization_WithoutFactory_Success() + { + var client = ThirdwebClient.Create(secretKey: _secretKey); + var privateKeyAccount = await PrivateKeyWallet.Generate(client); + var smartAccount = await SmartWallet.Create(client, personalWallet: privateKeyAccount, chainId: 421614); + Assert.NotNull(await smartAccount.GetAddress()); + } + [Fact] public async Task Initialization_Fail() {