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

# Deployments

> The Anafi contract addresses, the Safe infrastructure addresses and the deploy block of each network.

After you read this page, you can configure the SDK for a network, and you can check each address against the chain.

Anafi has a deployment on three networks: `polygon`, `xlayer` and `polygon-amoy`. Each table copies the deployment record of that network. The record holds the values at the time of the deployment. The registry owner can change some values later, so read the chain for the current state. The last section shows how.

Use the proxy address of each upgradeable contract. Do not call an implementation address directly.

## polygon

Polygon PoS mainnet. Chain id `137`. Deploy block `94819521`.

| Contract | Address |
| - | - |
| `AnafiRegistry` (proxy) | `0x943Fb1925acc758c87F7672eCAF7041b25DE8506` |
| `AnafiDslRegistry` (proxy) | `0xadAC71d7060d99E530a52f61599Abb653dc349F4` |
| `AnafiDelegationAdapterSafe` (proxy) | `0xA5E5cE761CD9a5E49be6adD95d1b67d57cb23D78` |
| `AnafiDelegationAdapterERC20Allow` (proxy) | `0x1A8368bD76eb24CfC3bF5E483be0e3390728484d` |
| `AnafiSwapExecutor` | `0xfd01e5fDD8Da36E482937DAB55EF1Ad57563e6b7` |
| `AnafiOffRampFallbackHandler` | Not deployed |

| Safe infrastructure | Address |
| - | - |
| Safe singleton | `0xFf51A5898e281Db6DfC7855790607438dF2ca44b` |
| Safe L2 singleton | `0xEdd160fEBBD92E350D4D398fb636302fccd67C7e` |
| `SafeToL2Setup` | `0x900C7589200010D6C6eCaaE5B06EBe653bc2D82a` |
| Safe proxy factory | `0x14F2982D601c9458F93bd70B218933A6f8165e7b` |
| Safe `MultiSend` | `0x218543288004CD07832472D464648173c77D7eB7` |

| Implementation recorded in the deployment | Address |
| - | - |
| Safe adapter, gas-charge implementation | `0xC0BD1beE6Abb65D74f4714B6b1Ab15Ed5436B40A` |
| ERC20Allow adapter, gas-charge implementation | `0x59c9B0B33CE3f9e3c95f794465dB3dDfd3dfbC91` |
| ERC20Allow adapter, version 2 implementation | `0x42ddbb5c2828148A61a5129dCbe5ea5067270244` |

Safe releases that the deployment admitted on the Safe adapter:

| Proxy code hash | Release |
| - | - |
| `0x4e381985ca68b3e5d27b4425fa581c19cf33146d3f887a3cfca96f55528ea46f` | The proxy of the factory above |
| `0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000` | Safe 1.3.0 |
| `0xd7d408ebcd99b2b70be43e20253d6d92a8ea8fab29bd3be7f55b10032331fb4c` | Safe 1.4.1 |

| Singleton | `VERSION()` |
| - | - |
| `0xFf51A5898e281Db6DfC7855790607438dF2ca44b` | `1.5.0` |
| `0xEdd160fEBBD92E350D4D398fb636302fccd67C7e` | `1.5.0` |
| `0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552` | `1.3.0` |
| `0x3E5c63644E683549055b9Be8653de26E0B4CD36E` | `1.3.0` |
| `0x69f4D1788e39c87893C980c06EdF4b7f686e2938` | `1.3.0` |
| `0xfb1bffC9d739B8D520DaF37dF666da4C687191EA` | `1.3.0` |
| `0x41675C099F32341bf84BFc5382aF534df5C7461a` | `1.4.1` |
| `0x29fcB43b46531BcA003ddC8FCB67FFE91900C762` | `1.4.1` |

## xlayer

X Layer mainnet. Chain id `196`. Deploy block `71515481`.

| Contract | Address |
| - | - |
| `AnafiRegistry` (proxy) | `0xe4Fe05AbAe4e3bC6a6f2256A6383114e6fbc1BF8` |
| `AnafiDslRegistry` (proxy) | `0x2ec9910e7BEBaa23B3622E9E08C6bffD057BA5C6` |
| `AnafiDelegationAdapterSafe` (proxy) | `0xe1379422D97a017e9BB19A5045ac937086075F8F` |
| `AnafiDelegationAdapterERC20Allow` (proxy) | `0xc9e5D2f9CD199e324aC9035aab922da6bF03f4f1` |
| `AnafiSwapExecutor` | `0x9bF3a26456A1337C78806D8bD8FfD55011c305Bb` |
| `AnafiOffRampFallbackHandler` | Not deployed |

