From c6c7f64d063512ac318e57de38da4725d8adb340 Mon Sep 17 00:00:00 2001 From: 0xFirekeeper <0xFirekeeper@gmail.com> Date: Thu, 23 May 2024 22:03:15 +0300 Subject: [PATCH] Readme, log --- README.md | 28 +++++++++++++++++++ .../ThirdwebTransaction.cs | 1 - 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cbecace..d7b8696 100644 --- a/README.md +++ b/README.md @@ -183,4 +183,32 @@ Console.WriteLine($"Balance after mint: {balanceAfter}"); // var rpc = ThirdwebRPC.GetRpcInstance(client, 421614); // var blockNumber = await rpc.SendRequestAsync("eth_blockNumber"); // Console.WriteLine($"Block number: {blockNumber}"); + +// Use ZkSync Native AA in 3 steps + +// // 1. Prepare a transaction directly, or with Contract.Prepare +// var tx = await ThirdwebTransaction.Create( +// client: client, +// wallet: privateKeyWallet, +// txInput: new ThirdwebTransactionInput() +// { +// From = await privateKeyWallet.GetAddress(), +// To = await privateKeyWallet.GetAddress(), +// Value = new HexBigInteger(BigInteger.Zero), +// }, +// chainId: 300 +// ); +// // 2. Set zkSync options +// tx.SetZkSyncOptions( +// new ZkSyncOptions( +// // Paymaster contract address +// paymaster: "0xMyGaslessPaymaster", +// // IPaymasterFlow interface encoded data +// paymasterInput: "0x8c5a344500000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000" +// ) +// ); +// // 3. Send as usual, it's now gasless! +// var txHash = await ThirdwebTransaction.Send(transaction: tx); +// Console.WriteLine($"Transaction hash: {txHash}"); + ``` diff --git a/Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs b/Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs index 023ff3a..f90f8ca 100644 --- a/Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs +++ b/Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs @@ -270,7 +270,6 @@ public static async Task Send(ThirdwebTransaction transaction) FactoryDeps = transaction.Input.ZkSync.Value.FactoryDeps, PaymasterInput = transaction.Input.ZkSync.Value.PaymasterInput }; - Console.WriteLine("zkTx: " + JsonConvert.SerializeObject(zkTx)); var zkTxSigned = await EIP712.GenerateSignature_ZkSyncTransaction("zkSync", "2", transaction.Input.ChainId.Value, zkTx, transaction._wallet); hash = await rpc.SendRequestAsync("eth_sendRawTransaction", zkTxSigned); }