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
|[`StrategyBaseTVLLimits.sol`](../../src/contracts/strategies/StrategyBaseTVLLimits.sol)| Instanced, one per supported token | - Strategies deployed outside the `StrategyFactory` use transparent proxies <br /> - Anything deployed via the `StrategyFactory` uses a Beacon proxy |
53
54
54
-
These contracts work together to enable restaking for LSTs:
55
-
* The `StrategyManager` acts as the entry and exit point for LSTs in EigenLayer. It handles deposits into LST-specific strategies, and manages accounting+interactions between users with restaked LSTs and the `DelegationManager`.
56
-
*`StrategyBaseTVLLimits` is deployed as multiple separate instances, one for each supported LST. When a user deposits into a strategy through the `StrategyManager`, this contract receives the tokens and awards the user with a proportional quantity of shares in the strategy. When a user withdraws, the strategy contract sends the LSTs back to the user.
55
+
These contracts work together to enable restaking for ERC20 tokens supported by EigenLayer:
56
+
* The `StrategyManager` acts as the entry and exit point for any supported tokens in EigenLayer. It handles deposits into LST-specific strategies, and manages accounting+interactions between users with restaked LSTs and the `DelegationManager`.
57
+
*`StrategyFactory` allows anyone to deploy strategies to support deposits/withdrawals for new ERC20 tokens
58
+
*`StrategyBaseTVLLimits` is deployed as multiple separate instances, one for each supported token. When a user deposits into a strategy through the `StrategyManager`, this contract receives the tokens and awards the user with a proportional quantity of shares in the strategy. When a user withdraws, the strategy contract sends the LSTs back to the user.
57
59
58
60
See full documentation in [`/core/StrategyManager.md`](./core/StrategyManager.md).
|[`StrategyBaseTVLLimits.sol`](../../src/contracts/strategies/StrategyBaseTVLLimits.sol)| Instanced, one per supported token | - Strategies deployed outside the `StrategyFactory` use transparent proxies <br /> - Anything deployed via the `StrategyFactory` uses a Beacon proxy |
7
8
8
-
The primary function of the `StrategyManager` is to handle accounting for individual Stakers as they deposit and withdraw LSTs from their corresponding strategies. It is responsible for (i) allowing Stakers to deposit LSTs into the corresponding strategy, (ii) allowing the `DelegationManager` to remove shares when a Staker queues a withdrawal, and (iii) allowing the `DelegationManager` to complete a withdrawal by either adding shares back to the Staker or withdrawing the shares as tokens via the corresponding strategy.
9
+
The primary function of the `StrategyManager` is to handle accounting for individual Stakers as they deposit and withdraw supported tokens from their corresponding strategies. It is responsible for (i) allowing Stakers to deposit tokens into the corresponding strategy, (ii) allowing the `DelegationManager` to remove shares when a Staker queues a withdrawal, and (iii) allowing the `DelegationManager` to complete a withdrawal by either adding shares back to the Staker or withdrawing the shares as tokens via the corresponding strategy.
9
10
10
-
As of M2, several LSTs are supported and each has its own instance of `StrategyBaseTVLLimits`. Each `StrategyBaseTVLLimits` has two main functions (`deposit` and `withdraw`), both of which can only be called by the `StrategyManager`. These `StrategyBaseTVLLimits` contracts are fairly simple deposit/withdraw contracts that hold tokens deposited by Stakers. Because these strategies are essentially extensions of the `StrategyManager`, their functions are documented in this file (see below).
11
+
Any ERC20-compatible token can be supported by deploying a `StrategyBaseTVLLimits` instance from the `StrategyFactory`. The `StrategyFactory` only allows a strategy to be deployed once per token, and automatically whitelists newly-deployed strategies. This is further documented in [Strategies](#strategies) below.
12
+
13
+
Each supported token has its own instance of `StrategyBaseTVLLimits`, has two main functions (`deposit` and `withdraw`), both of which can only be called by the `StrategyManager`. These `StrategyBaseTVLLimits` contracts are fairly simple deposit/withdraw contracts that hold tokens deposited by Stakers. Because these strategies are essentially extensions of the `StrategyManager`, their functions are documented in this file (see [Strategies](#strategies) below).
14
+
15
+
Note that for the EIGEN/bEIGEN token specifically, the `EigenStrategy` contract is used instead of `StrategyBaseTVLLimits`. Additionally, the EIGEN/bEIGEN token and several LSTs whitelisted prior to the existence of the `StrategyFactory` are blacklisted within the `StrategyFactory` to prevent duplicate strategies from being deployed for these tokens.
11
16
12
17
#### High-level Concepts
13
18
@@ -59,7 +64,7 @@ function depositIntoStrategy(
59
64
returns (uint256 shares)
60
65
```
61
66
62
-
Allows a Staker to deposit some `amount` of `token` into the specified `strategy` in exchange for shares of that strategy. The underlying `strategy` must be one of the whitelisted `StrategyBaseTVLLimits` instances, and the `token`being deposited must correspond to that `strategy's` underlying token (cbETH, rETH, or stETH).
67
+
Allows a Staker to deposit some `amount` of `token` into the specified `strategy` in exchange for shares of that strategy. The underlying `strategy` must be one of the whitelisted `StrategyBaseTVLLimits` instances, and the `token`parameter corresponds to the actual token being transferred as part of the deposit.
63
68
64
69
The number of shares received is calculated by the `strategy` using an internal exchange rate that depends on the previous number of tokens deposited.
65
70
@@ -204,6 +209,13 @@ The `DelegationManager` calls this method when a queued withdrawal is completed
Additionally, using the `StrategyFactory`, anyone can deploy a new `StrategyBaseTVLLimits` instance for a particular token. The `StrategyFactory` manages these deployments and other strategy whitelisting features in the following methods:
@@ -268,10 +280,104 @@ This method converts the withdrawal shares back into tokens using the strategy's
268
280
* The `amountShares` being withdrawn MUST NOT exceed the `totalShares` in the strategy
269
281
* The tokens represented by `amountShares` MUST NOT exceed the strategy's token balance
270
282
283
+
#### `StrategyFactory.deployNewStrategy`
284
+
285
+
```solidity
286
+
function deployNewStrategy(IERC20 token)
287
+
external
288
+
onlyWhenNotPaused(PAUSED_NEW_STRATEGIES)
289
+
returns (IStrategy newStrategy)
290
+
```
291
+
292
+
Allows anyone to deploy a new `StrategyBaseTVLLimits` instance that supports deposits/withdrawals using the provided `token`. As part of calling this method, the `StrategyFactory` automatically whitelists the new strategy in the `StrategyManager`.
293
+
294
+
Note that the `StrategyFactory` only permits ONE strategy deployment per `token`. Once a `token` has an associated strategy deployed via this method, `deployNewStrategy` cannot be used to deploy a strategy for `token` again. Additionally, `deployNewStrategy` will reject any `token` placed onto the `StrategyFactory` blacklist. This feature was added to prevent the deployment of strategies that existed _before_ the `StrategyFactory` was created. For details, see [`StrategyFactory.blacklistTokens`](#strategyfactoryblacklisttokens).
295
+
296
+
NOTE: Use caution when deploying strategies for tokens that do not strictly conform to ERC20 standards. Rebasing tokens similar to already-whitelisted LSTs should be supported, but please DYOR if your token falls outside of ERC20 norms.
297
+
298
+
*Effects*:
299
+
* Deploys a new `BeaconProxy` for the `token`, which references the current `StrategyBaseTVLLimits` implementation
300
+
* Updates the `tokenStrategy` mapping for the `token`, preventing a second strategy deployment for the same token
301
+
* See `StrategyManager.addStrategiesToDepositWhitelist`
302
+
303
+
*Requirements*:
304
+
* Pause status MUST NOT be set: `PAUSED_NEW_STRATEGIES`
305
+
*`token` MUST NOT be blacklisted within `StrategyFactory`
306
+
*`StrategyFactory` MUST NOT have been used to deploy a strategy for `token` already
307
+
* See `StrategyManager.addStrategiesToDepositWhitelist`
308
+
309
+
#### `StrategyFactory.blacklistTokens`
310
+
311
+
```solidity
312
+
function blacklistTokens(IERC20[] calldata tokens) external onlyOwner
313
+
```
314
+
315
+
Allows the owner to prevent certain `tokens` from having strategies deployed via `StrategyFactory.deployNewStrategy`. This method was added to prevent the deployment of strategies for tokens that already have strategies deployed/whitelisted through other means.
316
+
317
+
Note that once the owner adds tokens to the blacklist, they cannot be removed. This is a known limitation of the `StrategyFactory`, and can be addressed by upgrading the factory if needed.
318
+
319
+
*Effects*:
320
+
* Adds each token in `tokens` to the `isBlacklisted` mapping
321
+
322
+
*Requirements*:
323
+
* Caller MUST be the owner
324
+
* Each passed in `token` MUST NOT already be blacklisted
Allows the owner to explicitly whitelist strategies in the `StrategyManager`. This method is used as a passthrough for the `StrategyManager.addStrategiesToDepositWhitelist`, in case the owner needs to whitelist strategies not deployed via the `StrategyFactory`.
338
+
339
+
*Effects*:
340
+
* See `StrategyManager.addStrategiesToDepositWhitelist`
341
+
342
+
*Requirements*:
343
+
* Caller MUST be the owner
344
+
* See `StrategyManager.addStrategiesToDepositWhitelist`
function setThirdPartyTransfersForbidden(IStrategy strategy, bool value) external onlyOwner
350
+
```
351
+
352
+
Allows the owner to explicitly enable or disable third party transfers in the `StrategyManager`. This method is used as a passthrough for the `StrategyManager.setThirdPartyTransfersForbidden`, in case the owner needs to modify these values.
353
+
354
+
*Effects*:
355
+
* See `StrategyManager.setThirdPartyTransfersForbidden`
356
+
357
+
*Requirements*:
358
+
* Caller MUST be the owner
359
+
* See `StrategyManager.setThirdPartyTransfersForbidden`
function removeStrategiesFromWhitelist(IStrategy[] calldata strategiesToRemoveFromWhitelist) external
365
+
```
366
+
367
+
Allows the owner to remove strategies from the `StrategyManager` strategy whitelist. This method is used as a passthrough for the `StrategyManager.removeStrategiesFromDepositWhitelist`, in case the owner needs to access this method.
368
+
369
+
*Effects*:
370
+
* See `StrategyManager.removeStrategiesFromDepositWhitelist`
371
+
372
+
*Requirements*:
373
+
* Caller MUST be the owner
374
+
* See `StrategyManager.removeStrategiesFromDepositWhitelist`
375
+
271
376
---
272
377
273
378
### System Configuration
274
379
380
+
The Strategy Whitelister role has the ability to permit/remove strategies from being depositable via the `StrategyManager`. This role is held by the `StrategyFactory` (which is fully documented in [Strategies](#strategies)). The following methods concern the Strategy Whitelister role and its abilities within the `StrategyManager`:
@@ -283,7 +389,7 @@ This method converts the withdrawal shares back into tokens using the strategy's
283
389
function setStrategyWhitelister(address newStrategyWhitelister) external onlyOwner
284
390
```
285
391
286
-
Allows the `owner` to update the Strategy Whitelister address.
392
+
Allows the `owner` to update the Strategy Whitelister address. Currently, the Strategy Whitelister role is held by the `StrategyFactory`. See [Strategies](#strategies) for more details.
0 commit comments