{
 "x402Version": 2,
 "name": "autonomous-audit",
 "description": "Pay-per-call Solidity smart-contract security audits on Base USDC. No account, no API key: the endpoint answers 402 with paymentRequirements and settles through the PayAI facilitator.",
 "payTo": "0x9a033397FfD48Bb186c2A7B77Ba550B26EE90c35",
 "network": "eip155:8453",
 "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
 "resources": [
  {
   "resource": "https://audit-402.agras-recovery.workers.dev/api/audit/surface",
   "type": "http",
   "x402Version": 2,
   "method": "POST",
   "name": "Static surface scan of one Solidity contract",
   "description": "Static surface scan of one Solidity contract: exposed state-changing functions, access-control modifiers, external calls, upgradeability, and a machine-readable risk list. Returns JSON.",
   "mimeType": "application/json",
   "tags": [
    "smart-contract",
    "audit",
    "solidity",
    "security"
   ],
   "accepts": [
    {
     "scheme": "exact",
     "network": "eip155:8453",
     "amount": "1000000",
     "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
     "payTo": "0x9a033397FfD48Bb186c2A7B77Ba550B26EE90c35",
     "maxTimeoutSeconds": 300,
     "extra": {
      "name": "USD Coin",
      "version": "2"
     }
    }
   ],
   "extensions": {
    "bazaar": {
     "info": {
      "input": {
       "type": "http",
       "method": "POST",
       "bodyType": "json",
       "body": {
        "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\ncontract Vault {\n  address owner;\n  mapping(address => uint256) bal;\n  constructor() { owner = msg.sender; }\n  function withdraw(uint256 a) external {\n    (bool ok, ) = msg.sender.call{value: a}(\"\");\n    require(ok);\n  }\n}"
       }
      },
      "output": {
       "type": "json",
       "example": {
        "ok": true,
        "score": 64,
        "findings": [
         {
          "id": "SC-05",
          "sev": "medium",
          "msg": "external call without reentrancy guard"
         }
        ],
        "stats": {
         "functions": 1,
         "externally_callable": 1,
         "access_control": "absent",
         "has_reentrancy_guard": false
        }
       }
      }
     },
     "schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "input": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "const": "http"
         },
         "method": {
          "type": "string",
          "enum": [
           "POST"
          ]
         },
         "bodyType": {
          "type": "string",
          "enum": [
           "json"
          ]
         },
         "body": {
          "type": "object",
          "properties": {
           "source": {
            "type": "string",
            "description": "Full Solidity source text of the single contract to audit."
           }
          },
          "required": [
           "source"
          ],
          "additionalProperties": false
         }
        },
        "required": [
         "type",
         "method",
         "bodyType",
         "body"
        ],
        "additionalProperties": false
       },
       "output": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string"
         },
         "example": {
          "type": "object"
         }
        },
        "required": [
         "type"
        ]
       }
      },
      "required": [
       "input"
      ]
     }
    }
   }
  },
  {
   "resource": "https://audit-402.agras-recovery.workers.dev/api/audit/full",
   "type": "http",
   "x402Version": 2,
   "method": "POST",
   "name": "Full automated audit of one Solidity contract",
   "description": "Full automated audit of one Solidity contract: surface scan plus reentrancy / access-control / arithmetic / oracle patterns, severity ranking, and a patch suggestion per finding. Returns JSON.",
   "mimeType": "application/json",
   "tags": [
    "smart-contract",
    "audit",
    "solidity",
    "security",
    "reentrancy"
   ],
   "accepts": [
    {
     "scheme": "exact",
     "network": "eip155:8453",
     "amount": "3000000",
     "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
     "payTo": "0x9a033397FfD48Bb186c2A7B77Ba550B26EE90c35",
     "maxTimeoutSeconds": 300,
     "extra": {
      "name": "USD Coin",
      "version": "2"
     }
    }
   ],
   "extensions": {
    "bazaar": {
     "info": {
      "input": {
       "type": "http",
       "method": "POST",
       "bodyType": "json",
       "body": {
        "source": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\ncontract Vault {\n  address owner;\n  mapping(address => uint256) bal;\n  constructor() { owner = msg.sender; }\n  function withdraw(uint256 a) external {\n    (bool ok, ) = msg.sender.call{value: a}(\"\");\n    require(ok);\n  }\n}"
       }
      },
      "output": {
       "type": "json",
       "example": {
        "ok": true,
        "score": 64,
        "findings": [
         {
          "id": "SC-05",
          "sev": "medium",
          "msg": "external call without reentrancy guard"
         }
        ],
        "stats": {
         "functions": 1,
         "externally_callable": 1,
         "access_control": "absent",
         "has_reentrancy_guard": false
        }
       }
      }
     },
     "schema": {
      "$schema": "https://json-schema.org/draft/2020-12/schema",
      "type": "object",
      "properties": {
       "input": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string",
          "const": "http"
         },
         "method": {
          "type": "string",
          "enum": [
           "POST"
          ]
         },
         "bodyType": {
          "type": "string",
          "enum": [
           "json"
          ]
         },
         "body": {
          "type": "object",
          "properties": {
           "source": {
            "type": "string",
            "description": "Full Solidity source text of the single contract to audit."
           }
          },
          "required": [
           "source"
          ],
          "additionalProperties": false
         }
        },
        "required": [
         "type",
         "method",
         "bodyType",
         "body"
        ],
        "additionalProperties": false
       },
       "output": {
        "type": "object",
        "properties": {
         "type": {
          "type": "string"
         },
         "example": {
          "type": "object"
         }
        },
        "required": [
         "type"
        ]
       }
      },
      "required": [
       "input"
      ]
     }
    }
   }
  }
 ]
}