PatrickAlphaC / hardhat-fund-me-fcc

82 stars 184 forks source link

Hardhat-fund-me- rinkeby deployment problem #24

Closed FurkanSezal closed 2 years ago

FurkanSezal commented 2 years ago

Hi everyone, I wrote fundme contract with hardhat with patrick. I cant deploy it on a testnet. Its working with mocks. Then I delete my code copy and paste patrick's (from github) code. Its still doesnt work. ( when I gitclone all code its working on testnets) I copyied and paste the files : 01-deploy-fund-me.js , hardhat.config.js , helper-hardhat-config.js When I wrote yarn hardhat deploy --network rinkeby getting this error:

Deploying FundMe and waiting for confirmations... An unexpected error occurred:

Error: ERROR processing /home/furkansezal/delete2/deploy/01-deploy-fund-me.js: Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.8) at Logger.makeError (/home/furkansezal/delete2/node_modules/@ethersproject/logger/src.ts/index.ts:261:28) at Logger.throwError (/home/furkansezal/delete2/node_modules/@ethersproject/logger/src.ts/index.ts:273:20) at Web3Provider. (/home/furkansezal/delete2/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:444:23) at step (/home/furkansezal/delete2/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23) at Object.throw (/home/furkansezal/delete2/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53) at rejected (/home/furkansezal/delete2/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65) at processTicksAndRejections (node:internal/process/task_queues:96:5) at DeploymentsManager.executeDeployScripts (/home/furkansezal/delete2/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1222:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at DeploymentsManager.runDeploy (/home/furkansezal/delete2/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1052:5) at SimpleTaskDefinition.action (/home/furkansezal/delete2/node_modules/hardhat-deploy/src/index.ts:438:5) at Environment._runTaskDefinition (/home/furkansezal/delete2/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14) at Environment.run (/home/furkansezal/delete2/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14) at SimpleTaskDefinition.action (/home/furkansezal/delete2/node_modules/hardhat-deploy/src/index.ts:584:32) at Environment._runTaskDefinition (/home/furkansezal/delete2/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14) at Environment.run (/home/furkansezal/delete2/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14) at SimpleTaskDefinition.action (/home/furkansezal/delete2/node_modules/hardhat-deploy/src/index.ts:669:5) error Command failed with exit code 1.

vaasanthk commented 2 years ago

This is a known issue, it's happening to all of us. Try Goerli network, but if it doesn't work, switch to Infura, Alchemy, or Moralis.

ghost commented 2 years ago

How you are detecting different networks in your deploy or helper-hardhat.js code. If you are using using netwrok.name try switching your logic to network.config.chainId. Using network.name gives undefined sometimes. Let me know the results.

FurkanSezal commented 2 years ago

How you are detecting different networks in your deploy or helper-hardhat.js code. If you are using using netwrok.name try switching your logic to network.config.chainId. Using network.name gives undefined sometimes. Let me know the results. I tried both of them. None of works. With this I see "getting rinkeby" on console.

const chainId = network.config.chainId; if (chainId == 31337) { const ethUsdAggregator = await deployments.get("MockV3Aggregator"); ethUsdPriceFeedAddress = ethUsdAggregator.address; } else { log("getting rinkeby.."); ethUsdPriceFeedAddress = networkConfig[chainId]["ethUsdPriceFeed"]; }

ghost commented 2 years ago

Try 1337 for ganahce and 4 for rinkeby.

FurkanSezal commented 2 years ago

Try 1337 for ganahce and 4 for rinkeby.

Yes I used. I use some code with patrick's. I copied and pasted :) looks like vaasanthk is right. I chance rinkeby_rpc_url to infura ones its deployed. Alchemy doesnt work. I spend 2 days for this :) thank you for replies guys.