Dria

Swan
NFTHardhat
21,000 USDC
View results
Submission Details
Severity: medium
Invalid

`SwanManager` is inheriting `OwnableUpgradeable` but not calling `__Ownable_init()` to set owner so owner will be default 0 and will never be changed.

Vulnerability Details:

Since SwanManager is not abstract contract and it is upgradeable. So it can be deployed on it's own. It is inheriting OwnableUpgradeable and using it's onlyOwner modifier. And this is upgradeable contract so __Ownable_init() should be called in initialize function to set owner.
Otherwise onlyOwner using function will never work. And owner can not be changed as initial owner is 0.

30 : contract SwanManager is OwnableUpgradeable {
//@audit initialize is not defined and __Ownable_init() not called

https://github.com/Cyfrin/2024-10-swan-dria/blob/main/contracts/swan/SwanManager.sol

Impact :

onlyOwner using functions will never work.

Recommendation

Add this function in SwanManager.sol.

+ /// @notice Initialize the contract.
+ function initialize() public initializer {
+ __Ownable_init(msg.sender);}
Updates

Lead Judging Commences

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Invalidated
Reason: Known issue

Support

FAQs

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