Last Man Standing

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

No previousKing Payout System

Root + Impact

The system promises to give the King a small payout from the next player's claim fee but this is never implemented and as a result the intended incentives are not paid out. The impact of this issue is that it breaks the intended functionality while also affecting user trust.


Description

  • It is intended that the protocol gives the king a small payout from the next player's claim fee.

  • The above logic is not implemented and as such breaks the functionality.


Risk

Likelihood:

  • Reason 1 // The issue is persistent as long as there would be players in the game and the intended functionality would not be implemented.


Impact:

  • Impact 1 There would be no rewards for the previous king as promised leading to user sentiment becoming poor due to unfulfilled promises.


Proof of Concept

The indicated line of code shows the issue:

function claimThrone() external payable gameNotEnded nonReentrant {
require(msg.value >= claimFee, "Game: Insufficient ETH sent to claim the throne.");
require(msg.sender == currentKing, "Game: You are already the king. No need to re-claim.");
//@audit-high should be "msg.sender != currentKing" disrupts functionality
//@audit-low check that msg.sender is not the 0 address
//@audit-low who is calling the contract ? can a smart contract without a receive or fallback halt the game by not being able to receive ether for the next round ?
//@audit-med can this transaction be front run after being observed in the mempool ???? can we prevent this by hashing the gracePeriod or some other way?
uint256 sentAmount = msg.value;
@>> uint256 previousKingPayout = 0;

Recommended Mitigation

Implement a payout system to the King from the next player's claim fee so as to fufill the intended game logic.
Updates

Appeal created

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Missing Previous King Payout Functionality

Support

FAQs

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