Description
Trying to deploy an upgradeable contract using Hardhat and OpenZeppelin Defender with defender.deployProxy
on Polygon Mainnet.
The issue arises specifically when attempting to deploy the proxy contract. The deployment fails with the following error: ProviderError: the method has been deprecated: eth_accounts
This problem only occurs on Polygon Mainnet and only when using deployProxy. Other deployment methods work correctly across all networks tested.
Attempts Made
- Deployed two other contracts using
deployContract
anddeployImplementation
functions on Polygon Mainnet, both deployed successfully. - Used
defender.deployProxy
to deploy the same contract on other networks (Sepolia, Avalanche, etc.), worked without issues. - Attempted different configurations on Polygon Mainnet, issue persists.
Constraints
- I cannot modify the contract code.
- I can modify the deployment script.
Expected Behavior
The contract should be deployed successfully on Polygon Mainnet using defender.deployProxy, just as it is on other networks.
Actual Behavior
Deployment using defender.deployProxy
fails on Polygon Mainnet with the following error: ProviderError: the method has been deprecated: eth_accounts
Steps to Reproduce
- Use defender.deployProxy to deploy an upgradeable contract on Polygon Mainnet.
- Observe that deployment fails with the mentioned provider error.
- Deploy the same contract using the same
deployProxy
function on other networks (Sepolia, Avalanche, etc.), it succeeds.
Possible Solutions / Help Needed
- Is there a way to avoid or work around the deprecated eth_accounts call during proxy deployment?
- Are there any recommended configurations or versions to ensure compatibility?
Any insights or suggestions would be appreciated!