IERC721 Receiver interface implementation

I have a Lottery smart contract that I have found online made by a great developer that I have decided to build a product around. The Lottery contract can only receive ether in its current state. I would like the contract to be able to receive ERC 721, 1155 and 20 tokens and release them when the pick winner function is called.

I tried to put the IERC721 receiver into this contract but it would not compile for me.

Here is the code below I am trying to upgrade to receive all types of tokens and payout when a winner is chosen, Could someone please advise me on the way to go about implementing these properly? Or if this is possible at all.

Thank you very much!

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.11;

import "@chainlink/contracts/src/v0.8/VRFConsumerBase.sol";

contract Ownable_Page_Lottery is VRFConsumerBase {
    address public owner;
    address payable[] public players;
    uint public lotteryId;
    mapping (uint => address payable) public lotteryHistory;

    bytes32 internal keyHash; // identifies which Chainlink oracle to use
    uint internal fee;        // fee to get random number
    uint public randomResult;

            0xb3dCcb4Cf7a26f6cf6B120Cf5A73875B7BBc655B, // VRF coordinator
            0x01BE23585060835E02B77ef475b0Cc51aA1e0709  // LINK token address
        ) {
            keyHash = 0x2ed0feb3e7fd2022120aa84fab1945545a9f2ffc9076fd6156fa96eaff4c1311;
            fee = 0.1 * 10 ** 18;    // 0.1 LINK

            owner = msg.sender;
            lotteryId = 1;


    function getRandomNumber() public returns (bytes32 requestId) {
        require(LINK.balanceOf(address(this)) >= fee, "Not enough LINK in contract");
        return requestRandomness(keyHash, fee);

    function fulfillRandomness(bytes32 requestId, uint randomness) internal override {
        randomResult = randomness;

    function getWinnerByLottery(uint lottery) public view returns (address payable) {
        return lotteryHistory[lottery];

    function getBalance() public view returns (uint) {
        return address(this).balance;

    function getPlayers() public view returns (address payable[] memory) {
        return players;

    function enter() public payable {
        require(msg.value > 1 ether);

        // address of player entering lottery

    function pickWinner() public onlyowner {

    function payWinner() public {
        uint index = randomResult % players.length;

        lotteryHistory[lotteryId] = players[index];
        // reset the state of the contract
        players = new address payable[](0);

    modifier onlyowner() {
      require(msg.sender == owner);

    receive () external payable {}