I ran into a problem with implementing Patrick Collins' automation smart contract, and I received "contract 'raffle should be marked as abstract" and is not compiled. What is wrong with my code?

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";
import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/automation/AutomationCompatible.sol";

error Raffle__NotEnoughEthEnterned();
error Raffle__TransferFailed();
error Raffle__NotOpen();
error Raffle__UpkeepNotNeeded(uint256 currentBalance, uint256 numPlayers, uint256 raffleState);

contract Raffle is VRFConsumerBaseV2, AutomationCompatibleInterface {}

1 Answer 1


Ran into the same problem. The problem is:

Note: Missing implementation: 
  --> @chainlink/contracts/src/v0.8/automation/interfaces/AutomationCompatibleInterface.sol:40:3:
40 |   function performUpkeep(bytes calldata performData) external;

You can add the implementation of functions checkUpkeep and performUpkeep in the contract:

function checkUpkeep(bytes calldata checkData) external returns (bool upkeepNeeded, bytes memory performData) {}

function performUpkeep(bytes calldata performData) external override {}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.