Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

A lot of important state variables have visibility set to internal by default

Description: Important state variables such as ChristmasDinner::participant, ChristmasDinner::balances, ChristmasDinner::etherBalance, and ChristmasDinner::whitelisted have no visibility set and therefore have the internal visibility by default.

Impact: The partcipants/users can't check if they already deposited any funds into the contract, therefore they can't find out if they already joined the event. Additionally can't check their token nor ether balances and can't check which tokens are whitelisted.

Proof of Concept:

None

Recommendation: Make the important state variables public for users to see key information about their involvement in the event.

- mapping (address user => bool) participant;
- mapping (address user => mapping (address token => uint256 balance )) balances;
- mapping (address user => uint256 amount) etherBalance;
- mapping (address token => bool ) whitelisted;
+ mapping (address user => bool) public participant;
+ mapping (address user => mapping (address token => uint256 balance )) public balances;
+ mapping (address user => uint256 amount) public etherBalance;
+ mapping (address token => bool ) public whitelisted;
Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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