Hi guys. I'm having issues with contract verification on NodeReal's explorer for opBNB testnet - https://testnet.opbnbscan.com.
Error log suggests that the issue is with my configured solidity version (0.8.28) and incompatibility with proxy (presumably ERC1967Proxy). It makes sense, since I deployed the contract with deploy-proxy from @openzeppelin/hardhat-upgrades, and it uses precompiled version of ERC1967Proxy.
$ yarn hardhat verify 0x28aA1cD7114395E7a055419497135199228b8D76 --network opbnb_testnet
Verifying implementation: 0x11D09E261Dc31FcA19e08e0370797a0176Ed01d3
Implementation 0x11D09E261Dc31FcA19e08e0370797a0176Ed01d3 already verified.
Verifying proxy: 0x28aA1cD7114395E7a055419497135199228b8D76
Verifying implementation: 0x11D09E261Dc31FcA19e08e0370797a0176Ed01d3
Implementation 0x11D09E261Dc31FcA19e08e0370797a0176Ed01d3 already verified.
Verifying proxy: 0x28aA1cD7114395E7a055419497135199228b8D76
Could not find an event with any of the following topics in the logs for address 0x28aA1cD7114395E7a055419497135199228b8D76: AdminChanged(address,address), Upgraded(address)
If the proxy was recently deployed, the transaction may not be available on Etherscan yet. Try running the verify task again after waiting a few blocks.
Failed to verify directly using hardhat verify: The contract you want to verify was compiled with solidity 0.8.20, but your configured compiler versions are: 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28.
Possible causes are:
- You are not in the same commit that was used to deploy the contract.
- Wrong compiler version selected in hardhat config.
- The given address is wrong.
- The selected network (opbnb_testnet) is wrong.
Linking proxy 0x28aA1cD7114395E7a055419497135199228b8D76 with implementation
Successfully linked proxy to implementation.
Could not find an event with any of the following topics in the logs for address 0x28aA1cD7114395E7a055419497135199228b8D76: AdminChanged(address,address), Upgraded(address)
If the proxy was recently deployed, the transaction may not be available on Etherscan yet. Try running the verify task again after waiting a few blocks.
Failed to verify directly using hardhat verify:
Verification completed with the following errors.
Error 1: Could not find an event with any of the following topics in the logs for address 0x28aA1cD7114395E7a055419497135199228b8D76: AdminChanged(address,address), Upgraded(address)
If the proxy was recently deployed, the transaction may not be available on Etherscan yet. Try running the verify task again after waiting a few blocks.
Error 2: Failed to verify directly using hardhat verify: The contract you want to verify was compiled with solidity 0.8.20, but your configured compiler versions are: 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28.
Possible causes are:
- You are not in the same commit that was used to deploy the contract.
- Wrong compiler version selected in hardhat config.
- The given address is wrong.
- The selected network (opbnb_testnet) is wrong.
Linking proxy 0x28aA1cD7114395E7a055419497135199228b8D76 with implementation
Successfully linked proxy to implementation.
hardhat-verify found one or more errors during the verification process:
Etherscan:
Verification completed with the following errors.
Error 1: Could not find an event with any of the following topics in the logs for address 0x28aA1cD7114395E7a055419497135199228b8D76: AdminChanged(address,address), Upgraded(address)
If the proxy was recently deployed, the transaction may not be available on Etherscan yet. Try running the verify task again after waiting a few blocks.
Error 2: Failed to verify directly using hardhat verify:
Verification completed with the following errors.
Error 1: Could not find an event with any of the following topics in the logs for address 0x28aA1cD7114395E7a055419497135199228b8D76: AdminChanged(address,address), Upgraded(address)
If the proxy was recently deployed, the transaction may not be available on Etherscan yet. Try running the verify task again after waiting a few blocks.
Error 2: Failed to verify directly using hardhat verify: The contract you want to verify was compiled with solidity 0.8.20, but your configured compiler versions are: 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28, 0.8.28.
Possible causes are:
- You are not in the same commit that was used to deploy the contract.
- Wrong compiler version selected in hardhat config.
- The given address is wrong.
- The selected network (opbnb_testnet) is wrong.
Usually explorers like etherscan are able to automatically verify ERC1967Proxy by Similar Contracts feature, but it looks like NodeReal's explorer is missing this.
Also please note that implementation is verified without issue (as can be seen at [0x11D09E261Dc31FcA19e08e0370797a0176Ed01d3]), the issue is with proxy verification which is failing the verify script (and as expected is shown as not verified on UI - 0x28aA1cD7114395E7a055419497135199228b8D76).
One possible solution that I could try is to verify proxy myself via UI, the only thing I need is Standard Json-Input for precompiled ERC1967Proxy, unfortunately I was unable to find it in node_modules, if someone has it or know how to obtain it, please respond.
Code to reproduce
To reproduce the issue, deploy UUPS proxy with deployProxy from @openzeppelin/hardhat-upgrades and try to verify with hardhat-verify setup as described in https://docs.bnbchain.org/bnb-opbnb/advanced/verify-on-opbnbscan/#hardhat.
Environment
I'm using hardhat with @openzeppelin/hardhat-upgrades@3.0.5. Verification is done via hardhat-verify, verify example usage is present in error log above.