I'm trying to register upkeeps from my smart contract. I started by using the template for Chainlink Automation Compatible given in the docs. Then I deployed the UpkeepIDConsumerExample contract given in the docs.
I have only added these two lines to the UpkeepIDConsumerExample contract,
receive() external payable {}
// Fallback function is called when msg.data is not empty
fallback() external payable {}
The UpkeepIDConsumerExample is deployed to mumbai and is funded with $LINK and $MATIC.
These are my constructor args,
KeeperRegistrar2_0:0x57A4a13b35d25EE78e084168aBaC5ad360252467
KeeperRegistry2_0:0xE16Df59B887e3Caa439E0b29B42bA2e7976FD8b2
Link Token:0x326C977E6efc84E512bB9C30f76E30c160eD06FB
Now when I try to call registerAndPredictID function, I end up getting this error,
Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? Internal JSON-RPC error. { "code": -32000, "message": "execution reverted" }
I tried to check with other docs and stackoverflow but no positive results
It looks like you found an issue with the docs. It'll be fixed soon. Until then, here is a sample contract you can check out with the revised code and values
This transaction shows it working.
One thing to note You must fund the contract you deploy
UpkeepIDConsumerExamplewith LINK. If the contract doesn't have any, when you callregisterAndPredictID, you will see theGas estimation error.