zksync-sdk / zksync-ethers

zksync-ethers is an ethers.js library adapted to work with the ZKsync Era.
Apache License 2.0
24 stars 29 forks source link

zksync ethers6 BrowserProvider cannot execute the paymaster properly #100

Closed chongqiangchen closed 5 months ago

chongqiangchen commented 7 months ago

πŸ› Bug Report for zksync-ethers JavaScript SDK

πŸ“ Description

Provide a clear and concise description of the bug. I used technology nextjs + web3modal + ethers6 + zksync-ethers6 to build, But I'm trying to will have a contract here, https://docs.zksync.io/build/tutorials/smart-contract-development/paymasters/custom-paymaster-tutorial.htm l When applying to the page, I found that I could not call normally, I made several attempts:

  1. ethers5 + zksync-ethers5 works properly
  2. Directly use the private key to build the wallet call, it can work normally
  3. ethers6 + zksync-ethers6 + window.ethereum, does not work properly

πŸ”„ Reproduction Steps

  1. demo: https://github.com/chongqiangchen/zksync-nft-demo/blob/1bf9455add33f8e7e4b80aea99a8f13461d59741/hooks/use-token.ts#L19
  2. checkout v6 branch
  3. pnpm install && pnpm dev
  4. mint token and mint token again

πŸ€” Expected Behavior

Describe what you expected to happen.

😯 Current Behavior

Describe what actually happened.

πŸ–₯️ Environment

πŸ“‹ Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

πŸ“Ž Log Output

Paste any relevant log output here.
danijelTxFusion commented 6 months ago

@chongqiangchen Have you managed to solve this problem? I was trying to reproduce the error, and it seems the issue is due to an invalid address being set as the transaction's from field: invalid sender. can't start a transaction from a non-account. Please ensure that gas estimation only accepts an externally owned account (EOA) for the from field. That error produced the following error:

missing revert data (action="estimateGas", data=null, reason=null, transaction={ "data": "0x40c10f1900000000000000000000000016939aa8e0a7e27d0c5314701d76c3bd68c3a94600000000000000000000000000000000000000000000003635c9adc5dea00000", "to": "0x8Bb089cF2aaE59f7404391b8CE5Db6417E99066b" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.11.1)

error

chongqiangchen commented 5 months ago

@chongqiangchen Have you managed to solve this problem? I was trying to reproduce the error, and it seems the issue is due to an invalid address being set as the transaction's from field: invalid sender. can't start a transaction from a non-account. Please ensure that gas estimation only accepts an externally owned account (EOA) for the from field. That error produced the following error:

missing revert data (action="estimateGas", data=null, reason=null, transaction={ "data": "0x40c10f1900000000000000000000000016939aa8e0a7e27d0c5314701d76c3bd68c3a94600000000000000000000000000000000000000000000003635c9adc5dea00000", "to": "0x8Bb089cF2aaE59f7404391b8CE5Db6417E99066b" }, invocation=null, revert=null, code=CALL_EXCEPTION, version=6.11.1)

error

Sorry, I just saw it, I'll check it later ~