diff --git a/.changeset/real-insects-fix.md b/.changeset/real-insects-fix.md new file mode 100644 index 00000000000..15db021a444 --- /dev/null +++ b/.changeset/real-insects-fix.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Update default zk chains diff --git a/apps/playground-web/src/components/account-abstraction/sponsored-tx-zksync.tsx b/apps/playground-web/src/components/account-abstraction/sponsored-tx-zksync.tsx index 8e213ff0c64..158dfb8ebee 100644 --- a/apps/playground-web/src/components/account-abstraction/sponsored-tx-zksync.tsx +++ b/apps/playground-web/src/components/account-abstraction/sponsored-tx-zksync.tsx @@ -67,7 +67,7 @@ export function SponsoredTxZksyncPreview() { {smartAccount ? (

- You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"} + You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "} Kittens

- You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"} + You own {ownedNfts?.[0]?.quantityOwned.toString() || "0"}{" "} Kittens

({ name, href: `${slug}/${name}`, @@ -155,7 +161,6 @@ export const sidebar: SideBar = { "getAccountsOfSigner", "getAllActiveSigners", "getPermissionsForSigner", - "createUnsignedUserOp", ].map((name) => ({ name, href: `${slug}/erc4337/${name}`, 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 11ca1973cd0..e8719ef4e9a 100644 --- a/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts +++ b/packages/thirdweb/src/transaction/actions/zksync/send-eip712-transaction.ts @@ -133,6 +133,10 @@ export async function populateEip712Transaction( maxFeePerGas = baseFee * 2n; // bumping the base fee per gas to ensure fast inclusion maxPriorityFeePerGas = toBigInt(result.max_priority_fee_per_gas) || 1n; gasPerPubdata = toBigInt(result.gas_per_pubdata_limit) * 2n; // doubling for fast inclusion; + if (gasPerPubdata < 50000n) { + // enforce a minimum gas per pubdata limit + gasPerPubdata = 50000n; + } } // serialize the transaction (with fees, gas, nonce) diff --git a/packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts b/packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts index 7755a73cfe3..2788ab897d9 100644 --- a/packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts +++ b/packages/thirdweb/src/utils/any-evm/zksync/isZkSyncChain.ts @@ -16,7 +16,8 @@ export async function isZkSyncChain(chain: Chain) { chain.id === 388 || chain.id === 4654 || chain.id === 333271 || - chain.id === 37111 + chain.id === 37111 || + chain.id === 978658 ) { return true; } 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 99eeb927549..03f4ac229cb 100644 --- a/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts +++ b/packages/thirdweb/src/wallets/smart/smart-wallet-zksync.test.ts @@ -148,5 +148,28 @@ describe.runIf(process.env.TW_SECRET_KEY).todo( console.log(tx.transactionHash); expect(tx.transactionHash.length).toBe(66); }); + + it("should send a transaction on Treasure Topaz Testnet", async () => { + const sw = smartWallet({ + chain: defineChain(978658), + sponsorGas: true, + }); + const account = await sw.connect({ + client: TEST_CLIENT, + personalAccount, + }); + const tx = await sendTransaction({ + transaction: prepareTransaction({ + chain: defineChain(978658), + client: TEST_CLIENT, + to: account.address, + value: BigInt(0), + data: "0x", + }), + account: account, + }); + console.log(tx.transactionHash); + expect(tx.transactionHash.length).toBe(66); + }); }, );