Skip to content
This repository was archived by the owner on Jul 1, 2022. It is now read-only.
This repository was archived by the owner on Jul 1, 2022. It is now read-only.

Query for end result of contract verification #4

@TimDaub

Description

@TimDaub

Even though an upload might be successful, a verification might not. Etherscan will return

{ status: '1',
  message: 'OK',
  result: 'xnzcdbmv4i1ibmnryn5x1mh5vzn2jji4t9bkfvxjbtca92wyid' }

But the contract doesn't get verified. We should query for successful verification. There's a jquery snippet for this here: https://etherscan.io/apis#contracts

//Check Source Code Verification Status
    $.ajax({
        type: "GET",
        url: "//api.etherscan.io/api",
        data: {
            guid: 'ezq878u486pzijkvvmerl6a9mzwhv6sefgvqi5tkwceejc7tvn', //Replace with your Source Code GUID receipt above
            module: "contract",
            action: "checkverifystatus"
        },
        success: function (result) {
            console.log("status : " + result.status);   //0=Error, 1=Pass 
            console.log("message : " + result.message); //OK, NOTOK
            console.log("result : " + result.result);   //result explanation
            $('#guidstatus').html(">> " + result.result);
        },
        error: function (result) {
            alert('error');
        }
    });
                                

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions