Skip to content

Invalid type for argument in function call. Invalid implicit conversion from literal_string "" to bytes calldata requested. #278

Answered by mattjaf
SantanuDK asked this question in Q&A
Discussion options

You must be logged in to vote

something might be wrong with your checkUpkeep function

maybe

function checkUpkeep(
        bytes memory /* <-------------checkData */

function checkUpkeep(
        bytes memory /* checkData */
    )
        public
        view
        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 = (timePassed && isOpen && hasBalance && hasPlayers);
        return (upkeepNeeded, "…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@SantanuDK
Comment options

@csmattjohnston
Comment options

Answer selected by SantanuDK
Comment options

You must be logged in to vote
1 reply
@SantanuDK
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants