-
I'm trying to use the chainlink keepers, during testing Also when deploying on rinkeby The code is as follows, when I register the wallet (0xD6e0FFBf2d0029FFFeE7750496C69B584b4e2db7) function checkUpkeep(bytes memory /* checkData */) public view override returns (//,bytes memory value
bool upkeepNeeded,
bytes memory num
){
uint256 EthPrice;
uint256 i = 2;
EthPrice = getPrice();
num = abi.encodePacked(i);
address addr = s_Wallets[0];
if (addr == 0xD6e0FFBf2d0029FFFeE7750496C69B584b4e2db7){
upkeepNeeded = true;
}
return (upkeepNeeded, num);//, value
}
function performUpkeep(bytes calldata num) external override {//, bytes calldata value
(bool upkeepNeeded, ) = checkUpkeep("");
if (!upkeepNeeded) {
revert Order__UpkeepNotNeeded(
address(this).balance,
s_Wallets.length
);
}
//Byte conversion to uint
uint256 number;
number = abi.decode(num, (uint256));
// for(uint i=0;i<num.length;i++){
// number = number + uint(uint8(num[i]))*(2**(8*(num.length-(i+1))));
// }
s_nombre = number;
} I'm doing the register on chainlink website correctly and the inheritance also. // SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
import "@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.8/interfaces/KeeperCompatibleInterface.sol"; // Keepers import
import "./TokenPrice.sol";
error Quantity_zero();
error Wallet_error();
error Order__UpkeepNotNeeded(uint256 currentBalance, uint256 PlayersNum);
contract MarketOrder is KeeperCompatibleInterface { Any advice? I really don't undrstand why this is not working as I used keepers before and it felt much easier to use them. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Rinkeby was deprecated post-merge. Please use Goerli instead. |
Beta Was this translation helpful? Give feedback.
Rinkeby was deprecated post-merge.
Please use Goerli instead.