You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, if ContractVerificationMissingBytecodeError error has been thrown, hardhat outputs:
An unexpected error occurred during the verification process.
Please report this issue to the Hardhat team.
Error Details: Failed to send contract verification request.
Endpoint URL: https://api-hardhat.etherscan.io/api
Reason: The Etherscan API responded that the address 0x5FbDB2315678afecb367f032d93F642f64180aa3 does not have bytecode.
This can happen if the contract was recently deployed and this fact hasn't propagated to the backend yet.
Try waiting for a minute before verifying your contract. If you are invoking this from a script,
try to wait for five confirmations of your contract deployment transaction before running the verification subtask.
But I believe they are actually expected and should be caught in those lines.
Solution
That happens because those errors are inherited from classes which have setPrototypeOf methods in their constructors. E.g.,
. If all such assignments removed, those errors are caught successfully.
I don't know why those assignments have been added, though, and whether removing them will have no undesired effects
The same considerations apply to ContractStatusPollingInvalidStatusCodeError and ContractStatusPollingResponseNotOkError in those lines. The corresponding test case.
Minimal reproduction steps
To reproduce, for ContractVerificationMissingBytecodeError you may update the regexp in this test case (e.g., "someprefixThe Etherscan API responded that the address ..."), so you can get the actual error message hardhat returns
Search terms
No response
The text was updated successfully, but these errors were encountered:
Version of Hardhat
2.22.3
What happened?
Hardhat outputs
for
ContractVerificationInvalidStatusCodeError
andContractVerificationMissingBytecodeError
errors.For example, if
ContractVerificationMissingBytecodeError
error has been thrown, hardhat outputs:But I believe they are actually expected and should be caught in those lines.
Solution
That happens because those errors are inherited from classes which have
setPrototypeOf
methods in their constructors. E.g.,hardhat/packages/hardhat-core/src/internal/core/errors.ts
Line 181 in 3573f69
I don't know why those assignments have been added, though, and whether removing them will have no undesired effects
The same considerations apply to
ContractStatusPollingInvalidStatusCodeError
andContractStatusPollingResponseNotOkError
in those lines. The corresponding test case.Minimal reproduction steps
To reproduce, for
ContractVerificationMissingBytecodeError
you may update the regexp in this test case (e.g., "someprefixThe Etherscan API responded that the address ..."), so you can get the actual error message hardhat returnsSearch terms
No response
The text was updated successfully, but these errors were encountered: