Skip to content
Discussion options

You must be logged in to vote

You need to convert msg.sender to a payable address since you cannot add a non-payable address to an array.

Update your enter() function to include players.push(payable(msg.sender));

    function enter() public payable {
        require(lottery_state == LOTTERY_STATE.OPEN);
        require(msg.value >= getEntranceFee(), "Not enough ETH!");
        players.push(payable(msg.sender));
    }

Replies: 2 comments 1 reply

Comment options

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

Answer selected by cromewar
Comment options

You must be logged in to vote
0 replies
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