> ## Documentation Index
> Fetch the complete documentation index at: https://goldrush.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Enhanced Spam Lists

> A public, open-source npm package that provides enhanced spam lists for ERC20 tokens and NFTs.

The GoldRush Enhanced Spam Lists are a public good designed to restore trust and transparency in the Web3 ecosystem by helping developers, explorers, wallets, and indexers protect their users from scam tokens and malicious contracts.

The Enhanced Spam Lists can be accessed as an [npm package](https://www.npmjs.com/package/@covalenthq/goldrush-enhanced-spam-lists).

<Note>
  This package requires Node.js v18 or above.
</Note>

### Step 1. Install the Package

You can install the package using npm, yarn or pnpm:

<CodeGroup>
  ```shell npm theme={null}
  npm install @covalenthq/goldrush-enhanced-spam-lists
  ```

  ```shell yarn theme={null}
  yarn add @covalenthq/goldrush-enhanced-spam-lists
  ```

  ```shell pnpm theme={null}
  pnpm add @covalenthq/goldrush-enhanced-spam-lists
  ```
</CodeGroup>

### Step 2. Use Cases

<Steps>
  <Step title="Verify if an ERC20 token is spam on a given network">
    ```javascript theme={null}
    import {
        Networks,
        isERC20Spam,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    // With default options
    const isSpam = await isERC20Spam("0xTokenAddress", Networks.ETHEREUM_MAINNET);
    console.log(isSpam);
    ```
  </Step>

  <Step title="For a potential spam check for an ERC20 token, Confidence.MAYBE can be used">
    ```javascript theme={null}
    import {
        Confidence,
        Networks,
        isERC20Spam,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    const isPotentialSpam = await isERC20Spam(
        "0xTokenAddress",
        Networks.POLYGON_MAINNET,
        Confidence.MAYBE
    );
    console.log(isPotentialSpam);
    ```
  </Step>

  <Step title="Verify if an NFT token is spam on a given network">
    ```javascript theme={null}
    import {
            Networks,
            isNFTSpam,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    const isNftSpam = await isNFTSpam("0xNftAddress", Networks.BSC_MAINNET);
    console.log(isNftSpam);
    ```
  </Step>

  <Step title="Control caching behavior">
    ```javascript theme={null}
    import {
        Networks,
        Confidence,
        isERC20Spam,
        clearCache,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    // With caching enabled (default)
    const withCache = await isERC20Spam(
        "0xTokenAddress",
        Networks.ETHEREUM_MAINNET,
        Confidence.YES,
        true // Enable caching (default)
    );

    // Without caching (always fetches fresh data)
    const withoutCache = await isERC20Spam(
        "0xTokenAddress",
        Networks.ETHEREUM_MAINNET,
        Confidence.YES,
        false // Disable caching
    );

    // Clear memory and disk cache if needed
    clearCache();
    ```
  </Step>

  <Step title="For more control, you can get the full lists:">
    ```javascript theme={null}
    import {
        getERC20List,
        getNFTList,
        Confidence,
        Networks,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    // Get ERC20 spam list with default caching
    const ethSpamTokens = await getERC20List(Networks.ETHEREUM_MAINNET, Confidence.YES);

    // Get NFT spam list with caching disabled
    const bscSpamNfts = await getNFTList(Networks.BSC_MAINNET, false);
    ```
  </Step>

  <Step title="Get the specific spam score for a given contract">
    ```javascript theme={null}
    import {
        getERC20List,
        getSpamScore,
        Networks,
        Confidence,
    } from "@covalenthq/goldrush-enhanced-spam-lists";

    const ethSpamTokens = await getERC20List(
    Networks.ETHEREUM_MAINNET,
    Confidence.YES
    );
    const score = getSpamScore(ethSpamTokens[0]);
    console.log(score); // Returns the spam score as a string
    ```
  </Step>
</Steps>
