Open JawadLegend opened 8 months ago
@alymurtazamemon please help
Hey, I also ran into this problem a few days ago, and I found out that the events[0]
array is not called "events" in the transactionReceipt
object anymore. If you do subscriptionId = transactionReceipt.logs[0].args.subId
instead it might work. I did run into a problem with the mock address right after solving this problem, so if you get an error that looks like this
An unexpected error occurred:
Error: ERROR processing /home/erinofarrell/hh-fcc/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/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Logger.throwArgumentError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:285:21)
at AddressCoder.Coder._throwError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:68:16)
at AddressCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/address.ts:22:18)
at /home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:71:19
at Array.forEach ()
at pack (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:54:12)
at TupleCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:54:20)
at AbiCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:111:15)
at DeploymentsManager.executeDeployScripts (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1214:19)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:528:9)
at processTimers (node:internal/timers:502:7)
at DeploymentsManager.runDeploy (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1060:5)
at SimpleTaskDefinition.action (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:447:5)
at Environment._runTaskDefinition (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14)
at Environment.run (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14)
at SimpleTaskDefinition.action (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:598:32)
then try vrfCoordinatorV2Address = vrfCoordinatorV2Mock.target
Hey, I also ran into this problem a few days ago, and I found out that the
events[0]
array is not called "events" in thetransactionReceipt
object anymore. If you dosubscriptionId = transactionReceipt.logs[0].args.subId
instead it might work. I did run into a problem with the mock address right after solving this problem, so if you get an error that looks like thisAn unexpected error occurred: Error: ERROR processing /home/erinofarrell/hh-fcc/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/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:269:28) at Logger.throwError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:281:20) at Logger.throwArgumentError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/logger/src.ts/index.ts:285:21) at AddressCoder.Coder._throwError (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/abstract-coder.ts:68:16) at AddressCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/address.ts:22:18) at /home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:71:19 at Array.forEach () at pack (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/array.ts:54:12) at TupleCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/coders/tuple.ts:54:20) at AbiCoder.encode (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/@ethersproject/abi/src.ts/abi-coder.ts:111:15) at DeploymentsManager.executeDeployScripts (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1214:19) at processTicksAndRejections (node:internal/process/task_queues:96:5) at runNextTicks (node:internal/process/task_queues:65:3) at listOnTimeout (node:internal/timers:528:9) at processTimers (node:internal/timers:502:7) at DeploymentsManager.runDeploy (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1060:5) at SimpleTaskDefinition.action (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:447:5) at Environment._runTaskDefinition (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:358:14) at Environment.run (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat/src/internal/core/runtime-environment.ts:191:14) at SimpleTaskDefinition.action (/home/erinofarrell/hh-fcc/hardhat-smartcontract-lottery-fcc/node_modules/hardhat-deploy/src/index.ts:598:32)
then try
vrfCoordinatorV2Address = vrfCoordinatorV2Mock.target
Thanks I was having this same error and this solved it. If you don't mind please do a pull to the main code base to correct it.
You can also use
vrfCoordinatorV2Address = await vrfCoordinatorV2Mock.getAddress()
with Hardhat version 2.22.2
i got this error error when i run
yarn hardhat test
i deleted theartifacts
andcache
folders but the error still persist.