Upgrades Plugins: Etherscan verification for proxies

OpenZeppelin Upgrades Plugins are the recommended way to deploy and manage upgradeable contracts. They help you to make use of upgradeable proxy patterns that can involve a number of different contracts.

In the latest release of the Hardhat upgrades plugin, Etherscan verification for proxies is now available. This makes it easy to verify your upgradeable proxies and implementation contracts with a simple command.

This feature extends hardhat-etherscan’s verify task to completely verify a proxy. When you run verify with a proxy address, the Hardhat upgrades plugin will verify the proxy contract, the implementation contract and any proxy-related contracts. It will also link the proxy to the implementation's ABI on Etherscan.

To install the Hardhat upgrades plugin, see Using with Hardhat. If you already have the plugin installed, update to the latest version with: npm install @openzeppelin/hardhat-upgrades@latest

To verify a proxy that has been deployed by the plugin, see documentation for verify.

For more information about Etherscan verification in general, see How to verify a contract on Etherscan/BscScan/PolygonScan.

1 Like

Is hardhat-etherscan’s verify task the reason why redeploying an instance of an already verified proxy or affiliated contracts fails, because the contract initial proxy already verified?

Is verification in this case not connected to the newly deployed contract address?

Verifying is separate from deploying. One should not affect the other.

If the same proxy contract or related proxy contract was already verified on the network, the hardhat-upgrades verify task may show that the contract is already verified and Etherscan would show "Similar Match Source Code". You can consider this as a verified proxy.