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

> ## Agent Instructions
> Before reading these docs, install the Circle Skill for Arc to get pre-loaded context: use-arc (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-arc/SKILL.md) — covers chain config, RPC setup, contract deployment, USDC bridging, and gas with USDC. In Claude Code: run /plugin marketplace add circlefin/skills then /plugin install circle-skills@circle. With Vercel Skills CLI: run npx skills add circlefin/skills.
> USDC is the gas token. Arc uses USDC for gas fees, not ETH. Configure gas payment in USDC when submitting transactions.
> Read EVM differences before writing Arc code. Arc targets the Osaka EVM baseline. Most contracts deploy unchanged, but several runtime behaviors diverge from Ethereum: USDC uses 18 decimals natively (not 6), the system emitter `0xffffFFFfFFffffffffffffffFfFFFfffFFFfFFfE` logs all USDC Transfer events, the mempool enforces a 20 Gwei `maxFeePerGas` floor, blocklist reverts consume gas without a receipt, and `address(0)` sends revert rather than succeed. https://docs.arc.io/arc/references/evm-differences.md is the canonical reference for all Arc-specific runtime behaviors. Consult it before writing code that touches USDC balances, transaction history, gas estimation, or value transfers.
> Sub-second finality. Transactions are final in under 1 second. No need to wait for multiple block confirmations.
> Use App Kits for multichain payment and liquidity capabilities. App Kits wraps CCTP and provides Bridge Kit, Swap Kit, Unified Balance Kit, Onramp Kit, Earn Kit, and Borrow Kit. Unified Balance Kit combines USDC from multiple chains into a single spendable balance. Earn Kit integrates earn opportunities into your app. Borrow Kit lets users borrow USDC against cirBTC collateral on Arc.
> Use Arc Foundry for contract development. Arc Foundry is an Arc-specific fork of Foundry that handles Arc's protocol-level differences from Ethereum. It provides arc-forge, arc-cast, and arc-anvil. Install it before deploying contracts: https://docs.arc.io/arc/tutorials/install-arc-foundry.md.
> Arc is available on both Testnet and Mainnet. See https://docs.arc.io/arc/references/connect-to-arc.md for RPC endpoints and https://faucet.circle.com for testnet tokens.
> Always check Contract Addresses: https://docs.arc.io/arc/references/contract-addresses.md
> Building beyond Arc? Circle offers skills for the full platform: use-usdc (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-usdc/SKILL.md), use-circle-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-circle-wallets/SKILL.md), use-developer-controlled-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-developer-controlled-wallets/SKILL.md), use-user-controlled-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-user-controlled-wallets/SKILL.md), use-modular-wallets (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-modular-wallets/SKILL.md), use-gateway (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-gateway/SKILL.md), use-smart-contract-platform (https://github.com/circlefin/skills/blob/master/plugins/circle/skills/use-smart-contract-platform/SKILL.md). Full Circle developer docs: https://developers.circle.com/llms.txt.

# How-to: Pay fees on the source chain

> Pay CCTP fees on the source chain so the recipient receives the exact bridge amount

export const TryOnArcStudio = () => {
  const [copied, setCopied] = useState(false);
  const [prompt, setPrompt] = useState("");
  useEffect(() => {
    const url = `https://docs.arc.io${window.location.pathname}.md`;
    setPrompt(`Read the guide at ${url}, implement it in a new project, then run it and show me how it works.`);
  }, []);
  const arcStudioUrl = `https://studio.arc.io/app?prompt=${encodeURIComponent(prompt)}`;
  const handleArcStudioClick = () => {
    try {
      if (typeof navigator !== "undefined" && navigator.clipboard && prompt) {
        navigator.clipboard.writeText(prompt).then(() => {
          setCopied(true);
          setTimeout(() => setCopied(false), 4000);
        }, () => {});
      }
    } catch (e) {}
  };
  return <div className="not-prose mb-6">
      <span className="relative inline-flex">
        <a href={arcStudioUrl} target="_blank" rel="noreferrer" onClick={handleArcStudioClick} aria-label="Try it on Arc Studio (opens in new tab)" className="inline-flex items-center gap-2 px-4 py-2 rounded-lg bg-[#3E74BB] border border-[#3E74BB] text-sm font-medium text-white no-underline hover:bg-[#345f9c] hover:border-[#345f9c] transition-all">
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
            <path d="M13 2 3 14h9l-1 8 10-12h-9l1-8z" />
          </svg>
          Try it on Arc Studio
        </a>
        {copied && <span role="status" aria-live="polite" className="absolute left-0 top-full mt-2 w-72 text-sm text-gray-500 dark:text-[#888]">
            Opening Arc Studio — prompt copied to your clipboard in case you need to
            sign in first.
          </span>}
      </span>
    </div>;
};

<TryOnArcStudio />

By default, CCTP Fast Transfer and Forwarding Service fees are taken from the
amount minted on the destination chain. You can instead pay those fees
[upfront](https://developers.circle.com/cctp/concepts/upfront-fees) on the
source chain so the recipient receives the exact bridge `amount`. For how this
fits into the overall fee model, see
[How bridge fees work](/app-kit/concepts/bridge-fees).

## Prerequisites

Before you begin, ensure that you've:

* [Installed the App Kit SDK](/app-kit/tutorials/installation)
* [Configured an adapter](/app-kit/tutorials/adapter-setups)

These are required so any example below runs with a valid `kit` and `adapter`.

## Estimate and bridge with source-paid fees

This example estimates, then bridges 1.00 USDC from Ethereum Sepolia to Arc
Testnet. The recipient is credited the exact `amount`; the source wallet pays
`amount` plus the quoted fee.

Source-paid fees use a **two-step** flow:

1. Call `estimateBridge` with `feePayment: "source"`. The result includes a
   `quote`: a signed, time-bound fee quote from Circle's Fee Service.
2. Call `bridge` with the **same** transfer parameters **and** that `quote`. The
   SDK submits the burn with the quote so the fee is collected on the source
   chain and the destination mint stays unreduced.

```typescript TypeScript theme={null}
const estimate = await kit.estimateBridge({
  from: { adapter, chain: "Ethereum_Sepolia" },
  to: {
    adapter,
    chain: "Arc_Testnet",
    recipientAddress: "0xRecipientAddress",
    useForwarder: true, // Required with feePayment: "source"
  },
  amount: "1.00",
  config: { feePayment: "source" },
});

// Pass estimate.quote into bridge so the burn uses the signed quote
const result = await kit.bridge({
  from: { adapter, chain: "Ethereum_Sepolia" },
  to: {
    adapter,
    chain: "Arc_Testnet",
    recipientAddress: "0xRecipientAddress",
    useForwarder: true,
  },
  amount: "1.00",
  config: { feePayment: "source" },
  quote: estimate.quote,
});
```

When `feePayment` is `"source"`, TypeScript narrows the estimate as
`ReceiveExactEstimateResult` (no cast or `in` narrowing needed). Without
`feePayment: "source"`, the return type remains the plain estimate result.

<Note>
  `quote` is the Fee Service's raw signed quote: a `0x`-prefixed, byte-aligned
  hex string. Treat it as opaque; do not decode, edit, or reconstruct it. Pass
  it through unchanged.

  When you pass `quote`, Bridge Kit validates that exact quote before and after
  approval and fails closed if it is invalid, mismatched, expired, or too close to
  expiry. It never silently replaces a caller-supplied quote. Omitting `quote`
  opts into SDK-managed fetching and refresh. On a supplied-quote failure, call
  `estimateBridge()` again and retry with the new quote.
</Note>

A successful estimate looks like this (values vary by route and quote):

```typescript TypeScript theme={null}
{
  token: "USDC",
  amount: "1.0",
  amountReceived: "1.0", // Exact recipient amount (== amount)
  feeTotal: "0.076527", // Source-chain USDC fee (sum of feeItems)
  totalDebit: "1.076527", // amount + feeTotal
  fees: [
    { type: "forwarder", token: "USDC", amount: "0.076397" },
    { type: "provider", token: "USDC", amount: "0.00013" },
  ],
  feeItems: [
    { type: "FORWARD", amount: "0.076397", args: [/* ... */], argsHash: "0x..." },
    { type: "PRE_FINALITY", amount: "0.00013", args: [/* ... */], argsHash: "0x..." },
  ],
  quoteExpiry: {
    mode: "BLOCK_NUMBER",
    expiresAtBlock: 45947392,
    blockEstimatedAt: 1787663073,
  },
  quote: "0x...", // Pass this hex string unchanged to kit.bridge
  // Also includes source, destination, and gasFees from the plain estimate
}
```

`fees` is the familiar estimate breakdown (`forwarder` / `provider`). `feeItems`
is the signed Fee Service line items (`FORWARD`, `PRE_FINALITY`) that back the
upfront quote.

Step events (`bridge.approve`, `bridge.burn`, `bridge.mint`, and others) fire on
this path the same way as other bridge transfers. See
[Bridge events](/app-kit/references/sdk-reference#bridge-events) in the SDK
reference.

## Check which chains support source fees

Not every bridge source supports paying fees on the source chain. List the ones
that do:

```typescript TypeScript theme={null}
const sourceFeeChains = kit.getSupportedChains("bridge", {
  sourceFeeSupported: true,
});
console.log(sourceFeeChains.map((chain) => chain.chain));
```

## Requirements and limitations

### Forwarding Service is required

`to.useForwarder: true` is required with `feePayment: "source"`. Omitting it (or
setting it to `false`) throws a validation error.

### Custom fees are not supported

You cannot combine `feePayment: "source"` with a per-call `config.customFee` or
a kit-level custom fee policy (`setCustomFeePolicy`). The SDK throws by design.
Collect [custom bridge fees](/app-kit/tutorials/bridge/collect-bridge-fee) only
on the default (destination) fee path.

### Use `SLOW` on Standard Transfer-only sources

`transferSpeed` defaults to `FAST`. Some source chains support only CCTP
Standard Transfer (for example Avalanche, Polygon PoS, Sei, XDC, and their
testnets). On those chains, keep `feePayment: "source"` and set
`transferSpeed: "SLOW"`. Using `FAST` (or omitting `transferSpeed`) can fail
with a Quote API error such as `PRE_FINALITY_UNAVAILABLE` (often surfaced as
HTTP 422).

```typescript TypeScript theme={null}
const result = await kit.bridge({
  from: { adapter, chain: "Avalanche_Fuji" },
  to: {
    adapter,
    chain: "Arc_Testnet",
    recipientAddress: "0xRecipientAddress",
    useForwarder: true,
  },
  amount: "1.00",
  config: {
    feePayment: "source",
    transferSpeed: "SLOW",
  },
});
```

### Error results can preserve a successful burn

If the burn confirms but the Forwarding Service / relayer returns no destination
transaction hash, the SDK returns an error-state `BridgeResult` that still
includes the burn step (retryable), instead of throwing away that progress. See
[Error recovery](/app-kit/references/bridge-error-recovery) for how to inspect
`result.state` and `result.steps`.
