Skip to content

Commit 542a91c

Browse files
eigenmikemMichael
authored andcommitted
feat: changing burnableShares to EnumerableMap (#1028)
* feat: changing burnableShares to EnumerableMap * style: linter * docs: storage docs * style: natspec and import * style: lint * feat: adding view function for cronjob and moving functions * fix: updating storage gap * docs: storage slots comment * feat: new bindings * docs: updating StrategyManager doc * docs: bindings --------- Co-authored-by: Michael <michael@Michaels-MacBook-Pro.local>
1 parent f19344a commit 542a91c

File tree

31 files changed

+350
-103
lines changed

31 files changed

+350
-103
lines changed

docs/core/StrategyManager.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ This method directs the `strategy` to convert the input deposit shares to tokens
250250

251251
## Burning Slashed Shares
252252

253-
The following methods handle burning of slashed shares:
253+
Slashed shares are marked as burnable, and anyone can call `burnShares` to transfer them to the default burn address. Burnable shares are stored in `burnableShares`, an [EnumerableMap](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.9.0/contracts/utils/structs/EnumerableMap.sol) with strategy contract addresses as keys and associated view functions. The following methods handle burning of slashed shares:
254254
* [`StrategyManager.increaseBurnableShares`](#increaseburnableshares)
255255
* [`StrategyManager.burnShares`](#burnshares)
256256

@@ -294,7 +294,6 @@ function burnShares(
294294
IStrategy strategy
295295
)
296296
external
297-
onlyDelegationManager
298297
```
299298

300299
Anyone can call this method to burn slashed shares previously added by the `DelegationManager` via `increaseBurnableShares`. This method resets the strategy's burnable shares to 0, and directs the corresponding `strategy` to convert the shares to tokens and transfer them to `DEFAULT_BURN_ADDRESS`, rendering them unrecoverable.

docs/storage-report/StrategyManager.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+--------------------------------------------------------|
4545
| __deprecated_thirdPartyTransfersForbidden | mapping(contract IStrategy => bool) | 211 | 0 | 32 | src/contracts/core/StrategyManager.sol:StrategyManager |
4646
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+--------------------------------------------------------|
47-
| burnableShares | mapping(contract IStrategy => uint256) | 212 | 0 | 32 | src/contracts/core/StrategyManager.sol:StrategyManager |
47+
| burnableShares | struct EnumerableMap.AddressToUintMap | 212 | 0 | 96 | src/contracts/core/StrategyManager.sol:StrategyManager |
4848
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+--------------------------------------------------------|
49-
| __gap | uint256[38] | 213 | 0 | 1216 | src/contracts/core/StrategyManager.sol:StrategyManager |
49+
| __gap | uint256[36] | 215 | 0 | 1152 | src/contracts/core/StrategyManager.sol:StrategyManager |
5050
╰----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+--------------------------------------------------------╯
5151

docs/storage-report/StrategyManagerStorage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------|
2525
| __deprecated_thirdPartyTransfersForbidden | mapping(contract IStrategy => bool) | 10 | 0 | 32 | src/contracts/core/StrategyManagerStorage.sol:StrategyManagerStorage |
2626
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------|
27-
| burnableShares | mapping(contract IStrategy => uint256) | 11 | 0 | 32 | src/contracts/core/StrategyManagerStorage.sol:StrategyManagerStorage |
27+
| burnableShares | struct EnumerableMap.AddressToUintMap | 11 | 0 | 96 | src/contracts/core/StrategyManagerStorage.sol:StrategyManagerStorage |
2828
|----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------|
29-
| __gap | uint256[38] | 12 | 0 | 1216 | src/contracts/core/StrategyManagerStorage.sol:StrategyManagerStorage |
29+
| __gap | uint256[36] | 14 | 0 | 1152 | src/contracts/core/StrategyManagerStorage.sol:StrategyManagerStorage |
3030
╰----------------------------------------------------------+------------------------------------------------------------+------+--------+-------+----------------------------------------------------------------------╯
3131

pkg/bindings/AVSDirectory/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/AllocationManager/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/BackingEigen/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/BeaconChainProofs/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/BytesLib/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/bindings/DelegationManager/binding.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)