The updatePlatformFeePercentage function lacks a modifier, enabling the owner to directly modify the platform fee percentage even while the throne claim game is still active.
Impact:
During normal player participation, if the admin can arbitrarily change the fee percentage, it becomes unfair to the player who will eventually win.
As the game progresses, an increased platform fee reduces the amount added to the pot per claim, slowing down prize accumulation and diminishing the final reward for the winner.
This verification assumes the claimThrone function has already fixed the following two issues:
Correct initial check: require(msg.sender != currentKing, "Game: You are already the king. No need to re-claim.");
Proper handling of the previous king's reward: uint256 previousKingPayout = (sentAmount * previousKngFeePercentage) / 100;
Admin deploys the contract.
Player player1 pays the claim fee and calls claimThrone.
Player player2 pays the claim fee and calls claimThrone.
Admin calls updatePlatformFeePercentage to increase the platform fee.
Player player1 pays the claim fee and calls claimThrone, contributing less to the pot due to the higher fee.
Player player2 pays the claim fee and calls claimThrone, also contributing less to the pot.
Simply add the gameEndedOnly modifier to the updatePlatformFeePercentage function, restricting the admin to only update the fee percentage after the game has ended:
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.