# Asset registry \[Centralized per-asset authorization and initial deposit sizing for factory spawns]

Vehicle and Conduit factories read the AssetRegistry at spawn time. Per asset it stores whether it is authorized and the seed deposit the factory must pull and burn.

```solidity [Solidity]
struct AssetConfig {
    bool isAuthorized;
    uint256 initialDepositAmount;
}
```

| Method | Returns |
|--------|---------|
| `getAssetConfig(asset)` | The full `AssetConfig` |
| `isAssetAuthorized(asset)` | `true` when authorized |
| `getInitialDepositAmount(asset)` | The configured amount; reverts `AssetNotAuthorized` otherwise |

Registry-backed factories take no `initialDepositSize` in their `SpawnParams`, so a caller holding `FACTORY_SPAWN` can neither deploy for an unauthorized asset nor change the seed amount. `ERC7540VehicleFactory` is the exception: no registry, still takes `initialDepositSize`.

## Writing entries

`setAssetConfig(asset, isAuthorized, initialDepositAmount)` is the only writer and needs `ASSET_REGISTRY_SET_ASSET`. Authorizing requires a non-zero amount, otherwise it reverts `InvalidInitialDepositSize`; deauthorizing forces the amount to `0`. Every write emits `AssetConfigSet`. Pre-populate the registry at deployment through its `InitialAssetConfig[]` argument.

```solidity [Solidity]
registry.setAssetConfig(WETH, true, 0.1 ether);
registry.setAssetConfig(oldAsset, false, 0);
```

Deauthorizing only blocks new spawns; Vehicles already deployed keep operating.

## Sizing the seed deposit

A Vehicle wraps an underlying protocol, so share math runs at two layers and each rounds in its own favour. The dust left after each operation erodes or accretes the share price, inversely proportional to the Vehicle's underlying balance. A large enough seed makes it economically irrelevant: its shares are burned, so the buffer stays forever and absorbs the drift. Size up for low-decimal assets, where 1 wei of USDC is a larger fraction of a unit than 1 wei of DAI.

## At spawn time

The `AaveV3`, `ERC4626`, `Ethena`, `MorphoBlue`, `MultiVehicle`, `Wrapper` and Conduit factories each hold an immutable registry pointer, announced with `AssetRegistryInitialized`. On `spawn` the factory reads `getInitialDepositAmount(asset)` — `ConduitFactory` resolves the asset from the Vehicle's `asset()` — pulls it from the caller, deposits it, and burns the shares. A factory constructed with a zero or non-contract registry reverts `InvalidAssetRegistry`. [Conduits](/developers/contracts/conduit) covers the rest of that flow.
