Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/nasty-experts-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Overestimate zksync gas limit to account for paymaster extra gas
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
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 )

Check warning on line 131 in packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts

View check run for this annotation

Codecov / codecov/patch

packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts#L131

Added line #L131 was not covered by tests
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;
Expand Down
12 changes: 12 additions & 0 deletions packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down