-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add simiple slasher starting point
- Loading branch information
1 parent
c8a8e16
commit 9d5c200
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.12; | ||
|
||
import {Initializable} from "@openzeppelin-upgrades/contracts/proxy/utils/Initializable.sol"; | ||
import {IServiceManager} from "../interfaces/IServiceManager.sol"; | ||
import {SlasherStorage} from "./SlasherStorage.sol"; | ||
import {IAllocationManagerTypes} from "eigenlayer-contracts/src/contracts/interfaces/IAllocationManager.sol"; | ||
import {IStrategy} from "eigenlayer-contracts/src/contracts/interfaces/IStrategy.sol"; | ||
|
||
contract SimpleSlasher is Initializable, SlasherStorage { | ||
function initialize(address _serviceManager) public initializer { | ||
serviceManager = _serviceManager; | ||
} | ||
|
||
function slashOperator( | ||
address operator, | ||
uint32 operatorSetId, | ||
IStrategy[] memory strategies, | ||
uint256 wadToSlash, | ||
string memory description | ||
) external { | ||
|
||
IAllocationManagerTypes.SlashingParams memory params = IAllocationManagerTypes.SlashingParams({ | ||
operator: operator, | ||
operatorSetId: operatorSetId, | ||
strategies: strategies, | ||
wadToSlash: wadToSlash, | ||
description: description | ||
}); | ||
|
||
IServiceManager(serviceManager).slashOperator(params); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.12; | ||
|
||
contract SlasherStorage { | ||
address public serviceManager; | ||
|
||
uint256[49] private __gap; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters