Skip to content

Can not verify deployed contract #852

@piavgh

Description

@piavgh

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.1.0 (2ff2b33 2022-03-06T00:10:54.403068+00:00)

What command(s) is the bug in?

forge verify-contract

Operating System

macOS (amd)

Describe the bug

The code of contract is here: https://github.com/piavgh/simple-ens-foundry

I deployed the contract using this command:

forge create --rpc-url https://eth-ropsten.alchemyapi.io/v2/<alchemy-key> --constructor-args "geek" --private-key <my-private-key> src/Domains.sol:Domains

Then I verified it with

forge verify-contract --chain-id 3 --num-of-optimizations 200 --constructor-args 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046765656b00000000000000000000000000000000000000000000000000000000 --compiler-version v0.8.10+commit.fc410830 0x19f4cd4bc239b8c32f264bf13efbe31a0fc4194d src/Domains.sol:Domains <my-etherscan-api-key>

I tried with different values of --num-of-optimizations: 0, 200 (default), 1000000, and even skip this argument, but all of them give the same value when I tried the forge verify-check:

Error:
   0: Contract verification failed:
      Response: `NOTOK`
      Details: `Fail - Unable to verify`

Location:
   cli/src/cmd/verify.rs:126

Backtrace omitted.
Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions