Last Man Standing

First Flight #45
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

QA Report-Includes All Infos-Gas

Root + Impact

QA Report-Includes All Infos-Gas

Description:

1. Use Fixed Compiler Version
Description:
Using ^0.8.20 allows any compiler version from 0.8.20 to <0.9.0, which can lead to future incompatibility or unintentional behavior changes as newer versions may introduce different features or bugs.
Impact:
Low – Ensures deterministic behavior across builds.
Fix:
pragma solidity 0.8.20;
2. Gas Optimization – Use += Instead of = +
Instance:
pot = pot + amountToPot;
playerClaimCount[msg.sender] = playerClaimCount[msg.sender] + 1;
totalClaims = totalClaims + 1;
Description:
Using += is more gas-efficient than = + due to slight opcode optimization.
Impact:
Informational – Minimal gas savings, but improves style and consistency.
Fix:
pot += amountToPot;
playerClaimCount[msg.sender] += 1;
totalClaims += 1;
3. No Withdrawal Mechanism for Ether Sent to Contract
Instance:
receive() external payable {}
Description:
The contract has a receive() function but no way for the owner or any party to withdraw accidentally sent Ether. This will lock all ETH sent to the contract forever.
Impact:
Low – Accidental ETH sent will be irretrievable.
Fix:
Prevent Accidental Transfers
receive() external payable {
revert("Nope);
}
4. Missing Zero Check in updatePlatformFeePercentage
Function:
function updatePlatformFeePercentage(uint256 _newPlatformFeePercentage)
external onlyOwner isValidPercentage(_newPlatformFeePercentage)
Description:
There is no explicit check ensuring _newPlatformFeePercentage is greater than zero.
Impact:
Low – Setting fee to 0 may break the intended fee logic.
Fix:
require(_newPlatformFeePercentage > 0, "Fee percentage must be > 0");
5. Missing Zero Check in updateClaimFeeParameters
Function:
function updateClaimFeeParameters(uint256 _newInitialClaimFee, uint256 _newFeeIncreasePercentage)
Description:
While _newInitialClaimFee is checked to be > 0, _newFeeIncreasePercentage only relies on the modifier isValidPercentage, which may not guarantee it's non-zero.
Impact:
Low – Fee increase percentage of zero may halt incremental fee logic.
Fix:
Add:
require(_newFeeIncreasePercentage > 0, "Fee increase percentage must be > 0");
Updates

Appeal created

inallhonesty Lead Judge 4 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.

Give us feedback!