Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can claim Raffle be exploited? #11

Open
sssubik opened this issue Jan 3, 2022 · 0 comments
Open

Can claim Raffle be exploited? #11

sssubik opened this issue Jan 3, 2022 · 0 comments

Comments

@sssubik
Copy link

sssubik commented Jan 3, 2022

Hey nice stuff!

uint256 winningTickets = nftCount - tmpCount;

 if (winningTickets != tickets.length) {
            // Payout value equal to number of bought tickets - paid for winning tickets
            (bool sent, ) = payable(msg.sender).call{
                value: (tickets.length - winningTickets) * MINT_COST
            }("");
            require(sent, "Unsuccessful in refund");
        }

here there is cpmparison of winning ticket != tickets.length.

What if number of tickets is 100 and nobody is a winner. since there is no winner winningTickets is 0. And the function will transfer the money as refund?

Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant