Skip to content

Commit

Permalink
Readme, log
Browse files Browse the repository at this point in the history
  • Loading branch information
0xFirekeeper committed May 23, 2024
1 parent 1bd6acb commit c6c7f64
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,32 @@ Console.WriteLine($"Balance after mint: {balanceAfter}");
// var rpc = ThirdwebRPC.GetRpcInstance(client, 421614);
// var blockNumber = await rpc.SendRequestAsync<string>("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}");
```
1 change: 0 additions & 1 deletion Thirdweb/Thirdweb.Transactions/ThirdwebTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ public static async Task<string> 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<string>("eth_sendRawTransaction", zkTxSigned);
}
Expand Down

0 comments on commit c6c7f64

Please sign in to comment.