wighawag / hardhat-deploy

hardhat deployment plugin
MIT License
1.17k stars 283 forks source link

fix: _setOwner before _setImplementation in solc_0.8 EIP173Proxy cons… #424

Closed gitpusha closed 1 year ago

gitpusha commented 1 year ago

This PR changes the order in which the EIP173Proxy constructor invokes _setOwner and _setImplementation.

This PR wants to _setOwner before _setImplementation at Proxy constructor deployment initialization.

This is because many implementation initializer function use cases require an access restriction modifier of onlyProxyAdmin .

The current flow prevents such useful and secure access restriction on implementation initializers as when the _setImplementation fn is called with data for a function call, the proxyAdmin value is still set to AddressZero .

wighawag commented 1 year ago

Thanks @gitpusha and sorry for the delay it is published under 0.11.34