I am trying to verify a deployed smart contract on etherscan (goerli testnet) using the command:
npx hardhat verify --contract contracts/Contract.sol:Contract --constructor-args scripts/arguments.js --network goerli DEPLOYED_CONTRACT_ADDRESS
But I am getting this result:
Nothing to compile
Successfully submitted source code for contract contracts/Contract.sol:Contract at DEPLOYED_CONTRACT_ADDRESS for verification on the block explorer. Waiting for verification result...
We tried verifying your contract Stock 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/Contract.sol:Contract at DEPLOYED_CONTRACT_ADDRESS for verification on the block explorer. Waiting for verification result...
Error in plugin @nomiclabs/hardhat-etherscan: The contract verification failed. Reason: Fail - Unable to verify
I managed to verify a contract with one constructor argument, and that was pretty straightforward. However, for this one that has multiple arguments, I had to first create a module that's shown in the command above (arguments.js) that exports all the constructor arguments that were passed to the contract during deployment according to the instructions in the hardhat docs ( https://hardhat.org/hardhat-runner/plugins/nomiclabs-hardhat-etherscan ), but for some reason this is failing. Woulg highly appreciate anyone's assistance.