# Entrypoint contract

> The Entrypoint is the front door for [deposits](/operations/deposit). It handles asset configuration, vetting fees, and [access control](/protocol/contracts/access-control), and routes `deposit()` calls into the appropriate [`PoolVault`](/protocol/contracts/pool-vault).

The Entrypoint is the front door for [deposits](/operations/deposit). It handles asset configuration, vetting fees, and [access control](/protocol/contracts/access-control), and routes `deposit()` calls into the appropriate [`PoolVault`](/protocol/contracts/pool-vault).

## State

`assets(address) external view → AssetConfig` External view getter over ERC-7201 namespaced storage (not a public state variable). Returns `AssetConfig{ enabled, minAmount, vettingFeeBPS, maxRelayFee }`. Read minimums and fee parameters from here rather than assuming fixed values.
`poolVault() external view → IPoolVault` External view getter (not a public state variable) returning the `PoolVault` this Entrypoint routes deposits to.

## Main functions

`deposit(ProofLibV2.DepositProof calldata _proof, IPoolVault.NoteData calldata _noteData, bytes calldata _aspCiphertext) external payable` The user-facing deposit entry. It validates the asset config, pulls funds (ERC20 `transferFrom` or native value), and forwards to `PoolVault.deposit`.
`setAssetConfiguration(...)` Admin-gated. Enables a new asset or updates fees and limits.
`setPoolVault(IPoolVault) external` Gated by `UPGRADER_ROLE`. Swaps the `PoolVault` reference this Entrypoint routes deposits to.

## Roles

`DEFAULT_ADMIN_ROLE` (`0x00`) Manages role grants. Upgrades themselves are gated by `UPGRADER_ROLE` (via `_authorizeUpgrade`), not by `DEFAULT_ADMIN_ROLE` directly, although an admin can grant itself `UPGRADER_ROLE`.
`ENTRYPOINT_MANAGER_ROLE` Can call `setAssetConfiguration`. (Defined in `utils/RolesConstants.sol`.)
`DEPOSITOR_ROLE` Granted to the Entrypoint only (not the deployer) so that the Entrypoint can call `PoolVault.deposit`. The deployer instead holds `DEFAULT_ADMIN_ROLE` plus a temporary `ENTRYPOINT_MANAGER_ROLE` during setup.
`UPGRADER_ROLE` Gates `setPoolVault` and upgrade authorization (`_authorizeUpgrade`). The Entrypoint is not pausable and does not use `PAUSER_ROLE`.

## Upgradeability

The Entrypoint is a UUPS upgradeable proxy. Implementation changes go through `UPGRADER_ROLE`. The pool address it routes to is set at initialization and can be swapped later via `setPoolVault(IPoolVault)`, which is also gated by `UPGRADER_ROLE`.

Source: `v2-monorepo/packages/contracts/src/contracts/Entrypoint.sol`
