Sparkn

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

Unexpected Behavior for contests

Summary

Unexpected behavior regarding setContest and deployProxyAndDistribute

Vulnerability Details

There are 3 scenarios:

  1. The sponsors can sent tokens to a expired contest since there is no reset/check. This will result in locking of funds or the next scenario.

  2. It is possible to run deployProxyAndDistribute more than once. It will pass all checks and since there is funds in the contract, it will double spend and send tokens to winner addresses.

  3. New contests with same salt will not be initialized even though the old contest has expired.

Impact

Possible double spending and locking of funds in contract

Tools Used

Manual review

Recommendations

The best solution I can think of is setting:

saltToCloseTime[salt]=0

after each of the deployProxyAndDistribute functions.

  1. Vulnerability #1 is solved. Use a check for sponsors while sending tokens to the contract that the saltToCloseTime[salt]>0.

  2. Vulnerability #2 is solved. deployProxyAndDistribute cannot be run more than once since there is check for !saltToCloseTime[salt]>0

  3. Vulnerability #3 is solved. New contests with same salt can be set

Support

FAQs

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

Give us feedback!