我正在使用zkSync设置一个项目,在hardhat.config.ts文件中,支持的网络是zkSyncTestnet。
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
module.exports = {
zksolc: {
version: "1.3.1",
compilerSource: "binary",
settings: {},
},
defaultNetwork: "zkSyncTestnet",
networks: {
zkSyncTestnet: {
url: "https://zksync2-testnet.zksync.dev",
ethNetwork: "goerli", // Can also be the RPC URL of the network (e.g. `https://goerli.infura.io/v3/<API_KEY>`)
zksync: true,
},
},
solidity: {
version: "0.8.17",
},
};有可能用孟买波利贡来做这个吗?
发布于 2023-02-14 05:29:34
不幸的是,目前还不可能在其他网络中使用zkSync:
Error in plugin @matterlabs/hardhat-zksync-deploy: Only deploying to zkSync network is supported.发布于 2023-02-14 11:59:37
实际上,您可以为zkSync和其他块链配置一个项目。您只需将属性zksync: true或zksync: false包含到项目中的所有网络。
这就是zkSync和Polygon孟买的配置方式:
import { HardhatUserConfig } from "hardhat/config";
import "@matterlabs/hardhat-zksync-deploy";
import "@matterlabs/hardhat-zksync-solc";
const config: HardhatUserConfig = {
zksolc: {
version: "1.3.1",
compilerSource: "binary",
settings: {},
},
defaultNetwork: "zkSyncTestnet", //could be any of the networks below
networks: {
hardhat: {
zksync: false,
},
mumbai:{
url: 'https://your-polygon-mumbai-endpoint.com/abcdef12345',
zksync: false,
},
zkSyncTestnet: {
url: "https://zksync2-testnet.zksync.dev",
ethNetwork: "goerli", // or a Goerli RPC endpoint
zksync: true,
},
},
solidity: {
version: "0.8.17",
},https://ethereum.stackexchange.com/questions/144874
复制相似问题