You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ while maintaining exposure to staking rewards.
26
26
27
27
### L2 Layer (i.e. Base, etc)
28
28
-**StakingManager**: Orchestrates service deployment and staking operations
29
-
-**ExternalStakingDistributor**: Performs service deployment and staking for external staking contracts
29
+
-**ExternalStakingDistributor**: Manages external staking on third-party staking proxies — deploys services (creates Safe multisigs with self as module), stakes/unstakes/re-stakes, claims and distributes rewards (split between Collector, protocol, and curating agent per configurable reward factors). Supports V1 (rewards on multisig) and V2 (rewards on contract) staking types. Access-controlled via owner, managing agents (unstakes), and per-proxy curating agents with staking guards
30
30
-**StakingTokenLocked**: Manages individual staking instances and reward distribution
31
31
-**ActivityModule**: Handles service activity verification and reward claiming
32
32
-**Collector**: Collects and bridges rewards back to L1
│ ├── ActivityModule.sol # Service activity management
55
55
│ └── Collector.sol # Reward collection and bridging
@@ -80,7 +80,7 @@ doc/ # Documentation and whitepaper
80
80
1. Services are deployed on L2 with OLAS backing
81
81
2. Rewards accumulate based on service performance
82
82
3. ActivityModule verifies service liveness and required KPI performance
83
-
4. ExternalStakingDistributor curates all external staking and forces unstakes, if required
83
+
4. ExternalStakingDistributor curates external staking on third-party proxies: deploys services via Safe multisigs, stakes them, claims rewards (split between Collector, protocol, and curating agents per configurable factors), and forces unstakes for underperformers or when rewards are zero/service is evicted
84
84
5. Collector gathers rewards and bridges them back to L1 via a Distributor contract
This check is going to skip the `checkpoint()` call if no agents are staked or if the checkpoint has been already
157
157
triggered within the `livenessPeriod` time.
158
158
159
+
### External Staking (ExternalStakingDistributor)
160
+
161
+
The [ExternalStakingDistributor](../contracts/l2/ExternalStakingDistributor.sol) manages staking on third-party staking proxy contracts. It deploys services (creating Safe multisigs with itself as module), stakes/unstakes/re-stakes them, and claims and distributes rewards.
162
+
163
+
**Staking:** Whitelisted curating agents (or the owner) call `stake()` to deploy a service on a whitelisted staking proxy. The contract creates a Safe multisig, registers it as a service, and stakes it. The curating agent is recorded per service.
164
+
165
+
**Claiming rewards:** Agents call `claim()` with arrays of staking proxies and service Ids. Rewards are distributed according to per-proxy configurable factors (must sum to 100%):
166
+
-**Collector share** — sent to Collector via `topUpBalance(amount, REWARD)` for L1 bridging
167
+
-**Protocol share** — sent to Collector via `topUpProtocol(amount)` for protocol use
168
+
-**Curating agent share** — transferred directly to the curating agent address
169
+
170
+
For V1 staking types, rewards land on the service multisig and are distributed via `execTransactionFromModule`. For V2 staking types, rewards land directly on the contract.
171
+
172
+
**Unstaking:** Managing agents (or the owner) call `unstakeAndWithdraw()` to unstake a service, distribute remaining rewards, and optionally fulfill pending withdraw requests through Collector. Anyone can trigger unstake if the staking proxy has zero available rewards or if the service is evicted.
173
+
174
+
**Re-staking:** If a service is evicted, curating agents, managing agents, or the owner can call `reStake()` to unstake and immediately re-stake it.
BP1->>ESD: deposit OLAS (via L2 staking processor)
120
+
ESD->>S: deploy service (create Safe multisig, stake)
121
+
S->>ESD: rewards accrue
122
+
ESD->>ESD: claim & distribute rewards
123
+
ESD->>Coll: collector share (topUpBalance REWARD)
124
+
ESD->>Coll: protocol share (topUpProtocol)
125
+
112
126
%% C) Withdraw with possible shortfall (UNSTAKE -> Treasury)
113
127
U->>T: request withdraw
114
128
T->>V: redeem up to vault+reserve
@@ -142,7 +156,8 @@ sequenceDiagram
142
156
-**UnstakeRelayer** — receives **UNSTAKE_RETIRED** returns and forwards to `stOLAS.topUpRetiredBalance` (does not directly fund Treasury payouts).
143
157
144
158
**L2 components**
145
-
-**StakingManager / StakingTokenLocked** — manage staking lifecycle for services and accrue rewards.
159
+
-**StakingManager / StakingTokenLocked** — manage internal staking lifecycle for LST services and accrue rewards.
160
+
-**ExternalStakingDistributor** — manages external staking on third-party staking proxies. Deploys services (creates Safe multisigs with self as module), stakes/unstakes/re-stakes, claims and distributes rewards split between Collector (for L1 bridging), protocol (`topUpProtocol`), and curating agents per configurable reward factors (must sum to 100%). Supports V1 (rewards on multisig) and V2 (rewards on contract) staking types. Access control: owner, whitelisted managing agents (unstakes), per-proxy curating agents with staking guards. Receives OLAS from L2 staking processor (`deposit`) and handles withdraw/unstake requests back through Collector (`withdrawAndRequestUnstake`, `unstakeAndWithdraw`).
146
161
-**Collector** — bridges ops/tokens to L1 with explicit routing for: **REWARD**, **UNSTAKE**, **UNSTAKE_RETIRED**.
147
162
148
163
**Bridge Processor (L1/L2)** — abstract transport for messages + OLAS between chains.
Copy file name to clipboardExpand all lines: doc/architecture.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,9 @@ It is meant to accompany `README.md` and serve as a quick reference for develope
18
18
-**`UnstakeRelayer`** — handles returns of permanently closed staking model unstakes; tops up `stOLAS` with retired reserves.
19
19
20
20
**L2 (Gnosis, Base, etc.):**
21
-
-**`StakingManager` / `ExternalStakingDistributor` / `StakingTokenLocked`** — staking logic for services, accrual of rewards, initiation of stake and unstake.
21
+
-**`StakingManager`** — orchestrates internal service deployment/staking for LST-managed services.
22
+
-**`ExternalStakingDistributor`** — manages external staking on third-party staking proxies. Deploys services by creating Safe multisigs (with self as module), stakes/unstakes/re-stakes services, claims rewards and distributes them (split between Collector for L1 bridging, protocol via `topUpProtocol`, and curating agent per configurable reward factors). Supports two staking types: V1 (rewards land on service multisig, distributed via `execTransactionFromModule`) and V2 (rewards land directly on the contract). Access control: owner can do everything; whitelisted **managing agents** can force unstakes; per-proxy **curating agents** (guarded by a **staking guard** address) can stake. Receives OLAS deposits from L2 staking processor and handles withdraw/unstake requests back through Collector.
23
+
-**`StakingTokenLocked`** — restricted StakingToken that only allows StakingManager as staker.
22
24
-**`Collector`** — bridge intermediary: routes collected tokens back to L1.
0 commit comments