Dria

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

Owner initialization is absent in `swanMange.sol`

Summary

The SwanManager contract inherits from OwnableUpgradeable but lacks a function to initialize the owner, which is essential for access control of onlyOwner functions. Without setting the owner explicitly, no address has ownership rights, and all onlyOwner functions become inaccessible.

adding that it is inherited but it would not be owned by the contract owner

Vulnerability Details

The contract does not have an owner initialization function, leaving onlyOwner functions without an authorized address.

The OwnableUpgradeable pattern requires calling __Ownable_init() in an initializer function to set the initial owner. Without it, the contract’s owner remains unset.

Impact

he contract's onlyOwner functions are effectively locked, preventing the owner from calling those functions

Tools Used

Manual code review

Recommendations

Add an initializer function that calls __Ownable_init() to set the contract owner upon deployment or upgrade.

function initialize() external initializer {
__Ownable_init(// the owner );
// additional initialization logic
}
Updates

Lead Judging Commences

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

Support

FAQs

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