articleJul 31, 2025
Deposit Forwarder System
Architecture for per-user deterministic deposit contracts: factory, master forwarder roles, and ETH/ERC-20 forward flows for an exchange backend.
Deposit Forwarder System
A system for managing user deposits through deterministic contract addresses.
Architecture
Three main contracts:
- DepositForwarder — per-user contract that receives and forwards deposits
- DepositForwarderFactory — creates and tracks DepositForwarder instances
- MasterForwarder — holds critical addresses and configuration
Role-based access control
-
SAFE wallet — controls MasterForwarder
- Can change destination address
- Can change deployer address
- Can change forwarder caller address
-
Deployer — authorized to create new deposit forwarders
- Calls
createDepositForwarderon the factory - Address managed by MasterForwarder
- Calls
-
Forwarder caller — operator wallet allowed to trigger ERC-20 transfers
- Calls
forwardon deposit forwarders - Address managed by MasterForwarder
- Calls
Contract details
DepositForwarder
- Accepts ETH and ERC-20 tokens
- Forwards assets to the destination address
- Deployed at deterministic addresses
- Protected by a reentrancy guard
MasterForwarder
- Manages destination addresses
- Controls deposit forwarders
- Implements multisig security
- Handles emergency procedures
Flows
Deposit address creation
Loading diagram…Deposit address assignment
Loading diagram…Processing a user's ETH or ERC-20 deposit
Loading diagram…