Skip to content

[SDK] checkVerificationStatus sends the API key with a trailing double quote #9049

Closed as not planned

Description

@aelmanaa

checkVerificationStatus sends the explorer API key with a trailing double quote. The request URL template ends with " after the key (index.ts#L212):

const endpoint = `${options.explorerApiUrl}?module=contract&action=checkverifystatus&guid=${options.guid}&apikey=${options.explorerApiKey}"`;

Reproduce it

  1. Call checkVerificationStatus({ explorerApiUrl, explorerApiKey: "TEST_API_KEY", guid }) against a server that logs the query string. The server receives apikey=TEST_API_KEY%22, and searchParams.get("apikey") returns TEST_API_KEY".
  2. The linked PR adds this as a Vitest test with MSW. It fails on main at 940b374 with expected 'TEST_API_KEY"' to be 'TEST_API_KEY'.

Impact

Low today. I checked two explorers by hand on 2026-11-02:

  • Etherscan v2 accepts a valid key with " appended (getabi returns status: "1"), and rejects an invalid key with Invalid API Key (#err2).
  • Blockscout does not check apikey on checkverifystatus.

An explorer that compares the key exactly would fail every status check.

Fix

Drop the trailing ". PR to follow.

Activity

  1. linear commented on Nov 2, 2026

    @linear
  2. github-actions commented on Nov 10, 2026

    @github-actions
    Contributor

    This issue has been inactive for 7 days. It is now marked as stale and will be closed in 2 days if no further activity occurs.

  3. aelmanaa commented on Nov 13, 2026

    @aelmanaa
    Author

    Could a maintainer reopen this issue and #9050? The stale bot closed both, but the bug is still there: checkVerificationStatus sends the API key with a trailing ", so status checks fail for anyone verifying a contract through the SDK. It's tracked internally as BLD-580. #9050 is a one-line fix with a changeset, and I'm happy to rebase it or change it if you'd like a different approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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