I am trying to implement the chainlink keeper to my contract. Actually I want to use the function checkUpkeep that is defined in this way:
function checkUpKeep(bytes calldata /* */) public returns (bool /* */, bytes memory /* */)
When I try to call this function with the literal string " " as parameter, solidity compiler (0.8.8) throw me this error:
TypeError: Invalid type for argument in function call. Invalid implicit conversion from literal_string "" to bytes calldata requested.
I call this function in this way:
checkUpKeep("")
My code:
function checkUpkeep(bytes calldata /* checkData */) public override returns (bool upkeepNeeded, bytes memory/* performData*/ ) { bool isOpen = (RaffleState.OPEN == s_raffleState); bool timePassed = ((block.timestamp - s_lastTimeStamp) > i_interval); bool hasPlayers = (s_players.length > 0); bool hasBalance = address(this).balance > 0; upkeepNeeded = (isOpen && timePassed && hasPlayers && hasBalance); } function performUpkeep(bytes calldata /* performData */) external override{ (bool upkeepNeeded, ) = checkUpkeep(""); // Error here ... }