smartcontractkit / smartcontractkit/chainlink

[DEVEL] VRF AddConsumer is failing

Open
#7,982 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
8.2k
Forks
2k
Avg merge
1d 23h
Merged PRs (30d)
202

Description

Description
I am trying to add a consumer to my VRF Chainlink Subscription using my smart contract, but every time i get an error stating that it cannot estimate gas.

Your Environment
Hardhat + Windows + Solidity

Basic Information
The error once i try to call COORDINATOR.addConsumer() function is as follows:

Error: ERROR processing D:\projects\lottery\deploy\01-deploy-lotteryOneWinner.js:
Error: cannot estimate gas; transaction may fail or may require manual gas limit [ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] (reason="execution reverted", method="estimateGas", transaction={"from":"0xAc5BB2Ee24FC60fE729BAF80FEEd8025c1D298Ef","data":"0x61014060405260

Steps to Reproduce

You can check out my contract here (vrfCoordinator is hardcoded for the polygon mumbai network):

https://mumbai.polygonscan.com/address/0xa9632B5b79769e1E5Aea0A891804055E9848E2AB#writeContract

The addConsumer function is meant to add the consumer, but it does not work.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the call to COORDINATOR.addConsumer() from the linked Polygon Mumbai contract using the reported Hardhat setup and the available gas-estimation error. Compare the contract and coordinator configuration against the expected consumer-registration flow; done means identifying the revert cause and confirming that addConsumer succeeds.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.