user7424538
user7424538

Reputation: 1

What is causing gas estimation error when calling KeeperRegistry2.0 with contract?

I use a contract to call the KeeperRegitry2.0 to manage the upKeep state. There is a sample Contract :

interface IKeeperRegistry {
  function pauseUpkeep(uint256 id) external;
}

contract KeeperManager{
    IKeeperRegistry immutable public i_registry;
    //_registry is 0xE16Df59B887e3Caa439E0b29B42bA2e7976FD8b2
    constructor(IKeeperRegistry _registry) {
      i_registry = _registry;
  
    }

    function pause(uint256 _upkeepID) external {
     
            i_registry.pauseUpkeep(_upkeepID);     
    }
    
}

I use Remix to deploy this Contract. There is an error about

Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending?
Returned error: {"jsonrpc":"2.0","error":"invalid opcode: opcode 0x5f not defined","id":2219264146385420}

and then I use hardhat to deploy successfully ,but when I write Contract by mumbai.polygonscan there is an error:

We were not able to estimate gas. There might be an error in the contract and this transaction may fail.

What is problem about the error?

enter image description here

https://docs.chain.link/chainlink-automation/register-upkeep I use v2.0 registry and registrar interfaces that also the same issue.

Upvotes: 0

Views: 688

Answers (1)

Lokesh Maheshwari
Lokesh Maheshwari

Reputation: 1

Over here I assume that the caller becomes your contract, which is why the transaction will fail anyways for Pausing the upkeep.

Also to check the deployment, the code you provided is not sufficient to check it

Upvotes: 0

Related Questions