Skip to content

Commit 52e3a71

Browse files
committed
TokenPaymaster v3
Lisk LSK Paymaster
1 parent 7404406 commit 52e3a71

File tree

2 files changed

+23
-24
lines changed

2 files changed

+23
-24
lines changed

Thirdweb.Console/Program.cs

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -299,28 +299,27 @@
299299

300300
#endregion
301301

302-
#region ERC20 Smart Wallet - Base USDC
302+
#region TokenPaymaster - Lisk LSK
303303

304-
// var erc20SmartWallet = await SmartWallet.Create(
305-
// personalWallet: privateKeyWallet,
306-
// chainId: 8453, // base mainnet
307-
// gasless: true,
308-
// factoryAddress: "0xEc87d96E3F324Dcc828750b52994C6DC69C8162b",
309-
// entryPoint: Constants.ENTRYPOINT_ADDRESS_V07,
310-
// tokenPaymaster: TokenPaymaster.BASE_USDC
311-
// );
312-
// var erc20SmartWalletAddress = await erc20SmartWallet.GetAddress();
313-
// Console.WriteLine($"ERC20 Smart Wallet address: {erc20SmartWalletAddress}");
304+
var erc20SmartWallet = await SmartWallet.Create(
305+
personalWallet: privateKeyWallet,
306+
chainId: 1135, // lisk
307+
gasless: true,
308+
entryPoint: Constants.ENTRYPOINT_ADDRESS_V07,
309+
tokenPaymaster: TokenPaymaster.LISK_LSK
310+
);
311+
var erc20SmartWalletAddress = await erc20SmartWallet.GetAddress();
312+
Console.WriteLine($"ERC20 Smart Wallet address: {erc20SmartWalletAddress}");
314313

315-
// var selfTransfer = await ThirdwebTransaction.Create(wallet: erc20SmartWallet, txInput: new ThirdwebTransactionInput(chainId: 8453, to: erc20SmartWalletAddress, value: 0, data: "0x"));
314+
var selfTransfer = await ThirdwebTransaction.Create(wallet: erc20SmartWallet, txInput: new ThirdwebTransactionInput(chainId: 1135, to: erc20SmartWalletAddress, value: 0, data: "0x"));
316315

317-
// var estimateGas = await ThirdwebTransaction.EstimateGasCosts(selfTransfer);
318-
// Console.WriteLine($"Self transfer gas estimate: {estimateGas.Ether}");
319-
// Console.WriteLine("Make sure you have enough USDC!");
320-
// Console.ReadLine();
316+
var estimateGas = await ThirdwebTransaction.EstimateGasCosts(selfTransfer);
317+
Console.WriteLine($"Self transfer gas estimate: {estimateGas.Ether}");
318+
Console.WriteLine("Make sure you have enough ERC20s!");
319+
Console.ReadLine();
321320

322-
// var receipt = await ThirdwebTransaction.SendAndWaitForTransactionReceipt(selfTransfer);
323-
// Console.WriteLine($"Self transfer receipt: {JsonConvert.SerializeObject(receipt, Formatting.Indented)}");
321+
var receipt = await ThirdwebTransaction.SendAndWaitForTransactionReceipt(selfTransfer);
322+
Console.WriteLine($"Receipt: {JsonConvert.SerializeObject(receipt, Formatting.Indented)}");
324323

325324
#endregion
326325

@@ -349,7 +348,7 @@
349348

350349
#region InAppWallet - OAuth
351350

352-
// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.Twitch);
351+
// var inAppWalletOAuth = await InAppWallet.Create(client: client, authProvider: AuthProvider.Google);
353352
// if (!await inAppWalletOAuth.IsConnected())
354353
// {
355354
// _ = await inAppWalletOAuth.LoginWithOauth(

Thirdweb/Thirdweb.Wallets/SmartWallet/SmartWallet.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace Thirdweb;
1414
public enum TokenPaymaster
1515
{
1616
NONE,
17-
BASE_USDC,
17+
LISK_LSK
1818
}
1919

2020
public class SmartWallet : IThirdwebWallet
@@ -62,12 +62,12 @@ private struct TokenPaymasterConfig
6262
}
6363
},
6464
{
65-
TokenPaymaster.BASE_USDC,
65+
TokenPaymaster.LISK_LSK,
6666
new TokenPaymasterConfig()
6767
{
68-
ChainId = 8453,
69-
PaymasterAddress = "0xff4d12b1f8d276aa4a9e8cc80539e806791bfe28",
70-
TokenAddress = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
68+
ChainId = 1135,
69+
PaymasterAddress = "0xD1D1408b198C151bbe66F34D84b404a6e94f816f",
70+
TokenAddress = "0xac485391EB2d7D88253a7F1eF18C37f4242D1A24",
7171
BalanceStorageSlot = 9
7272
}
7373
}

0 commit comments

Comments
 (0)