【问题标题】:Chainlink keeper not running performUpkeep, yet checkUpkeep returns trueChainlink keeper 未运行 performUpkeep,但 checkUpkeep 返回 true
【发布时间】:2021-08-09 15:50:04
【问题描述】:

正如标题所说,似乎所有守门员运行 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。

【问题讨论】:

标签: chainlink


【解决方案1】:

看来问题出在收获功能上:

function harvest() public whenNotPaused onlyEOA

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

【讨论】:

    猜你喜欢
    • 2022-11-12
    • 2022-11-12
    • 1970-01-01
    • 2021-09-13
    • 1970-01-01
    • 2013-09-17
    • 1970-01-01
    • 1970-01-01
    • 2016-06-22
    相关资源
    最近更新 更多