Skip to content

Commit eccdfd4

Browse files
Merge pull request #24 from Layr-Labs/auto-doc-update
Auto doc update
2 parents 9dcef9a + 9baa155 commit eccdfd4

27 files changed

+553
-116
lines changed

docs/Guaranteed-stake-updates.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Below, a whitelisted contract refers to a contract that is a part of a middlewar
88

99
For each operator, the Slasher contract stores:
1010

11-
1. A `mapping(address => mapping(address => MiddlewareDetails))`, from operator address to contract whitelisted by the operator to slash them, to [details](https://github.com/Layr-Labs/eignlayr-contracts/blob/master/src/contracts/interfaces/ISlasher.sol) about that contract formatted as
11+
1. A `mapping(address => mapping(address => MiddlewareDetails))`, from operator address to contract whitelisted by the operator to slash them, to [details](../src/contracts/contracts/interfaces/ISlasher.sol) about that contract formatted as
1212
```solidity
1313
struct MiddlewareDetails {
1414
// the UTC timestamp before which the contract is allowed to slash the user

docs/docgen/core/DelegationManager.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ uint8 PAUSED_NEW_DELEGATION
2020
bytes4 ERC1271_MAGICVALUE
2121
```
2222

23+
### ORIGINAL_CHAIN_ID
24+
25+
```solidity
26+
uint256 ORIGINAL_CHAIN_ID
27+
```
28+
2329
### onlyStrategyManager
2430

2531
```solidity

docs/docgen/core/DelegationManagerStorage.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,30 +58,32 @@ The Slasher contract for EigenLayer
5858
mapping(address => mapping(contract IStrategy => uint256)) operatorShares
5959
```
6060

61-
returns the total number of shares in `strategy` that are delegated to `operator`.
61+
Mapping: operator => strategy => total number of shares in the strategy delegated to the operator
6262

6363
### delegationTerms
6464

6565
```solidity
6666
mapping(address => contract IDelegationTerms) delegationTerms
6767
```
6868

69-
returns the DelegationTerms of the `operator`, which may mediate their interactions with stakers who delegate to them.
69+
Mapping: operator => delegation terms contract
7070

7171
### delegatedTo
7272

7373
```solidity
7474
mapping(address => address) delegatedTo
7575
```
7676

77-
returns the address of the operator that `staker` is delegated to.
77+
Mapping: staker => operator whom the staker has delegated to
7878

7979
### nonces
8080

8181
```solidity
8282
mapping(address => uint256) nonces
8383
```
8484

85+
Mapping: delegator => number of signed delegation nonce (used in delegateToBySignature)
86+
8587
### constructor
8688

8789
```solidity

docs/docgen/core/Slasher.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ operator =>
9393
### MiddlewareTimesAdded
9494

9595
```solidity
96-
event MiddlewareTimesAdded(address operator, uint256 index, uint32 stalestUpdateBlock, uint32 latestServeUntil)
96+
event MiddlewareTimesAdded(address operator, uint256 index, uint32 stalestUpdateBlock, uint32 latestServeUntilBlock)
9797
```
9898

9999
Emitted when a middleware times is added to `operator`'s array.
@@ -109,10 +109,10 @@ Emitted when `operator` begins to allow `contractAddress` to slash them.
109109
### SlashingAbilityRevoked
110110

111111
```solidity
112-
event SlashingAbilityRevoked(address operator, address contractAddress, uint32 contractCanSlashOperatorUntil)
112+
event SlashingAbilityRevoked(address operator, address contractAddress, uint32 contractCanSlashOperatorUntilBlock)
113113
```
114114

115-
Emitted when `contractAddress` signals that it will no longer be able to slash `operator` after the UTC timestamp `contractCanSlashOperatorUntil`.
115+
Emitted when `contractAddress` signals that it will no longer be able to slash `operator` after the `contractCanSlashOperatorUntilBlock`.
116116

117117
### OperatorFrozen
118118

@@ -192,11 +192,11 @@ _Callable only by the contract owner (i.e. governance)._
192192
### recordFirstStakeUpdate
193193

194194
```solidity
195-
function recordFirstStakeUpdate(address operator, uint32 serveUntil) external
195+
function recordFirstStakeUpdate(address operator, uint32 serveUntilBlock) external
196196
```
197197

198198
this function is a called by middlewares during an operator's registration to make sure the operator's stake at registration
199-
is slashable until serveUntil
199+
is slashable until serveUntilBlock
200200

201201
_adds the middleware's slashing contract to the operator's linked list_
202202

@@ -205,16 +205,16 @@ _adds the middleware's slashing contract to the operator's linked list_
205205
| Name | Type | Description |
206206
| ---- | ---- | ----------- |
207207
| operator | address | the operator whose stake update is being recorded |
208-
| serveUntil | uint32 | the timestamp until which the operator's stake at the current block is slashable |
208+
| serveUntilBlock | uint32 | the block until which the operator's stake at the current block is slashable |
209209

210210
### recordStakeUpdate
211211

212212
```solidity
213-
function recordStakeUpdate(address operator, uint32 updateBlock, uint32 serveUntil, uint256 insertAfter) external
213+
function recordStakeUpdate(address operator, uint32 updateBlock, uint32 serveUntilBlock, uint256 insertAfter) external
214214
```
215215

216216
this function is a called by middlewares during a stake update for an operator (perhaps to free pending withdrawals)
217-
to make sure the operator's stake at updateBlock is slashable until serveUntil
217+
to make sure the operator's stake at updateBlock is slashable until serveUntilBlock
218218

219219
_insertAfter should be calculated offchain before making the transaction that calls this. this is subject to race conditions,
220220
but it is anticipated to be rare and not detrimental._
@@ -225,35 +225,35 @@ _insertAfter should be calculated offchain before making the transaction that ca
225225
| ---- | ---- | ----------- |
226226
| operator | address | the operator whose stake update is being recorded |
227227
| updateBlock | uint32 | the block for which the stake update is being recorded |
228-
| serveUntil | uint32 | the timestamp until which the operator's stake at updateBlock is slashable |
228+
| serveUntilBlock | uint32 | the block until which the operator's stake at updateBlock is slashable |
229229
| insertAfter | uint256 | the element of the operators linked list that the currently updating middleware should be inserted after |
230230

231231
### recordLastStakeUpdateAndRevokeSlashingAbility
232232

233233
```solidity
234-
function recordLastStakeUpdateAndRevokeSlashingAbility(address operator, uint32 serveUntil) external
234+
function recordLastStakeUpdateAndRevokeSlashingAbility(address operator, uint32 serveUntilBlock) external
235235
```
236236

237237
this function is a called by middlewares during an operator's deregistration to make sure the operator's stake at deregistration
238-
is slashable until serveUntil
238+
is slashable until serveUntilBlock
239239

240240
_removes the middleware's slashing contract to the operator's linked list and revokes the middleware's (i.e. caller's) ability to
241-
slash `operator` once `serveUntil` is reached_
241+
slash `operator` once `serveUntilBlock` is reached_
242242

243243
#### Parameters
244244

245245
| Name | Type | Description |
246246
| ---- | ---- | ----------- |
247247
| operator | address | the operator whose stake update is being recorded |
248-
| serveUntil | uint32 | the timestamp until which the operator's stake at the current block is slashable |
248+
| serveUntilBlock | uint32 | the block until which the operator's stake at the current block is slashable |
249249

250-
### contractCanSlashOperatorUntil
250+
### contractCanSlashOperatorUntilBlock
251251

252252
```solidity
253-
function contractCanSlashOperatorUntil(address operator, address serviceContract) external view returns (uint32)
253+
function contractCanSlashOperatorUntilBlock(address operator, address serviceContract) external view returns (uint32)
254254
```
255255

256-
Returns the UTC timestamp until which `serviceContract` is allowed to slash the `operator`.
256+
Returns the block until which `serviceContract` is allowed to slash the `operator`.
257257

258258
### latestUpdateBlock
259259

@@ -339,13 +339,13 @@ function getMiddlewareTimesIndexBlock(address operator, uint32 index) external v
339339

340340
Getter function for fetching `_operatorToMiddlewareTimes[operator][index].stalestUpdateBlock`.
341341

342-
### getMiddlewareTimesIndexServeUntil
342+
### getMiddlewareTimesIndexServeUntilBlock
343343

344344
```solidity
345-
function getMiddlewareTimesIndexServeUntil(address operator, uint32 index) external view returns (uint32)
345+
function getMiddlewareTimesIndexServeUntilBlock(address operator, uint32 index) external view returns (uint32)
346346
```
347347

348-
Getter function for fetching `_operatorToMiddlewareTimes[operator][index].latestServeUntil`.
348+
Getter function for fetching `_operatorToMiddlewareTimes[operator][index].latestServeUntilBlock`.
349349

350350
### operatorWhitelistedContractsLinkedListSize
351351

@@ -398,7 +398,7 @@ function _optIntoSlashing(address operator, address contractAddress) internal
398398
### _revokeSlashingAbility
399399

400400
```solidity
401-
function _revokeSlashingAbility(address operator, address contractAddress, uint32 serveUntil) internal
401+
function _revokeSlashingAbility(address operator, address contractAddress, uint32 serveUntilBlock) internal
402402
```
403403

404404
### _freezeOperator
@@ -416,7 +416,7 @@ function _resetFrozenStatus(address previouslySlashedAddress) internal
416416
### _recordUpdateAndAddToMiddlewareTimes
417417

418418
```solidity
419-
function _recordUpdateAndAddToMiddlewareTimes(address operator, uint32 updateBlock, uint32 serveUntil) internal
419+
function _recordUpdateAndAddToMiddlewareTimes(address operator, uint32 updateBlock, uint32 serveUntilBlock) internal
420420
```
421421

422422
records the most recent updateBlock for the currently updating middleware and appends an entry to the operator's list of
@@ -429,8 +429,8 @@ _this function is only called during externally called stake updates by middlewa
429429
| Name | Type | Description |
430430
| ---- | ---- | ----------- |
431431
| operator | address | the entity whose stake update is being recorded |
432-
| updateBlock | uint32 | the block number for which the currently updating middleware is updating the serveUntil for |
433-
| serveUntil | uint32 | the timestamp until which the operator's stake at updateBlock is slashable |
432+
| updateBlock | uint32 | the block number for which the currently updating middleware is updating the serveUntilBlock for |
433+
| serveUntilBlock | uint32 | the block until which the operator's stake at updateBlock is slashable |
434434

435435
### _updateMiddlewareList
436436

docs/docgen/core/StrategyManager.md

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ uint8 PAUSED_DEPOSITS
2828
uint8 PAUSED_WITHDRAWALS
2929
```
3030

31+
### ORIGINAL_CHAIN_ID
32+
33+
```solidity
34+
uint256 ORIGINAL_CHAIN_ID
35+
```
36+
3137
### ERC1271_MAGICVALUE
3238

3339
```solidity
@@ -89,7 +95,7 @@ Emitted when a new withdrawal is queued by `depositor`.
8995
### WithdrawalCompleted
9096

9197
```solidity
92-
event WithdrawalCompleted(address depositor, address withdrawer, bytes32 withdrawalRoot)
98+
event WithdrawalCompleted(address depositor, uint96 nonce, address withdrawer, bytes32 withdrawalRoot)
9399
```
94100

95101
Emitted when a queued withdrawal is completed
@@ -144,12 +150,6 @@ modifier onlyFrozen(address staker)
144150
modifier onlyEigenPodManager()
145151
```
146152

147-
### onlyEigenPod
148-
149-
```solidity
150-
modifier onlyEigenPod(address podOwner, address pod)
151-
```
152-
153153
### onlyStrategyWhitelister
154154

155155
```solidity
@@ -179,7 +179,7 @@ constructor(contract IDelegationManager _delegation, contract IEigenPodManager _
179179
### initialize
180180

181181
```solidity
182-
function initialize(address initialOwner, contract IPauserRegistry _pauserRegistry, uint256 initialPausedStatus, uint256 _withdrawalDelayBlocks) external
182+
function initialize(address initialOwner, address initialStrategyWhitelister, contract IPauserRegistry _pauserRegistry, uint256 initialPausedStatus, uint256 _withdrawalDelayBlocks) external
183183
```
184184

185185
Initializes the strategy manager contract. Sets the `pauserRegistry` (currently **not** modifiable after being set),
@@ -190,6 +190,7 @@ and transfers contract ownership to the specified `initialOwner`.
190190
| Name | Type | Description |
191191
| ---- | ---- | ----------- |
192192
| initialOwner | address | Ownership of this contract is transferred to this address. |
193+
| initialStrategyWhitelister | address | The initial value of `strategyWhitelister` to set. |
193194
| _pauserRegistry | contract IPauserRegistry | Used for access control of pausing. |
194195
| initialPausedStatus | uint256 | |
195196
| _withdrawalDelayBlocks | uint256 | The initial value of `withdrawalDelayBlocks` to set. |
@@ -238,7 +239,10 @@ function depositIntoStrategy(contract IStrategy strategy, contract IERC20 token,
238239
Deposits `amount` of `token` into the specified `strategy`, with the resultant shares credited to `depositor`
239240

240241
_The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.
241-
Cannot be called by an address that is 'frozen' (this function will revert if the `msg.sender` is frozen)._
242+
Cannot be called by an address that is 'frozen' (this function will revert if the `msg.sender` is frozen).
243+
244+
WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors
245+
where the token balance and corresponding strategy shares are not in syncupon reentrancy._
242246

243247
#### Parameters
244248

@@ -260,7 +264,10 @@ who must sign off on the action
260264
_The `msg.sender` must have previously approved this contract to transfer at least `amount` of `token` on their behalf.
261265
A signature is required for this function to eliminate the possibility of griefing attacks, specifically those
262266
targetting stakers who may be attempting to undelegate.
263-
Cannot be called on behalf of a staker that is 'frozen' (this function will revert if the `staker` is frozen)._
267+
Cannot be called on behalf of a staker that is 'frozen' (this function will revert if the `staker` is frozen).
268+
269+
WARNING: Depositing tokens that allow reentrancy (eg. ERC-777) into a strategy is not recommended. This can lead to attack vectors
270+
where the token balance and corresponding strategy shares are not in syncupon reentrancy_
264271

265272
#### Parameters
266273

@@ -334,6 +341,17 @@ _middlewareTimesIndex should be calculated off chain before calling this functio
334341
| middlewareTimesIndex | uint256 | is the index in the operator that the staker who triggered the withdrawal was delegated to's middleware times array |
335342
| receiveAsTokens | bool | If true, the shares specified in the queued withdrawal will be withdrawn from the specified strategies themselves and sent to the caller, through calls to `queuedWithdrawal.strategies[i].withdraw`. If false, then the shares in the specified strategies will simply be transferred to the caller directly. |
336343

344+
### completeQueuedWithdrawals
345+
346+
```solidity
347+
function completeQueuedWithdrawals(struct IStrategyManager.QueuedWithdrawal[] queuedWithdrawals, contract IERC20[][] tokens, uint256[] middlewareTimesIndexes, bool[] receiveAsTokens) external
348+
```
349+
350+
Used to complete the specified `queuedWithdrawals`. The function caller must match `queuedWithdrawals[...].withdrawer`
351+
352+
_Array-ified version of `completeQueuedWithdrawal`
353+
middlewareTimesIndex should be calculated off chain before calling this function by finding the first index that satisfies `slasher.canWithdraw`_
354+
337355
### slashShares
338356

339357
```solidity
@@ -456,6 +474,14 @@ Removes `strategy` from `depositor`'s dynamic array of strategies, i.e. from `st
456474
_the provided `strategyIndex` input is optimistically used to find the strategy quickly in the list. If the specified
457475
index is incorrect, then we revert to a brute-force search._
458476

477+
### _completeQueuedWithdrawal
478+
479+
```solidity
480+
function _completeQueuedWithdrawal(struct IStrategyManager.QueuedWithdrawal queuedWithdrawal, contract IERC20[] tokens, uint256 middlewareTimesIndex, bool receiveAsTokens) internal
481+
```
482+
483+
Internal function for completeing the given `queuedWithdrawal`.
484+
459485
### _undelegate
460486

461487
```solidity

docs/docgen/core/StrategyManagerStorage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ constructor(contract IDelegationManager _delegation, contract IEigenPodManager _
151151
### __gap
152152

153153
```solidity
154-
uint256[41] __gap
154+
uint256[40] __gap
155155
```
156156

157157
_This empty reserved space is put in place to allow future versions to add new

docs/docgen/interfaces/IBLSRegistry.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ function apkUpdateBlockNumbers(uint256 index) external view returns (uint32)
4646

4747
returns the block number at which the `index`th APK update occurred
4848

49-
### whitelister
49+
### operatorWhitelister
5050

5151
```solidity
52-
function whitelister() external view returns (address)
52+
function operatorWhitelister() external view returns (address)
5353
```
5454

55-
### whitelistEnabled
55+
### operatorWhitelistEnabled
5656

5757
```solidity
58-
function whitelistEnabled() external view returns (bool)
58+
function operatorWhitelistEnabled() external view returns (bool)
5959
```
6060

6161
### whitelisted
@@ -64,10 +64,10 @@ function whitelistEnabled() external view returns (bool)
6464
function whitelisted(address) external view returns (bool)
6565
```
6666

67-
### setWhitelistStatus
67+
### setOperatorWhitelistStatus
6868

6969
```solidity
70-
function setWhitelistStatus(bool _whitelistEnabled) external
70+
function setOperatorWhitelistStatus(bool _operatorWhitelistEnabled) external
7171
```
7272

7373
### addToOperatorWhitelist

docs/docgen/interfaces/IBeaconChainOracle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function beaconStateRootAtBlockNumber(uint64 blockNumber) external view returns
1818

1919
Mapping: Beacon Chain blockNumber => the Beacon Chain state root at the specified blockNumber.
2020

21-
_This will return `bytes32(0)` if the state root is not yet finalized at the blockNumber._
21+
_This will return `bytes32(0)` if the state root at the specified blockNumber is not yet confirmed._
2222

2323
### isOracleSigner
2424

docs/docgen/interfaces/IDelayedWithdrawalRouter.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ function userWithdrawals(address user) external view returns (struct IDelayedWit
7575

7676
Getter function for the mapping `_userWithdrawals`
7777

78+
### claimableUserDelayedWithdrawals
79+
80+
```solidity
81+
function claimableUserDelayedWithdrawals(address user) external view returns (struct IDelayedWithdrawalRouter.DelayedWithdrawal[])
82+
```
83+
84+
Getter function to get all delayedWithdrawals that are currently claimable by the `user`
85+
7886
### userDelayedWithdrawalByIndex
7987

8088
```solidity

docs/docgen/interfaces/IEigenPod.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,14 @@ function hasRestaked() external view returns (bool)
129129

130130
an indicator of whether or not the podOwner has ever "fully restaked" by successfully calling `verifyCorrectWithdrawalCredentials`.
131131

132+
### mostRecentWithdrawalBlockNumber
133+
134+
```solidity
135+
function mostRecentWithdrawalBlockNumber() external view returns (uint64)
136+
```
137+
138+
block number of the most recent withdrawal
139+
132140
### provenPartialWithdrawal
133141

134142
```solidity

0 commit comments

Comments
 (0)