I am trying to verify 3 UUPS upgradeable contracts on Ropsten Etherscan.
I am using this pattern to get the addresses for their implementation contracts:
const proxyAddress = contractProxyAddress
const implementationAddress = await upgrades.erc1967.getImplementationAddress(proxyAddress)
I am using the returned implementation address and an empty constructor args array here:
await hre.run("verify:verify", {
address: contractAddress,
constructorArguments: constructorArgs,
});
This is the failed verification message:
deployment file being verified: ./.deployments/ropsten/ropsten-1654132332519000.json
----------
VaultFactory: 0x070c58d8720b18A5763c1e24FE30d6AA77F86810
----------
Nothing to compile
Creating Typechain artifacts in directory typechain for target ethers-v5
Successfully generated Typechain artifacts!
Compiling 1 file with 0.8.11
Successfully submitted source code for contract
contracts/vault/VaultFactory.sol:VaultFactory at 0x070c58d8720b18A5763c1e24FE30d6AA77F86810
for verification on the block explorer. Waiting for verification result...
We tried verifying your contract VaultFactory without including any unrelated one, but it failed.
Trying again with the full solc input used to compile and deploy it.
This means that unrelated contracts may be displayed on Etherscan...
Successfully submitted source code for contract
contracts/vault/VaultFactory.sol:VaultFactory at 0x070c58d8720b18A5763c1e24FE30d6AA77F86810
for verification on the block explorer. Waiting for verification result...
NomicLabsHardhatPluginError: The contract verification failed.
Reason: Fail - Unable to verify
at SimpleTaskDefinition.verifySubtask [as action] (/Users/node_modules/@nomiclabs/hardhat-etherscan/src/index.ts:332:9)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
I have tried all the suggestions here:
How to verify a contract on Etherscan/BscScan/PolygonScan
Environment
"@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-etherscan": "^3.0.4",
pragma solidity ^0.8.11;
Would appreciate any insight to get this resolved!