Deploying contract to zkSync using web3 + Metamask

18 views Asked by At

I am attempting to create a script to deploy a token. I am utilizing web3 with a Metamask connection, and my script functions properly on the Base and Ethereum networks. However, I encounter an issue when trying to deploy to the zkSync Sepolia testnet. Metamask displays an error {code: -32603, message: 'Internal JSON-RPC error.'}.

Here is my code snapshot.

      let tokenContract = new window.web3.eth.Contract(StandardTokenABI);
      await tokenContract
          .deploy({
              data: tokenByte["StandardToken"],
              arguments: [
                  value["name"],
                  value["symbol"],
                  value["decimals"],
                  value["supply"] + "0".repeat(value["decimals"]),
                  contract["default"]["feeReceiver"],
                  createFee.toString(),
              ],
          })
          .send(
              {
                  value: createFee.toString(),
                  from: accounts[0],
                  gas: 15000000,
                  gasPrice:'2000000000'
              },
              function (error, transactionHash) {
                  if (transactionHash != undefined)
                      toast.promise(resolveAfter3Sec, {
                      pending: "Waiting for confirmation ",
                  });
              }
          )

Please assist me! Thank you in advance!

Modifying gas and gasPrice.

0

There are 0 answers