我在做什么错/失踪?尝试从https://infura.io/连接我的项目 ID时,运行后出现以下错误:
$ npx hardhat run scripts/deploy.js --network mumbai
错误:
ProviderError:项目 ID 无权访问多边形 l2
这是我的文件
require("@nomiclabs/hardhat-waffle");
require("dotenv").config();
const privateKey = process.env.PRIVATE_KEY;
const projectId = process.env.PROJECT_ID;
if (privateKey.error) {
throw privateKey.error;
}
if (projectId.error) {
throw projectId.error;
}
module.exports = {
networks: {
hardhat: {
chainId: 1337,
},
mumbai: {
url: `https://polygon-mumbai.infura.io/v3/${projectId}`,
accounts: [privateKey],
},
mainnet: {
url: `https://arbitrum-mainnet.infura.io/v3/${projectId}`,
accounts: [privateKey],
},
matic: {
url: "https://rpc-mainnet.maticvigil.com",
accounts: [privateKey],
},
},
solidity: "0.8.4",
};