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

# Contract Addresses

> Comprehensive reference of all CoW Protocol smart contract addresses across supported networks

export const InlineResource = ({value, copyValue, href, chain, explorerHref, explorerType = "address", explorerSuffix = "", showCopy = true, showExplorer = false, openInNewTab}) => {
  const explorerBases = {
    arbitrum: "https://arbiscan.io",
    arbitrum_one: "https://arbiscan.io",
    avalanche: "https://snowscan.xyz",
    base: "https://basescan.org",
    bnb: "https://bscscan.com",
    ethereum: "https://etherscan.io",
    gnosis: "https://gnosisscan.io",
    ink: "https://explorer.inkonchain.com",
    linea: "https://lineascan.build",
    mainnet: "https://etherscan.io",
    optimism: "https://optimistic.etherscan.io",
    plasma: "https://plasmascan.to",
    polygon: "https://polygonscan.com",
    sepolia: "https://sepolia.etherscan.io",
    xdai: "https://gnosisscan.io"
  };
  const isExternalUrl = (candidate = "") => (/^https?:\/\//i).test(candidate);
  const isHexAddress = (candidate = "") => (/^0x[a-fA-F0-9]{40}$/).test(candidate);
  const normalizeUrl = (candidate = "") => {
    if (!candidate) {
      return "";
    }
    if (candidate.startsWith("/") || candidate.startsWith("#") || isExternalUrl(candidate)) {
      return candidate;
    }
    return `https://${candidate}`;
  };
  const compactUrl = (candidate = "") => {
    const withoutProtocol = candidate.replace(/^https?:\/\//i, "");
    if (withoutProtocol.length <= 40) {
      return withoutProtocol;
    }
    const [host, ...segments] = withoutProtocol.split("/");
    if (!segments.length) {
      return `${withoutProtocol.slice(0, 20)}...${withoutProtocol.slice(-12)}`;
    }
    const tail = segments.length >= 2 ? `${segments[segments.length - 2]}/${segments[segments.length - 1]}` : segments[segments.length - 1];
    return `${host}/.../${tail}`;
  };
  const resolvedExplorerHref = (() => {
    if (explorerHref) {
      return explorerHref;
    }
    if (!chain || !value) {
      return "";
    }
    const base = explorerBases[chain];
    if (!base) {
      return "";
    }
    return `${base}/${explorerType}/${value}${explorerSuffix}`;
  })();
  const resolvedHref = normalizeUrl(href || "");
  const primaryHref = resolvedHref || (showExplorer ? resolvedExplorerHref : "");
  const primaryTarget = openInNewTab ?? (primaryHref ? isExternalUrl(primaryHref) : false);
  const shouldCompactValue = isExternalUrl(value || "") || isExternalUrl(primaryHref);
  const displayValue = shouldCompactValue ? compactUrl(value) : value;
  const contentClassName = ["inline-resource__value", shouldCompactValue ? "inline-resource__value--compact" : "", isHexAddress(value || "") ? "inline-resource__value--address" : ""].filter(Boolean).join(" ");
  const setButtonState = (button, state, label) => {
    if (!button) {
      return;
    }
    button.dataset.state = state;
    button.setAttribute("aria-label", label);
    button.title = label;
    if (button.__copyTimer) {
      window.clearTimeout(button.__copyTimer);
      button.__copyTimer = null;
    }
    if (state === "idle") {
      return;
    }
    button.__copyTimer = window.setTimeout(() => {
      button.dataset.state = "idle";
      button.setAttribute("aria-label", "Copy value");
      button.title = "Copy value";
    }, 1200);
  };
  const fallbackCopy = text => {
    if (typeof document === "undefined") {
      return false;
    }
    const input = document.createElement("textarea");
    input.value = text;
    input.setAttribute("readonly", "");
    input.style.left = "-9999px";
    input.style.position = "absolute";
    document.body.appendChild(input);
    input.select();
    let copied = false;
    try {
      copied = document.execCommand("copy");
    } catch {
      copied = false;
    }
    document.body.removeChild(input);
    return copied;
  };
  const copyText = async (text, button) => {
    if (!text) {
      setButtonState(button, "copied", "Nothing to copy");
      return;
    }
    try {
      if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
        await navigator.clipboard.writeText(text);
        setButtonState(button, "copied", "Copied");
        return;
      }
    } catch {}
    const copied = fallbackCopy(text);
    setButtonState(button, copied ? "copied" : "idle", copied ? "Copied" : "Copy failed");
  };
  const content = <code className={contentClassName} title={value}>
      {displayValue}
    </code>;
  return <span className="inline-resource">
      {primaryHref ? <a className="inline-resource__link" href={primaryHref} rel={primaryTarget ? "noreferrer noopener" : undefined} target={primaryTarget ? "_blank" : undefined} title={value}>
          {content}
        </a> : content}

      {showCopy || showExplorer && resolvedExplorerHref && resolvedExplorerHref !== primaryHref ? <span className="inline-resource__actions">
          {showCopy ? <button aria-label="Copy value" className="inline-resource__action" data-state="idle" onClick={event => copyText(copyValue || value, event.currentTarget)} title="Copy value" type="button">
              <span className="inline-resource__icon inline-resource__icon--copy">
                <CopyIcon />
              </span>
              <span className="inline-resource__icon inline-resource__icon--check">
                <CheckIcon />
              </span>
            </button> : null}

          {showExplorer && resolvedExplorerHref && resolvedExplorerHref !== primaryHref ? <a aria-label="Open in explorer" className="inline-resource__action" href={resolvedExplorerHref} rel="noreferrer noopener" target="_blank" title="Open in explorer">
              <span className="inline-resource__icon">
                <ExternalLinkIcon />
              </span>
            </a> : null}
        </span> : null}
    </span>;
};

# Contract Addresses

All CoW Protocol smart contract addresses deployed across supported networks.

## Core Contracts

All core contracts are deployed at identical addresses across all supported networks using CREATE2 deterministic deployment.

* `GPv2Settlement`: <InlineResource value="0x9008D19f58AAbD9eD0D60971565AA8510560ab41" chain="ethereum" showExplorer />
* `GPv2VaultRelayer`: <InlineResource value="0xC92E8bdf79f0507f65a392b0ab4667716BFE0110" chain="ethereum" showExplorer />
* `GPv2AllowListAuthentication (Proxy)`: <InlineResource value="0x2c4c28DDBdAc9C5E7055b4C863b72eA0149D8aFE" chain="ethereum" showExplorer />

The GPv2AllowListAuthentication implementation is at `0x9E7Ae8Bdba9AA346739792d219a808884996Db67`.

## Supported Networks

CoW Protocol is deployed on the following networks:

| Network           | Chain ID | Type      |
| ----------------- | -------- | --------- |
| Ethereum          | 1        | Mainnet   |
| Gnosis Chain      | 100      | Mainnet   |
| Arbitrum One      | 42161    | Layer 2   |
| Base              | 8453     | Layer 2   |
| Polygon           | 137      | Sidechain |
| Avalanche C-Chain | 43114    | Sidechain |
| BNB Smart Chain   | 56       | Sidechain |
| Optimism          | 10       | Layer 2   |
| Linea             | 59144    | Layer 2   |
| Plasma            | 9745     | Layer 2   |
| Ink               | 57073    | Layer 2   |
| Sepolia           | 11155111 | Testnet   |

## Deprecated Networks

| Network | Status                                            |
| ------- | ------------------------------------------------- |
| Rinkeby | Deprecated - not recommended for new integrations |
| Goerli  | Deprecated - not recommended for new integrations |

## Integration Example

```typescript theme={null}
import { domain } from "@cowprotocol/contracts";

// Ethereum Mainnet
const mainnetDomain = domain(1, "0x9008D19f58AAbD9eD0D60971565AA8510560ab41");

// Gnosis Chain
const gnosisDomain = domain(100, "0x9008D19f58AAbD9eD0D60971565AA8510560ab41");

// Arbitrum One
const arbitrumDomain = domain(42161, "0x9008D19f58AAbD9eD0D60971565AA8510560ab41");
```

## Best Practices

* Store addresses in configuration files rather than hardcoding them
* Use environment variables for different networks
* Validate addresses before executing transactions
* Always verify contract addresses through official channels before integrating