| Safe infrastructure | Address |
| - | - |
| Safe singleton | `0xFf51A5898e281Db6DfC7855790607438dF2ca44b` |
| Safe L2 singleton | `0xEdd160fEBBD92E350D4D398fb636302fccd67C7e` |
| `SafeToL2Setup` | `0x900C7589200010D6C6eCaaE5B06EBe653bc2D82a` |
| Safe proxy factory | `0x14F2982D601c9458F93bd70B218933A6f8165e7b` |
| Safe `MultiSend` | `0x218543288004CD07832472D464648173c77D7eB7` |

| Implementation recorded in the deployment | Address |
| - | - |
| Safe adapter, gas-charge implementation | `0x11b1E378C3749FcA4b13B87bC86AfAad71A0C9D3` |
| ERC20Allow adapter, gas-charge implementation | `0x61713a5B69138DD09b1159d6e1b374553A9c2330` |
| ERC20Allow adapter, version 2 implementation | `0x1b460a0D4a46d19Cc5e323e376099BfEA3E34272` |

The deployment record of `xlayer` does not list the admitted Safe releases. Read them from the Safe adapter with `admittedSafeProxyCodehashes(bytes32)` and `admittedSafeSingletons(address)`.

## polygon-amoy

Polygon PoS Amoy testnet. Chain id `80002`. Deploy block `49116880`.

| Contract | Address |
| - | - |
| `AnafiRegistry` (proxy) | `0x100B1e2d05dac3DdF6774b6668BCE07c9BEc8018` |
| `AnafiDslRegistry` (proxy) | `0xa60904ABC7e96B06005234EACF02217afA02d5C3` |
| `AnafiDelegationAdapterSafe` (proxy) | `0x425FE0A554299D33589edc51387254175478Ee0e` |
| `AnafiDelegationAdapterERC20Allow` (proxy) | `0x3C58b31704Bbb13D32b38FFf1427799D6ce900e7` |
| `AnafiSwapExecutor` | `0x2c06da2b504EB4744a4778Dc06160F8921221Ce7` |
| `AnafiOffRampFallbackHandler` | `0x5F5dAF4084529D60a9144e002e67eC2DF4D35f7F` |

| Safe infrastructure | Address |
| - | - |
| Safe singleton | `0xFf51A5898e281Db6DfC7855790607438dF2ca44b` |
| Safe L2 singleton | `0xEdd160fEBBD92E350D4D398fb636302fccd67C7e` |
| `SafeToL2Setup` | `0x900C7589200010D6C6eCaaE5B06EBe653bc2D82a` |
| Safe proxy factory | `0x14F2982D601c9458F93bd70B218933A6f8165e7b` |
| Safe `MultiSend` | `0x218543288004CD07832472D464648173c77D7eB7` |

| Implementation recorded in the deployment | Address |
| - | - |
| Safe adapter, gas-charge implementation | `0x54cB43602f7506AC303bc18d36A819620Bc616B4` |
| ERC20Allow adapter, gas-charge implementation | `0xB555d801a84Edb11b1391b179ddBD23B79973c58` |
| ERC20Allow adapter, version 2 implementation | `0x0a46f126c271C8621A20360D173B2b31E7a70901` |

Safe releases that the deployment admitted on the Safe adapter:

| Proxy code hash | Release |
| - | - |
| `0x4e381985ca68b3e5d27b4425fa581c19cf33146d3f887a3cfca96f55528ea46f` | The proxy of the factory above |
| `0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000` | Safe 1.3.0 |
| `0xd7d408ebcd99b2b70be43e20253d6d92a8ea8fab29bd3be7f55b10032331fb4c` | Safe 1.4.1 |

| Singleton | `VERSION()` |
| - | - |
| `0xFf51A5898e281Db6DfC7855790607438dF2ca44b` | `1.5.0` |
| `0xEdd160fEBBD92E350D4D398fb636302fccd67C7e` | `1.5.0` |
| `0xd9Db270c1B5E3Bd161E8c8503c55cEABeE709552` | `1.3.0` |
| `0x3E5c63644E683549055b9Be8653de26E0B4CD36E` | `1.3.0` |
| `0xfb1bffC9d739B8D520DaF37dF666da4C687191EA` | `1.3.0` |
| `0x41675C099F32341bf84BFc5382aF534df5C7461a` | `1.4.1` |
| `0x29fcB43b46531BcA003ddC8FCB67FFE91900C762` | `1.4.1` |

## SDK configuration

