Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: medium
Valid

The participation status of ether doners will always be false.

Description:

In ChristmasDinner::receive() function the ether is taken from participants but their status is never changed

Impact:

As a result their status will always be false and they will not be able to participate in the event

Proof of Concept:

function test_participateWithEther() public {
address user4 = makeAddr("user4");
vm.deal(user4,1e18);
vm.prank(user4);
(bool sent,) = address(cd).call{value: 1e18}("");
require(sent, "transfer failed");
// assertEq(address(cd).balance, 1e18);
bool statusofu4 = cd.getParticipationStatus(user4);
vm.expectRevert();
assertEq(statusofu4, true);
}

Recommended Mitigation:

receive() external payable {
etherBalance[msg.sender] += msg.value;
+ participant[msg.sender] = true;
emit NewSignup(msg.sender, msg.value, true);
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

receive does not update participation status

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.