Last Man Standing

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

[I-3] Unnecesary usage of `nonReentrant` modifier at `Game::claimThrone`.

Root + Impact

[I-3] Unnecesary usage of nonReentrant modifier at Game::claimThrone.

Description

The Game::claimThrone payable function is used to pay the claimFee in order to become the currentKing of the actual round.

Risk

Likelihood: Low

  • Reason 1 : Generally there is no need to use the nonReentrant modifier on a function that only deposits ETH, as long as it does not make any external calls.

Impact: Low

  • Impact 1: This function does not make any external calls and can be safely called without the nonReentrant modifier.

Proof of Concept

The function is written as follow:

function claimThrone() external payable gameNotEnded nonReentrant {

Since this function does not make any external call, it will just receive the claimFee which is the msg.value in ETH directly to the contract, there is no need for the nonReentrant modifier in it.

Recommended Mitigation

Remove the nonReentrant modifier from the Game::claimThrone funtion.

- function claimThrone() external payable gameNotEnded nonReentrant {
+ function claimThrone() external payable gameNotEnded {
Updates

Appeal created

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