Last Man Standing

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

Reentrancy Modifier Ordering

Summary

The nonReentrant modifier is not applied as the first modifier in some functions. While this does not currently impact the contract's security, it is considered best practice to place nonReentrant as the first modifier to reduce the risk of future vulnerabilities.

Description

In the following functions:

function claimThrone() external payable gameNotEnded nonReentrant
function withdrawPlatformFees() external onlyOwner nonReentrant

The nonReentrant modifier is placed after other modifiers (gameNotEnded, onlyOwner). Although these modifiers currently do not introduce any external calls or reentrant risks, placing nonReentrant first is the recommended ordering.

This is because any logic or external interaction in earlier modifiers could potentially be exploited in the event of changes or future extensions to the contract.

Impact

There is no current impact in the contract, as the preceding modifiers are safe and do not make external calls. However, this is flagged as a best practice issue to promote consistency, clarity, and future safety in the codebase.

Mitigation

Reorder the nonReentrant modifier to be the first modifier in all functions where it's used.

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!