Open
Description
Trying to deploy a factory contract using hardhat and openzeppelin defenders to have the same address across different networks when using the same salt.
The issue arises because the factory is deployed using deployProxy function, creating a TransparentUpgradeableProxy
, which does not result in a deterministic address across networks. This causes inconsistencies in the deployment addresses.
Attempts Made
- Deploying the factory as a UUPS proxy instead of a
TransparentUpgradeableProxy
, but this resulted in an error because the contract does not inherit fromUUPSUpgradeable
. - Deploying the factory using
deployContract
, but this assumes the contract is non-upgradeable, which is not the case and throws an error. - Deploying the factory using
deployProxy
, which always results in aTransparentUpgradeableProxy
, leading to non-deterministic addresses across networks.
Constraints
- I cannot modify the contract code.
- I can modify the deployment script.
Expected Behavior
The factory contract should have the same address across different networks when using the same salt.
Actual Behavior
The factory contract address changes across different networks due to the TransparentUpgradeableProxy
deployment process.
Steps to Reproduce
- Deploy the factory contract using
deployProxy
on different networks using the same salt. - Observe that the resulting address for the
TransparentUpgradeableProxy
is different on each network.
Possible Solutions / Help Needed
- Is there a way to deploy the factory deterministically while still keeping it upgradeable?
- Can
deployProxy
be configured to produce deterministic addresses across networks? If that's something that is possible now, am I missing some configuration? - Is there another deployment method that ensures both upgradeability and deterministic addresses?
Any insights or suggestions would be appreciated!
Metadata
Metadata
Assignees
Labels
No labels