Skip to content

Commit 748f264

Browse files
committed
Adds stubs for "seize" and "slash"
1 parent 417942f commit 748f264

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

contracts/staking/IStaking.sol

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,23 @@ interface IStaking {
131131
function withdrawNotificationReward(address recipient, uint96 amount)
132132
external;
133133

134+
/// @notice Adds staking providers to the slashing queue along with the
135+
/// amount that should be slashed from each one of them. Can only be
136+
/// called by application authorized for all staking providers in
137+
/// the array.
138+
function slash(uint96 amount, address[] memory stakingProviders) external;
139+
140+
/// @notice Adds staking providers to the slashing queue along with the
141+
/// amount. The notifier will receive reward per each staking
142+
/// provider from notifiers treasury. Can only be called by
143+
/// application authorized for all staking providers in the array.
144+
function seize(
145+
uint96 amount,
146+
uint256 rewardMultipier,
147+
address notifier,
148+
address[] memory stakingProviders
149+
) external;
150+
134151
//
135152
//
136153
// Auxiliary functions

contracts/staking/TokenStaking.sol

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
174174
uint256 tAmount
175175
);
176176
event GovernanceTransferred(address oldGovernance, address newGovernance);
177+
event NotificationReceived(
178+
uint96 amount,
179+
uint256 rewardMultipier,
180+
address notifier,
181+
address[] stakingProviders
182+
);
177183

178184
modifier onlyGovernance() {
179185
require(governance == msg.sender, "Caller is not the governance");
@@ -506,6 +512,29 @@ contract TokenStaking is Initializable, IStaking, Checkpoints {
506512
token.safeTransfer(recipient, amount);
507513
}
508514

515+
/// @notice Stub for legacy "slash" method
516+
function slash(uint96 amount, address[] memory _stakingProviders)
517+
external
518+
override
519+
{
520+
emit NotificationReceived(amount, 0, address(0), _stakingProviders);
521+
}
522+
523+
/// @notice Stub for legacy "seize" method
524+
function seize(
525+
uint96 amount,
526+
uint256 rewardMultiplier,
527+
address notifier,
528+
address[] memory _stakingProviders
529+
) external override {
530+
emit NotificationReceived(
531+
amount,
532+
rewardMultiplier,
533+
notifier,
534+
_stakingProviders
535+
);
536+
}
537+
509538
/// @notice Delegate voting power from the stake associated to the
510539
/// `stakingProvider` to a `delegatee` address. Caller must be the
511540
/// owner of this stake.

0 commit comments

Comments
 (0)