Contract Verification API

API for contract verification

Base URL

https://{explorer endpoint}/api

Endpoints

Verify Contract

Etherscan style API for verifying contract source code.

POST /api

Request Parameters

ParameterTypeDescription
modulestringThe API module. Must be set to "contract".
actionstringThe API action. Must be set to "verifysourcecode".
contractaddressstringThe address of the contract to verify.
sourceCodestringThe source code of the contract.
codeformatstringThe format of the source code. Must be set to "solidity-standard-json-input".
contractnamestringThe name of the contract.
compilerversionstringThe version of the Solidity compiler used to compile the contract.
constructorArguementsstringThe arguments passed to the contract constructor.

Response Parameters

ParameterTypeDescription
messagestringA message indicating the result of the verification.
resultstringThe result of the verification.
statusstringThe status of the verification. "1" indicates success, "0" indicates failure.

Example Request

POST /api HTTP/1.1
Host: localhost:3000
Content-Type: application/json

{
    "module": "contract",
    "action": "verifysourcecode",
    "contractaddress": "0x1234567890123456789012345678901234567890",
    "sourceCode": "contract MyContract { ... }",
    "codeformat": "solidity-standard-json-input",
    "contractname": "MyContract",
    "compilerversion": "v0.8.0",
    "constructorArguements": "arg1,arg2,arg3"
}

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "message": "OK",
    "result": "Contract source code has been verified",
    "status": "1"
}

Check Verification Status

Etherscan style API for checking the status of contract verification.

GET /api

Request Parameters

ParameterTypeDescription
modulestringThe API module. Must be set to "contract".
actionstringThe API action. Must be set to "checkverifystatus".
guidstringThe GUID of the verification request.

Response Parameters

ParameterTypeDescription
messagestringA message indicating the result of the verification.
resultstringThe result of the verification.
statusstringThe status of the verification. "1" indicates success, "0" indicates failure.

Example Request

GET /api?module=contract&action=checkverifystatus&guid=1234567890 HTTP/1.1
Host: localhost:3000

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
    "message": "OK",
    "result": "Contract source code has been verified",
    "status": "1"
}