Sparkn

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

Convert the saltToCloseTime check to modifier

Summary

There are multiple places to check the condition of saltToCloseTime[salt] == 0, ideally it should be consistent in each deployProxy functions but right now it isn't.

For example in deployProxyAndDistributeByOwner function, it checks saltToCloseTime[salt] == 0 and saltToCloseTime[salt] + EXPIRATION_TIME > block.timestamp while in deployProxyAndDistributeBySignature function, it checks saltToCloseTime[salt] == 0 and saltToCloseTime[salt] > block.timestamp.

We'd better to update the condition checks to solidity modifiers to make the functions clean and more readable.

Vulnerability Details

https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L132-L134
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L162-L163
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L186-L187
https://github.com/Cyfrin/2023-08-sparkn/blob/main/src/ProxyFactory.sol#L214-L216

Tools Used

Manual review

Recommendations

Update the condition checks to modifiers and make them consistent in each function

Support

FAQs

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