Error: call revert exception; VM Exception while processing transaction: reverted with reason string "not implemented" #2076
-
Here is the error Error: ERROR processing /home/sadath/hh-fcc/hardhat-lottery/deploy/01-deploy-raffle.js:
Error: call revert exception; VM Exception while processing transaction: reverted with reason string "not implemented" [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (method="addConsumer(uint64,address)", data="0x08c379a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000f6e6f7420696d706c656d656e7465640000000000000000000000000000000000", errorArgs=["not implemented"], errorName="Error", errorSignature="Error(string)", reason="not implemented", code=CALL_EXCEPTION, version=abi/5.7.0)
at Logger.makeError (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at Interface.decodeFunctionResult (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/abi/src.ts/interface.ts:427:23)
at Contract.<anonymous> (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/contracts/src.ts/index.ts:400:44)
at step (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/contracts/lib/index.js:48:23)
at Object.next (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/contracts/lib/index.js:29:53)
at fulfilled (/home/sadath/hh-fcc/hardhat-lottery/node_modules/@ethersproject/contracts/lib/index.js:20:58)
at DeploymentsManager.executeDeployScripts (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1223:19)
at DeploymentsManager.runDeploy (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat-deploy/src/DeploymentsManager.ts:1053:5)
at SimpleTaskDefinition.action (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat-deploy/src/index.ts:409:5)
at Environment._runTaskDefinition (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
at Environment.run (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
at SimpleTaskDefinition.action (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat-deploy/src/index.ts:555:32)
at Environment._runTaskDefinition (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
at Environment.run (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat/src/internal/core/runtime-environment.ts:131:14)
at SimpleTaskDefinition.action (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat-deploy/src/index.ts:640:5)
at Environment._runTaskDefinition (/home/sadath/hh-fcc/hardhat-lottery/node_modules/hardhat/src/internal/core/runtime-environment.ts:219:14)
error Command failed with exit code 1. here is the 01-deploy script const { getNamedAccounts, deployments, network, run, ethers } = require("hardhat")
const {
networkConfig,
developmentChains,
VERIFICATION_BLOCK_CONFIRMATIONS,
} = require("../helper-hardhat-config")
const { verify } = require("../utils/verify")
const FUND_AMOUNT = "1000000000"
module.exports = async ({ getNamedAccounts, deployments }) => {
const { deploy, log } = deployments
const { deployer } = await getNamedAccounts()
const chainId = network.config.chainId
let vrfCoordinatorV2Address, subscriptionId, vrfCoordinatorV2Mock
if (developmentChains.includes(network.name)) {
// create VRFV2 Subscription
vrfCoordinatorV2Mock = await ethers.getContract("VRFCoordinatorV2Mock")
vrfCoordinatorV2Address = vrfCoordinatorV2Mock.address
const transactionResponse = await vrfCoordinatorV2Mock.createSubscription()
const transactionReceipt = await transactionResponse.wait()
subscriptionId = transactionReceipt.events[0].args.subId
// Fund the subscription
// Our mock makes it so we don't actually have to worry about sending fund
await vrfCoordinatorV2Mock.fundSubscription(subscriptionId, FUND_AMOUNT)
} else {
vrfCoordinatorV2Address = networkConfig[chainId]["vrfCoordinatorV2"]
subscriptionId = networkConfig[chainId]["subscriptionId"]
}
// console.log('subscriptionId ->',subscriptionId.toNumber())
const waitBlockConfirmations = developmentChains.includes(network.name)
? 1
: VERIFICATION_BLOCK_CONFIRMATIONS
log("----------------------------------------------------")
const arguments = [
vrfCoordinatorV2Address,
subscriptionId,
networkConfig[chainId]["gasLane"],
networkConfig[chainId]["keepersUpdateInterval"],
networkConfig[chainId]["raffleEntranceFee"],
networkConfig[chainId]["callbackGasLimit"],
]
const raffle = await deploy("Raffle", {
from: deployer,
args: arguments,
log: true,
waitConfirmations: waitBlockConfirmations,
})
console.log('raffle address->',raffle.address)
// Programmatically adding a consumer for the vrfCoordinatorV2Mock
if (developmentChains.includes(network.name)) {
await vrfCoordinatorV2Mock.addConsumer(subscriptionId.toNumber(), raffle.address)
}
// Verify the deployment
if (!developmentChains.includes(network.name) && process.env.ETHERSCAN_API_KEY) {
log("Verifying...")
await verify(raffle.address, arguments)
}
log("Enter lottery with command:")
const networkName = network.name == "hardhat" ? "localhost" : network.name
log(`yarn hardhat run scripts/enterRaffle.js --network ${networkName}`)
log("----------------------------------------------------")
}
module.exports.tags = ["all", "raffle"] tried to copy paste the same code stil stuck in the error can anyone please say whats going on here ?? looks like something wrong around subscriptionId |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Aug 26, 2022
Replies: 2 comments 20 replies
-
@sadath-12 Leave your repo link. |
Beta Was this translation helpful? Give feedback.
19 replies
Answer selected by
alymurtazamemon
-
Try
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@sadath-12 Leave your repo link.