2

就像标题所说的那样,似乎已经满足了 keeper 运行 performUpkeep 的所有条件,但它并没有被调用。

这是维护链接:https ://keepers.chain.link/kovan/upkeeps/413

这是合同:https ://kovan.etherscan.io/address/0x969F42c92A6aeBD925982CCc1C943185B6D0E357#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;
    }

我尝试过的事情:

我使用 Remix 在https://kovan.etherscan.io/address/0x969F42c92A6aeBD925982CCc1C943185B6D0E357#code上查询 checkUpkeep以查看它是否返回 true。

4

1 回答 1

2

似乎问题出在收获功能中:

function harvest() public whenNotPaused onlyEOA

onlyEOA修饰符可能会阻止调用该函数,因为 Keepers 可能会从智能合约中调用它。

于 2021-08-10T12:24:43.537 回答