gpt4 book ai didi

Chainlink keeper 未运行 performUpkeep,但 checkUpkeep 返回 true

转载 作者:行者123 更新时间:2023-12-04 07:16:46 27 4
gpt4 key购买 nike

就像标题所说的那样,似乎已经满足了 keeper 运行 performUpkeep 的所有条件,但它并没有被调用。
这是维护链接:https://keepers.chain.link/kovan/upkeeps/413
这是契约(Contract):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;
}
我尝试过的事情:
  • 通过进行新的维护来增加气体限制:https://keepers.chain.link/kovan/upkeeps/416
  • 在 checkUpkeep 上使用不带“view”修饰符的合约(如@chainlink/contract npm 包中的接口(interface):https://keepers.chain.link/kovan/upkeeps/414

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

    最佳答案

    似乎问题出在收获功能中:function harvest() public whenNotPaused onlyEOAonlyEOA修饰符可能会阻止调用该函数,因为 Keepers 可能会从智能合约中调用它。

    关于Chainlink keeper 未运行 performUpkeep,但 checkUpkeep 返回 true,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68715009/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com