Sparkn

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

Sponsor money could be locked in the contract and not go to the winner

Summary

Let's imagine the following scenario:

  1. If the sponsor is ready to give money and does not know that the competition is over, but the organizer starts to send rewards to the winner and front-run, then the sponsor’s money will be locked in the contract;

  2. The second situation is that in the case of network congestion, the sponsor is going to give money, and then the organizer is going to end the game, but the request to end the game is processed first due to network congestion. Similarly, the sponsor’s money will be locked in a contract;

Vulnerability Details

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

Impact

Sponsor money could be locked in the contract and not go to the winner

Tools Used

manual

Recommendations

We can add a function to process the remaining tokens in the contract after the game is over and the rewards are distributed

Support

FAQs

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