You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
User zksync-ethers(v6.12.1) signer to send EIP712 transaction, zksync-ethers depends on ethers.js v6. The transaction can be sent and confirmed on chain. There is an error happens in ethers's abstract-provider (https://github.com/ethers-io/ethers.js/blob/5aba4963e3e8ddfc912747076f5b7fe7a743cfe2/src.ts/providers/abstract-provider.ts#L1088), where it use Trnsaction.from(signedTx) and got error as :
Error: unsupported transaction type (operation="from", code=UNSUPPORTED_OPERATION, version=6.13.2). So the transaction type EIP712 is not supported in transaction.js.
Error: unsupported transaction type (operation="from", code=UNSUPPORTED_OPERATION, version=6.13.2)
at makeError (errors.js:137:21)
at assert (errors.js:156:15)
at Transaction.from (transaction.js:933:68)
at BrowserProvider.broadcastTransaction (abstract-provider.js:761:83)
at async Signer.sendTransaction (signer.js:593:20)
at async eval (useSendMultichainTx.ts:489:29)
at async eval (SignButton.tsx:97:26)
Environment
Ethereum (mainnet/ropsten/rinkeby/goerli)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered:
I managed to run succefully the EIP712 transaction using ethers 6.13.2 and zksync-ethers: 6.12.1. Here is the code:
import{Provider,types,utils,BrowserProvider,Signer}from'zksync-ethers';import{ethers}from'ethers';consttoken='0x6a4Fb925583F7D4dF82de62d98107468aE846FD1';constreceiver='0x81E9D85b65E9CC8618D85A1110e4b1DF63fA30d9';constapprovalToken='0x927488F48ffbc32112F1fF721759649A89721F8F';// Crown token which can be minted for freeconstpaymaster='0x13D0D8550769f59aa241a41897D4859c87f7Dd46';// Paymaster for Crown token// Browser wallet should be connected to zkSync Era Sepolia networkconstbrowserProvider=newBrowserProvider((windowasany).ethereum);constprovider=Provider.getDefaultProvider(types.Network.Sepolia);constsigner=Signer.from(awaitbrowserProvider.getSigner(),Number((awaitbrowserProvider.getNetwork()).chainId),provider);console.log(`Account1 balance before transfer: ${awaitsigner.getBalance()}`);console.log(`Account2 balance before transfer: ${awaitprovider.getBalance(receiver)}`);awaitsigner.sendTransaction({from: signer.address,to: receiver,value: ethers.parseEther('0.01'),customData: {paymasterParams: utils.getPaymasterParams(paymaster,{type: 'ApprovalBased',token: approvalToken,minimalAllowance: 1,innerInput: newUint8Array(),}),}})console.log(`Account1 balance after transfer: ${awaitsigner.getBalance()}`);console.log(`Account2 balance after transfer: ${awaitprovider.getBalance(receiver)}`);
Output:
Account1 balance before transfer: 75700023965349567071
Account2 balance before transfer: 192408413800010000
Account1 balance after transfer: 75690023965349567071
Account2 balance after transfer: 202408413800010000
Ethers Version
6.13.2
Search Terms
EIP712_TX_TYPE, eip712
Describe the Problem
User zksync-ethers(v6.12.1) signer to send EIP712 transaction, zksync-ethers depends on ethers.js v6. The transaction can be sent and confirmed on chain. There is an error happens in ethers's abstract-provider (https://github.com/ethers-io/ethers.js/blob/5aba4963e3e8ddfc912747076f5b7fe7a743cfe2/src.ts/providers/abstract-provider.ts#L1088), where it use Trnsaction.from(signedTx) and got error as :
Error: unsupported transaction type (operation="from", code=UNSUPPORTED_OPERATION, version=6.13.2). So the transaction type EIP712 is not supported in transaction.js.
Code Snippet
Contract ABI
No response
Errors
Environment
Ethereum (mainnet/ropsten/rinkeby/goerli)
Environment (Other)
No response
The text was updated successfully, but these errors were encountered: