diff --git a/.changeset/nasty-experts-whisper.md b/.changeset/nasty-experts-whisper.md new file mode 100644 index 00000000000..1d1c404adf5 --- /dev/null +++ b/.changeset/nasty-experts-whisper.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Overestimate zksync gas limit to account for paymaster extra gas diff --git a/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts b/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts index c4c94a38f88..11ca1973cd0 100644 --- a/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts +++ b/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts @@ -128,7 +128,7 @@ export async function populateEip712Transaction( max_priority_fee_per_gas: string; gas_per_pubdata_limit: string; }; - gas = toBigInt(result.gas_limit); + gas = toBigInt(result.gas_limit) * 2n; // overestimating to avoid issues when not accounting for paymaster extra gas ( we should really pass the paymaster input above for better accuracy ) const baseFee = toBigInt(result.max_fee_per_gas); maxFeePerGas = baseFee * 2n; // bumping the base fee per gas to ensure fast inclusion maxPriorityFeePerGas = toBigInt(result.max_priority_fee_per_gas) || 1n; diff --git a/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts b/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts index 9f87b6313c9..99eeb927549 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts @@ -64,6 +64,18 @@ describe.runIf(process.env.TW_SECRET_KEY).todo( expect(tx.transactionHash.length).toBe(66); }); + it("should send dummy a transactions", async () => { + const tx = await sendAndConfirmTransaction({ + transaction: prepareTransaction({ + chain, + client, + to: "0x611e71B12a2B1C0c884574042414Fe360aF0C5A7", + }), + account: smartAccount, + }); + expect(tx.transactionHash.length).toBe(66); + }); + it.skip("should send a transaction on zkcandy", async () => { const zkCandy = defineChain(302); const zkCandySmartWallet = smartWallet({