You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bilgekaangencdogan@bilgekaangencdogan:~/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc$ yarn hardhat deploy
yarn run v1.22.22
warning package.json: No license field
$ /home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/.bin/hardhat deploy
WARNING: You are currently using Node.js v21.7.3, which is not supported by Hardhat. This can lead to unexpected behavior. See https://hardhat.org/nodejs-versions
Nothing to compile
Local network detected! Deploying mocks...
deploying "VRFCoordinatorV2Mock" (tx: 0x4e74378c5b2b11e352c170557032ab3fee375d54241c07e8580beab5e0cbd769)...: deployed at 0x5FbDB2315678afecb367f032d93F642f64180aa3 with 2984688 gas
Mocks Deployed!!
------------------------------------------------------------------
An unexpected error occurred:
Error: ERROR processing /home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/deploy/01-deploy-raffle.js:
Error: invalid address (argument="address", value=undefined, code=INVALID_ARGUMENT, version=address/5.7.0) (argument="vrfCoordinatorV2", value=undefined, code=INVALID_ARGUMENT, version=abi/5.7.0)
at Logger.makeError (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Logger.throwArgumentError (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:285:21)
at AddressCoder.Coder._throwError (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:68:16)
at AddressCoder.encode (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/address.ts:22:18)
at /home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:71:19
at Array.forEach (<anonymous>)
at pack (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:54:12)
at TupleCoder.encode (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:54:20)
at AbiCoder.encode (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:111:15)
at DeploymentsManager.executeDeployScripts (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1215:19)
at DeploymentsManager.runDeploy (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1061:5)
at SimpleTaskDefinition.action (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:450:5)
at Environment._runTaskDefinition (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:359:14)
at Environment.run (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:192:14)
at SimpleTaskDefinition.action (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:601:32)
at Environment._runTaskDefinition (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:359:14)
at Environment.run (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:192:14)
at SimpleTaskDefinition.action (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:690:5)
at Environment._runTaskDefinition (/home/bilgekaangencdogan/Desktop/FreeCodeCampBlockchain/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:359:14)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
you can find my related files below
01-deploy-raffles:
const{ network, ethers }=require("hardhat")const{ developmentChains, networkConfig }=require("../helper-hardhart-config")const{ verify }=require("../utils/verify")constVRF_SUB_FUND_AMOUNT=ethers.parseEther("1")module.exports=asyncfunction({ getNamedAccounts, deployments }){const{ deploy, log }=deploymentsconst{ deployer }=awaitgetNamedAccounts()constchainId=network.config.chainIdletvrfCoordinatorV2Address,subscriptionId,vrfCoordinatorV2Mockif(developmentChains.includes(network.name)){constvrfCoordinatorV2Mock=awaitethers.getContract("VRFCoordinatorV2Mock")vrfCoordinatorV2Address=vrfCoordinatorV2Mock.addressconsttransactionResponse=awaitvrfCoordinatorV2Mock.createSubscription()consttransactionReceipt=awaittransactionResponse.wait(1)subscriptionId=transactionReceipt.logs[0].args.subId// Fund the subscription// Usually, you'd need the link token on a real networkawaitvrfCoordinatorV2Mock.fundSubscription(subscriptionId,VRF_SUB_FUND_AMOUNT)}else{vrfCoordinatorV2Address=networkConfig[chainId]["vrfCoordinatorV2"]subscriptionId=networkConfig[chainId]["subscriptionId"]}constentranceFee=networkConfig[chainId]["entranceFee"]constgasLane=networkConfig[chainId]["gasLane"]constcallbackGasLimit=networkConfig[chainId]["callbackGasLimit"]constinterval=networkConfig[chainId]["interval"]constargs=[vrfCoordinatorV2Address,entranceFee,gasLane,subscriptionId,callbackGasLimit,interval,]constraffle=awaitdeploy("Raffle",{from: deployer,args: args,log: true,waitConfirmations: network.config.blockConfirmations||1,})// Ensure the Raffle contract is a valid consumer of the VRFCoordinatorV2Mock contract.if(developmentChains.includes(network.name)){constvrfCoordinatorV2Mock=awaitethers.getContract("VRFCoordinatorV2Mock")awaitvrfCoordinatorV2Mock.addConsumer(subscriptionId,raffle.address)}if(!developmentChains.includes(network.name)&&process.env.ETHERSCAN_API_KEY){log("Verifying...")awaitverify(raffle.address,args)}log("---------------------------------------------------------------")}module.exports.tags=["all","raffle"]
I think there is a conflict with vrfCoordinatorV2 and VRFCoordinatorV2Mock, but I could not resolve it.
Thanks in advance!!
P.S: I know some people opened some issues about that error, but solutions in those issues did work for me, that is why I opened this issue, so please don't be mad at me @PatrickAlphaC :D
The text was updated successfully, but these errors were encountered:
Having the exact same problem when attempting to deploy at 15:19:40 in the video. I started this particular lesson a few days ago, so it could be a more recent issue.
Having the exact same problem when attempting to deploy at 15:19:40 in the video. I started this particular lesson a few days ago, so it could be a more recent issue.
Yes, I am in the same lesson. I could not resolve it. Hoping @PatrickAlphaC see my issue and respond it :D
Sorry, I no longer will be supporting these repos.
Moving forward, I'd like to direct everyone over to Cyfrin Updraft where all content will be kept up to date! With tutorials like the foundry ultimate course kept open sourced and 100% free as always.
Hello,
I am having this issue,
you can find my related files below
01-deploy-raffles
:helper-hardhat-config.js
:VRFCoordinatorV2Mock.sol
:I think there is a conflict with
vrfCoordinatorV2
andVRFCoordinatorV2Mock
, but I could not resolve it.Thanks in advance!!
P.S: I know some people opened some issues about that error, but solutions in those issues did work for me, that is why I opened this issue, so please don't be mad at me @PatrickAlphaC :D
The text was updated successfully, but these errors were encountered: