safe-global / safe-smart-account

Safe allows secure management of blockchain assets.
https://safe.global
GNU Lesser General Public License v3.0
1.84k stars 907 forks source link

variable can be declared as immutable #617

Closed allwin199 closed 1 year ago

allwin199 commented 1 year ago

Description

In contracts/proxies/SafeProxy.sol

address internal singleton;

constructor(address _singleton) {
        require(_singleton != address(0), "Invalid singleton address provided");
        singleton = _singleton;
 }

Can singleton be converted to immutable?

address internal immutable singleton;
allwin199 commented 1 year ago

singleton value is mutated only in the constructor, so it can be declared as immutable.

If this change is necessary, I can raise a PR.

mmv08 commented 1 year ago

If it's declared as immutable, upgrades would not be possible.

allwin199 commented 1 year ago

got it!