I use hardhat and I’m trying to deploy to the test network (“goerli”), but I’m not succeeding, what’s wrong with my code?
hardhat.config.ts
networks: {
hardhat: {
initialBaseFeePerGas: 0,
blockGasLimit: 18800000,
},
goerli: {
url: process.env.INFURA_GOERLI_URL || "",
accounts: process.env.INFURA_WALLET_DEV_PRIVATE_KEY ? [`0x${process.env.INFURA_WALLET_DEV_PRIVATE_KEY}`] : [],
httpHeaders: {
Username: "f",
Password: "5",
},
},
},
script/deploy.ts
new ethers.providers.InfuraProvider("goerli", {
projectId: "f",
projectSecret: "5",
});
const INFURA_PROVIDER = ethers.providers.InfuraProvider.getWebSocketProvider();
const INFURA_WALLET_OWNER = new ethers.Wallet("0x", INFURA_PROVIDER);
const INFURA_WALLET_ADDRESS = await INFURA_WALLET_OWNER.getAddress();
const INFURA_WALLET_BALANCE = await INFURA_WALLET_OWNER.getBalance();
const ELETRONIC_VOTING_MACHINE_CONTRACT_FACTORY = await ethers.getContractFactory("ElectronicVotingMachine");
const ELETRONIC_VOTING_MACHINE_CONTRACT = await ELETRONIC_VOTING_MACHINE_CONTRACT_FACTORY.deploy();
await ELETRONIC_VOTING_MACHINE_CONTRACT.deployed();