Sparkn

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

Usage of an incorrect version of Ownbale library can potentially malfunction all onlyOwner functions

Summary

Potentially malfunction of all onlyOwner functions if the ProxyFactory.sol contract is upgrade

Vulnerability Details

If there is a need to upgrade the protocol,specifically the contract ProxyFactory.sol, this implementation will not be correct due to the use of the library "openzeppelin/access/Ownable.sol" instead of the upgradeable version: openzeppelin-contracts-upgradeable/contracts/access/OwnableUpgradeable.sol.

A regular, non-upgradeable Ownbale library will make the deployer the default owner in the constructor in the ProxyFactory.sol contract. In proxy-based upgradeability conteacts, no constructors can be used.

Therefore, if the team want to upgrade the protocol and consequently the ProxyFactory.sol contract, there will be no owner when the contract is deployed as a proxy contract.

Impact

Only owner modifiers would be inaccessible

Tools Used

Manual Review

Recommendations

If there is a need to upgrade the protocol, use @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol instead of "openzeppelin/access/Ownable.sol"

Support

FAQs

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