Moonster
Moonster

Reputation: 21

Chainlink keeper not running performUpkeep, yet checkUpkeep returns true

Like the title says, it seems all the conditions for a keeper to run performUpkeep have been met, yet it is not being called.

Here is the upkeep link: https://keepers.chain.link/kovan/upkeeps/413

Here is the contract: https://kovan.etherscan.io/address/0x969F42c92A6aeBD925982CCc1C943185B6D0E357#code

Here is the relevant code:

function checkUpkeep(bytes calldata checkData) external view override returns (bool upkeepNeeded, bytes memory performData) {
        upkeepNeeded = shouldHarvest();

        // We don't use the checkData
        // checkData was defined when the Upkeep was registered
        performData = checkData;
    }

    function performUpkeep(bytes calldata performData) external override {
        harvest();

        // We don't use the performData
        // performData is generated by the Keeper's call to your `checkUpkeep` function
        performData;
    }

    function shouldHarvest() internal view returns (bool) {
        bool hasPendingOutput = IMasterChef(chef).pendingBall(poolId, address(this)) > harvestThreshold;
        bool harvestCondition = hasPendingOutput && !paused();
        return harvestCondition;
    }

Things I have tried:

I used Remix to query checkUpkeep on the https://kovan.etherscan.io/address/0x969F42c92A6aeBD925982CCc1C943185B6D0E357#code to see that it is returning true.

Upvotes: 2

Views: 405

Answers (1)

Cenobyte321
Cenobyte321

Reputation: 479

It seems the issue is in the harvest function:

function harvest() public whenNotPaused onlyEOA

The onlyEOA modifier could be preventing the function from being called since Keepers likely calls it from a smart contract.

Upvotes: 2

Related Questions