The SDK client takes the addresses in two objects of `AnafiClientConfig`: `addresses`, of type `AnafiClientAddresses`, and `delegationAdapters`, of type `DelegationAdapters`.

| Deployment record key | SDK field |
| - | - |
| `anafiRegistry` | `addresses.anafiRegistry` |
| `dslRegistry` | `addresses.dslRegistry` |
| `safeSingleton` | `addresses.safe.singleton` |
| `safeSingletonL2` | `addresses.safe.singletonL2` |
| `safeToL2Setup` | `addresses.safe.toL2Setup` |
| `safeProxyFactory` | `addresses.safe.proxyFactory` |
| `safeMultiSend` | `addresses.safe.multiSend` |
| `delegationAdapterSafe` | `delegationAdapters.safe` |
| `delegationAdapterERC20Allow` | `delegationAdapters.erc20_allow` |

```ts theme={null}
import type { AnafiClientAddresses, DelegationAdapters } from "@anafi-cc/anafi-sdk";

// polygon-amoy, chain id 80002
const addresses: AnafiClientAddresses = {
  anafiRegistry: "0x100B1e2d05dac3DdF6774b6668BCE07c9BEc8018",
  dslRegistry: "0xa60904ABC7e96B06005234EACF02217afA02d5C3",
  safe: {
    singleton: "0xFf51A5898e281Db6DfC7855790607438dF2ca44b",
    singletonL2: "0xEdd160fEBBD92E350D4D398fb636302fccd67C7e",
    toL2Setup: "0x900C7589200010D6C6eCaaE5B06EBe653bc2D82a",
    proxyFactory: "0x14F2982D601c9458F93bd70B218933A6f8165e7b",
    multiSend: "0x218543288004CD07832472D464648173c77D7eB7",
  },
};

const delegationAdapters: DelegationAdapters = {
  safe: "0x425FE0A554299D33589edc51387254175478Ee0e",
  erc20_allow: "0x3C58b31704Bbb13D32b38FFf1427799D6ce900e7",
};
```

The SDK reads the swap executor from the ERC20Allow adapter, and the engine keys from the registry. See [Client](https://docs.ana.fi/sdk/client.md) for the other fields of the configuration.

## Read the same values on chain

Start from the registry address. Each other Anafi address has a getter that you can check against this page.

| Value | Read |
| - | - |
| The live adapters | `AnafiRegistry.delegationAdapters()` |
| The registry of an adapter | `anafiRegistry()` on the adapter |
| The registry of the DSL registry | `AnafiDslRegistry.anafiRegistry()` |
| The swap executor | `AnafiDelegationAdapterERC20Allow.swapExecutor()` |
| The adapter of the swap executor | `AnafiSwapExecutor.adapter()` |
| The admitted Safe releases | `admittedSafeProxyCodehashes(bytes32)`, `admittedSafeSingletons(address)` on the Safe adapter |
| The current engine keys | `engineSigKey()`, `engineEncKey()`, `composeHash()` on the registry |
| The admin | `owner()` on the registry, or on any Anafi proxy |
| The implementation of a proxy | Storage slot `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` of the proxy |

```ts theme={null}
import { createPublicClient, http, parseAbi } from "viem";
import { polygon } from "viem/chains";

const publicClient = createPublicClient({ chain: polygon, transport: http() });
const registry = "0x943Fb1925acc758c87F7672eCAF7041b25DE8506";

const ABI = parseAbi([
  "function delegationAdapters() view returns (address[])",
  "function anafiRegistry() view returns (address)",
  "function swapExecutor() view returns (address)",
  "function adapter() view returns (address)",
]);

const adapters = await publicClient.readContract({ address: registry, abi: ABI, functionName: "delegationAdapters" });
for (const adapter of adapters) {
  const boundTo = await publicClient.readContract({ address: adapter, abi: ABI, functionName: "anafiRegistry" });
  console.log(adapter, boundTo === registry);
}

const executor = await publicClient.readContract({
  address: "0x1A8368bD76eb24CfC3bF5E483be0e3390728484d",
  abi: ABI,
  functionName: "swapExecutor",
});
const executorAdapter = await publicClient.readContract({ address: executor, abi: ABI, functionName: "adapter" });
```

The Safe infrastructure contracts belong to Safe, not to Anafi. Anafi uses the public Safe deployments at the addresses above. The four addresses of the singleton, the L2 singleton, `SafeToL2Setup` and the proxy factory together set the address of each Safe that the SDK predicts for an owner.

The deployment block is the first block where an Anafi event of that network can exist. Use it as `fromBlock` when you read Anafi events.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.