1
+ ├── StrategyManagerUnit.t.sol (*** denotes that integration tests are needed to validate path)
2
+ ├── initialize
3
+ | ├── given that initialized is only called once
4
+ │ │ └── it should set the storage variables correctly (owner, strategyWhitelister, pauserRegistry)
5
+ │ └── given that initialize is called again
6
+ │ └── it should revert
7
+ ├── depositIntoStrategy()
8
+ │ ├── given that deposits paused
9
+ │ │ └── it should revert
10
+ │ ├── given the function is re-entered
11
+ │ │ └── it should revert
12
+ │ ├── given that the strategy is not whitelisted
13
+ │ │ └── it should revert
14
+ │ ├── given the token safeTransferFrom() reverts
15
+ │ │ └── it should revert
16
+ │ └── given that token safeTransferFrom() succeeds
17
+ │ ├── given the staker has existing shares in strategy (not first deposit)
18
+ │ │ └── it should increase shares, nonce. while stakerStrategyListLength is unchanged
19
+ │ ├── given the staker has no existing shares in strategy (first deposit)
20
+ │ │ └── stakerStrategyListLength increases by 1 and shares increase
21
+ │ ├── given the staker has delegated to a operator ***
22
+ │ │ └── it should deposit successfully with shares increase, including delegated shares
23
+ │ └── given the staker is not delegated
24
+ │ └── it should deposit successfully with shares increase
25
+ ├── depositIntoStrategyWithSignature()
26
+ │ ├── given that deposits paused
27
+ │ │ └── it should revert
28
+ │ ├── given the function is re-entered
29
+ │ │ └── it should revert
30
+ │ ├── given the signature expired
31
+ │ │ └── it should revert
32
+ │ ├── given that deposits paused and strategy not whitelisted
33
+ │ │ └── it should revert
34
+ │ ├── given the staker is a EOA
35
+ │ │ ├── given the signature verification fails
36
+ │ │ │ └── it should revert
37
+ │ │ └── given the signature verification succeeds
38
+ │ │ ├── given the token safeTransferFrom reverts
39
+ │ │ │ └── it should revert
40
+ │ │ └── given the token safeTransferFrom succeeds
41
+ │ │ ├── given that the staker has delegated to a operator ***
42
+ │ │ │ └── it should deposit successfully with shares and nonce increase, including delegated shares
43
+ │ │ └── given that the staker is not delegated
44
+ │ │ └── it should deposit successfully with shares and nonce increase
45
+ │ └── given the staker is a contract
46
+ │ ├── given the contract isn't EIP1271 compliant
47
+ │ │ └── it should revert
48
+ │ ├── given the signature verification fails, isValidSignature() return != EIP1271_MAGICVALUE
49
+ │ │ └── it should revert
50
+ │ └── given the signature verification succeeds, isValidSignature() returns EIP1271_MAGICVALUE
51
+ │ ├── given the token safeTransferFrom reverts
52
+ │ │ └── it should revert
53
+ │ └── given the token safeTransferFrom succeeds
54
+ │ ├── given the staker has delegated to a operator ***
55
+ │ │ └── it should deposit successfully with shares and nonce increase, including delegated shares
56
+ │ └── given the staker is not delegated
57
+ │ └── it should deposit successfully with shares and nonce increase
58
+ ├── removeShares()
59
+ │ ├── given not called by DelegationManager
60
+ │ │ └── it should revert
61
+ │ ├── given the share amount is 0
62
+ │ │ └── it should revert
63
+ │ ├── given the share amount is too high, higher than deposited amount
64
+ │ │ └── it should revert
65
+ │ ├── given the share amount is equal to the deposited amount
66
+ │ │ └── staker shares should be 0 with decremented stakerStrategyListLength
67
+ │ └── given the share amount is less than the deposited amount
68
+ │ └── staker shares should now be deposited - shares amount, unchanged stakerStrategyListLength
69
+ ├── addShares()
70
+ │ ├── given not called by DelegationManager
71
+ │ │ └── it should revert
72
+ │ ├── given the share amount is 0
73
+ │ │ └── it should revert
74
+ │ ├── given the staker is 0 address
75
+ │ │ └── it should revert
76
+ │ ├── given adding shares with 0 existing shares
77
+ │ │ └── it should increase shares and increment stakerStrategyListLength
78
+ │ ├── given adding shares with 0 existing shares and staker has MAX_STAKER_STRATEGY_LIST_LENGTH
79
+ │ │ └── it should revert
80
+ │ └── given the adding shares with > 0 existing shares
81
+ │ └── it should increase shares, unchanged stakerStrategyListLength
82
+ ├── withdrawSharesAsTokens()
83
+ │ ├── given not called by DelegationManager
84
+ │ │ └── it should revert
85
+ │ └── given that deposited strategy is called
86
+ │ │ └── it should withdraw tokens from strategy with token balanceOf() update
87
+ ├── setStrategyWhitelister()
88
+ │ ├── given not called by owner
89
+ │ │ └── it should revert
90
+ │ └── given called by owner address
91
+ │ └── it should update strategyWhitelister address
92
+ ├── addStrategiesToDepositWhitelist()
93
+ │ ├── given not called by strategyWhitelister address
94
+ │ │ └── it should revert
95
+ │ └── given the strategyWhitelister address is called
96
+ │ ├── given adding one single strategy that is already whitelisted
97
+ │ │ └── it should not emit StrategyAddedToDepositWhitelist with mapping still true
98
+ │ ├── given adding one single strategy
99
+ │ │ └── it should whitelist the new strategy with mapping set to true
100
+ │ └── given adding multiple strategies to whitelist
101
+ │ └── it should whitelist all new strategies with mappings set to true
102
+ └── removeStrategiesFromDepositWhitelist()
103
+ ├── given not called by strategyWhitelister address
104
+ │ └── it should revert
105
+ └── given called by strategyWhitelister address
106
+ ├── given removing one single strategy that is not whitelisted
107
+ │ └── it shouldn't emit StrategyRemovedFromDepositWhitelist with mapping still false
108
+ ├── given removing one single strategy
109
+ │ └── it should de-whitelist the new strategy with mapping set to false
110
+ └── given removing multiple strategies to whitelist
111
+ └── it should de-whitelist all specified strategies with mappings set to false
0 commit comments