Sparkn

CodeFox Inc.
DeFiFoundryProxy
15,000 USDC
View results
Submission Details
Severity: medium

A grace period should be added when a match has not yet been decided to decide the winner

Summary

A grace period should be added when a match has not yet been decided to decide the winner.

Let's assume this scenario:

A game that has not been decided after the end of the time may be due to disputes over the results of the game. Although the agreement has a seven-day grace period, this grace period is used to solve the situation where the organizer is not active, but maybe this seven days is not enough, at this time the owner does not know, and after seven days the owner may not know about the competition because of the existence of The controversy is not over yet, he may have thought that the organizer was not very active, and then distributed the game rewards without authorization, which eventually led to the wrong distribution of rewards

Vulnerability Details

https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L205

Impact

May cause rewards to be distributed incorrectly

Tools Used

manual

Recommendations

  1. I suggest that a parameter isOver can be added to determine whether the game needs to be postponed

  2. And distributeByOwner() function add check if isOver == true;

  3. Add a function such Set_contest_isOver() and only be call by organizer

Support

FAQs

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