{
  "openapi": "3.1.0",
  "info": {
    "title": "Verify Solidity Source Code",
    "version": "2.0.0",
    "description": "Submit a Solidity source code for verification.",
    "license": {
      "name": "Etherscan API Terms",
      "url": "https://etherscan.io/terms"
    }
  },
  "servers": [
    {
      "url": "https://api.etherscan.io",
      "description": "Etherscan API."
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "paths": {
    "/v2/api": {
      "post": {
        "operationId": "postVerifysourcecode",
        "summary": "Verify Solidity Source Code",
        "description": "Submit a Solidity source code for verification.",
        "parameters": [
          {
            "name": "chainid",
            "in": "query",
            "required": true,
            "description": "Chain ID to query, eg 1 for Ethereum, 8453 for Base from our supported chains.",
            "schema": {
              "type": "string"
            },
            "example": "1"
          },
          {
            "name": "module",
            "in": "query",
            "required": true,
            "description": "Set to contract for this endpoint.",
            "schema": {
              "type": "string",
              "default": "contract"
            },
            "example": "contract"
          },
          {
            "name": "action",
            "in": "query",
            "required": true,
            "description": "Set to verifysourcecode for this endpoint.",
            "schema": {
              "type": "string",
              "default": "verifysourcecode"
            },
            "example": "verifysourcecode"
          }
        ],
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-mint": {
          "metadata": {
            "title": "Verify Solidity Source Code",
            "description": "Submit a Solidity source code for verification."
          }
        },
        "x-etherscan-source-page": {
          "page": "api-reference/endpoint/verifysourcecode",
          "title": "Verify Solidity Source Code",
          "module": "contract",
          "action": "verifysourcecode"
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "type": "object",
                "properties": {
                  "contractaddress": {
                    "type": "string",
                    "examples": [
                      "0xBB9bc244D798123fDe783fCc1C72d3Bb8C189413"
                    ],
                    "description": "The address where the contract is deployed."
                  },
                  "sourceCode": {
                    "type": "string",
                    "description": "The Solidity source code to verify."
                  },
                  "codeformat": {
                    "type": "string",
                    "examples": [
                      "solidity-standard-json-input"
                    ],
                    "description": "Use `solidity-single-file` for a single file or `solidity-standard-json-input` for JSON input."
                  },
                  "contractname": {
                    "type": "string",
                    "examples": [
                      "contracts/Verified.sol:Verified"
                    ],
                    "description": "The contract name, including path if applicable. If `codeformat=solidity-standard-json-input`, then enter contractname as `erc20.sol:erc20`."
                  },
                  "compilerversion": {
                    "type": "string",
                    "examples": [
                      "v0.8.24+commit.e11b9ed9"
                    ],
                    "description": "Compiler version used for compilation."
                  },
                  "optimizationUsed": {
                    "type": "string",
                    "examples": [
                      "0"
                    ],
                    "description": "Required for solidity-single-file verification and when codeformat is omitted or unrecognized. Not required for solidity-standard-json-input."
                  },
                  "runs": {
                    "type": "string",
                    "examples": [
                      "200"
                    ],
                    "description": "Number of optimization runs."
                  },
                  "constructorArguments": {
                    "type": "string",
                    "examples": [
                      "00000000000000000000000074271f2282ed7ee35c166122a60c9830354be42a"
                    ],
                    "description": "Optional constructor arguments used in contract deployment."
                  },
                  "evmVersion": {
                    "type": "string",
                    "examples": [
                      "default"
                    ],
                    "description": "Use compiler `default` or specify an EVM version such as `byzantium`, `shanghai`."
                  },
                  "licenseType": {
                    "type": "string",
                    "examples": [
                      "1"
                    ],
                    "description": "The [open source license](https://etherscan.io/contract-license-types) to associate with the verified source code, e.g `3` for MIT."
                  }
                },
                "required": [
                  "contractaddress",
                  "sourceCode",
                  "contractname",
                  "compilerversion"
                ]
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "query",
        "name": "apikey",
        "description": "Your Etherscan API key."
      }
    }
  }
}