smartAccount
sequenceDiagram
title Smart Account Flow
participant SA as SafeProxyFactory
participant P1 as Relayer (Off-chain)
%% REVIEW: My Understanding is Relayer is just downstream from Sequencer for on-chain processing, however this is marked as off-chain. Is this correct?
participant S1 as Sequencer
participant M1 as MySQL
actor A1 as User/SDK
Note over A1: Required before making<br/>your first deposit
A1 ->> S1: Request Smart Account creation
S1 ->> P1: Forward Smart Account creation request
P1 ->> SA: Deploy new Smart Account
Note over P1,SA: Smart Account deployment via SAFE
alt Successful Smart Account Creation
SA -->> P1: TX Confirmation Success
P1 ->> S1: Confirm Smart Account creation
%% REVIEW: Store metadata of the safe (version, modules, init code, seed/salt, etc) with mapping
S1 ->> M1: Create EOA to SA mapping (including safe metadata)
%% REVIEW: Do we need to explicity include the Create Internal Account Function Call (i know there used to be an API function for this) or did we abstract that away
S1 ->> A1: Smart Account creation successful
Note over A1: Proceed to Deposit Flow
else Failed Smart Account Creation
SA -->> P1: TX Confirmation Failed
P1 ->> S1: Report deployment failure
S1 -->> A1: Smart Account creation failed<br/>with error details
Note over S1: Setup process stops -<br/>user must retry Smart Account creation
end