> ## 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.

# How-to: Deploy an ERC-4337 paymaster on Arc

> Deploy and fund an ERC-4337 paymaster on Arc. Arc's native gas token is USDC — fund your paymaster's EntryPoint deposit in native USDC (18-decimal units).

Deploying an ERC-4337 paymaster on Arc follows the standard ERC-4337 flow with
one key difference: Arc's native gas token is USDC, not ETH. Your paymaster's
EntryPoint balance is denominated in native USDC (18-decimal units), not the
6-decimal ERC-20 USDC units used in token transfers. A 10 USDC deposit requires
`10 * 10^18`, not `10 * 10^6`.

## Prerequisites

Before you begin, ensure that you've:

* Familiarized yourself with ERC-4337 account abstraction and EntryPoint v0.7
* Configured Hardhat or Foundry for Arc testnet (chain ID `5042002`, RPC
  `https://rpc.testnet.arc.io`)
* Configured Pimlico as your bundler for Arc testnet (chain ID `5042002`)
* Prepared a paymaster contract based on the ERC-4337 reference implementation

## Steps

### Step 1. Fund the paymaster

The paymaster's EntryPoint deposit is USDC. After deployment, deposit USDC into
the EntryPoint by calling `depositTo`. Specify the amount in wei (18-decimal
native USDC units).

```typescript theme={null}
import { ethers } from "ethers";

// Verify the EntryPoint v0.7 address for Arc testnet before use
const ENTRY_POINT_ADDRESS = "0x0000000071727De22E5E9d8BAf0edAc6f37da032";
const PAYMASTER_ADDRESS = "<your-paymaster-address>";

const ENTRY_POINT_ABI: string[] = [
  "function depositTo(address account) external payable",
  "function balanceOf(address account) external view returns (uint256)",
];

const provider = new ethers.JsonRpcProvider("https://rpc.testnet.arc.io");

// Open .env in your editor and add your deployer private key:
// DEPLOYER_PRIVATE_KEY=your-private-key
// Keep this key secure. It controls the paymaster's funding account.
const wallet = new ethers.Wallet(process.env.DEPLOYER_PRIVATE_KEY!, provider);

const entryPoint = new ethers.Contract(
  ENTRY_POINT_ADDRESS,
  ENTRY_POINT_ABI,
  wallet,
);

// Deposit 10 USDC: specify in wei (18-decimal native USDC units)
const depositAmount: bigint = 10n * 10n ** 18n;

const tx = await entryPoint.depositTo(PAYMASTER_ADDRESS, {
  value: depositAmount,
});
await tx.wait();

// Check the current deposit balance
// balanceOf returns 18-decimal native USDC units, not 6-decimal ERC-20 units
const balance: bigint = await entryPoint.balanceOf(PAYMASTER_ADDRESS);
const balanceUsdc: bigint = balance / 10n ** 18n;
console.log("Paymaster deposit balance (native wei):", balance.toString());
console.log("Paymaster deposit balance (USDC):", balanceUsdc.toString());
```

### Step 2. Verify the deployment

Confirm the following before sending live UserOperations:

| Check                          | Command or call                                                                       |
| :----------------------------- | :------------------------------------------------------------------------------------ |
| Contract has bytecode          | `cast code <address> --rpc-url https://rpc.testnet.arc.io` returns non-empty bytecode |
| EntryPoint deposit is funded   | `entryPoint.balanceOf(paymasterAddress)` returns a non-zero balance                   |
| Bundler accepts UserOperations | Submit a test UserOperation through Pimlico and confirm it processes                  |

<Note>
  Arc's minimum base fee is 20 Gwei. If you operate your own bundler, ensure it
  sets `maxFeePerGas` to at least 20 Gwei when submitting bundle transactions.
  Pimlico configured for Arc handles this automatically.
</Note>
