GET - /api/audit/<network>/<contract>

This API endpoint performs an audit of a specified token contract on a supported blockchain. It identifies potential vulnerabilities and provides metadata on the token.

Request

  • URL: /api/audit/<network/<contract>

  • Method: GET

  • Content-Type: application/json

Body

None

Response

Success Response (200 OK)

{
    audit: {
        contract: string;
        chain: SupportedChain;
        open_source: boolean;
        contract_type: ContractType;
        creator?: string;
        hash?: string;
        safe: boolean;
        description?: string;
        vulnerabilities?: Vulnerability[];
        name?: string;
        symbol?: string;
        total_supply?: number;
        logo?: string;
        tokenDescription?: string;
        holders?: TokenHolder[];
    }
}

Error Response

{
    "error": "Description of the error"
}

Examples

const audit = await fetch('https://audit.serializedlabs.com/api/audit/${chain}/${contract}', {
    headers: {
        'Content-Type': 'application/json'
    }
});

Additional types

enum SupportedChain {
    ETH = "ETH",
    OP = "OP",
    ARB = "ARB",
    BASE = "BASE",
    BSC = "BSC",
    AVAX = "AVAX",
    APE = "APE",
    BLAST = "BLAST",
    LINEA = "LINEA",
    MANTLE = "MANTLE",
    POLYGON = "POLYGON",
    ZKEVM = "ZKEVM",
    SCROLL = "SCROLL",
    SONIC = "SONIC",
    ZKSYNC = "ZKSYNC",
}
type ContractType = 'ERC-20' | 'ERC-721' | 'Unknown';
interface Vulnerability {
    description: string;
    severity: number; // Score between 0 and 100
    code: string;
    type: VulnerabilityType;
}
export type VulnerabilityType =
    | "UnlimitedTokenMinting"
    | "UnauthorizedTokenTransfer"
    | "BalanceManipulation"
    | "TransferFreeze"
    | "HiddenFees"
    | "AddressRestriction"
    | "UnauthorizedTokenBurn"
    | "ContractSelfDestruct"
    | "ApprovalExploitation"
    | "UnauthorizedOwnershipChange"
    | "NonStandardERC20"
    | "FalseFeedback"
    | "WeakAccessControl"
    | "MaliciousContractUpgrade"
    | "TotalFreeze"
    | "LiquidityDrain"
    | "Impersonation"
    | "ObfuscatedVariables"
    | "UnsafeExternalCalls"
    | "MaliciousAirdrop"
    | "OverPrivilegedOwner"
    | "StealthSelfDestruct"
    | "TxOrderingControl"
    | "IntentionalReentrancy"
    | "GasLimitDenial";

Last updated