wighawag / hardhat-deploy

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

Default use owner function to get address #525

Closed aefhm closed 2 months ago

aefhm commented 3 months ago

Description

Confidential EVMs such as Sapphire prevents direct getStorageAt calls from accessing raw slot data in order to allow a smart contract to permission access to its own state.

The default proxy supports the EIP173 spec function owner which appears to be the smoothest path towards supporting additional EVM like networks.

Would y'all find this compatible? An alternative solution would be to compare msg.data with a set of predefined keys and to return the storage slot. https://github.com/wighawag/hardhat-deploy/blob/e3727896a812fe1a17e04f52a4aecc42c7b13ed4/solc_0.8/proxy/EIP173Proxy.sol#L29-L31

Relates to issue https://github.com/wighawag/hardhat-deploy/issues/530.

wighawag commented 2 months ago

Happy to have that in, but it should support both. it should check if the proxy has an owner function and uses it if it does, else fallback on reading storage slot

aefhm commented 2 months ago

Happy to have that in, but it should support both. it should check if the proxy has an owner function and uses it if it does, else fallback on reading storage slot

Appreciate the feedback. Will do.

aefhm commented 2 months ago

@wighawag one more look please?

wighawag commented 2 months ago

Thanks! available in 0.12.3