Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Single-Use Modifier Implementation

Description: The nonReentrant modifier is only used once in the contract, which may not justify the gas cost of implementing it as a modifier.

modifier nonReentrant() {

Impact:

  • Increased deployment gas costs

  • Code complexity without proportional benefit

  • Reduced code maintainability

Recommended Mitigation: Either:

  1. Incorporate the modifier logic directly into the function:

function refund() external beforeDeadline {
require(!locked, "No re-entrancy");
locked = true;
address payable _to = payable(msg.sender);
_refundERC20(_to);
_refundETH(_to);
emit Refunded(msg.sender);
locked = false;
}
  1. Or justify modifier usage by implementing it in multiple functions where reentrancy protection is needed.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Design choice
0xtimefliez Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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