hats-finance / Most--Aleph-Zero-Bridge-0xab7c1d45ae21e7133574746b2985c58e0ae2e61d

Aleph Zero bridge to Ethereum
Apache License 2.0
0 stars 1 forks source link

Missing __UUPSUpgradeable_init() in Most.sol initialize function #49

Open hats-bug-reporter[bot] opened 5 months ago

hats-bug-reporter[bot] commented 5 months ago

Github username: -- Twitter username: 0xNGOC Submission hash (on-chain): 0x6750b5bb07581eb083f374d4423aa5897547f220c6ac0d75b680918800b789c0 Severity: minor

Description: Description\ Most.sol contract is programmed to be upgradeable by using UUPSUpgradeable. However, there is no __UUPSUpgradeable_init() in the initialize function like the OpenZeppelin Wizard recommendation.

Attack Scenario\ Although the __UUPSUpgradeable_init() is empty in the current "@openzeppelin/contracts-upgradeable" v5.0.2, there may be additional logic in the future of the contract modified by OpenZeppelin themselves (see reference from OpenZeppelin team: https://forum.openzeppelin.com/t/uups-proxies-tutorial-solidity-javascript/7786/30). So the best practice now is to include __UUPSUpgradeable_init() in the initialize function.

Attack Scenario\ Consider adding __UUPSUpgradeable_init() into initialize function:

    function initialize(
        address[] calldata _committee,
        uint256 _signatureThreshold,
        address owner,
        address payable _wethAddress
    ) public initializer {
        committeeId = 0;
        wethAddress = _wethAddress;

        _setCommittee(_committee, _signatureThreshold);

        __Ownable_init(owner);
+      __UUPSUpgradeable_init()
        __Pausable_init();
        _pause();
    }
krzysztofziobro commented 4 months ago

Does not qualify for minor: "having a negative impact on user experience, or putting one of the contracts in an unexpected state"