Description: The ChristmasDinner::getHost
function is completely unecessary due to the fact that the ChristmasDinner::host
statate variable is public
and can be accessed by the contract directly ChristmasDinner::host
. Also the dev comments say its primarily for testing, that's a bad practice and should be avoided. Don't put unecessary code in your contract just for "testing". Additionally the function also has a parameter address _host
which is not used.
The same problem can be said about the function ChristmasDinner.getParticipationStatus
, it is only being used once in the contract in ChristmasDinner::deposit
and can be easily replaced just by using the ChristmasDinner::participant
mapping.
Impact: Gas fees and messy code base
Proof of Concept:
None
Recommendation: Remove the function ChristmasDinner::getHost
completely and just use the getter ChristmasDinner:this.host()
or ChristmasDinner:host
directly. Additionally the function is only used once in withdraw, usually only want to add a helper function when its used more than once in the contract.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.