Skip to main content

ISlash

Git Source

Title: ISlash

Slashing interface for registries whose participants can be penalised by an authorised adjudicator.

Functions

slash

Reduces a user's locked balance and transfers the slashed tokens to the specified recipient. Callable only by an authorised adjudicator.

function slash(address user, uint256 amount, address recipient, bytes calldata decision) external;

Parameters

NameTypeDescription
useraddressThe user to slash.
amountuint256The amount of tokens to slash.
recipientaddressThe address that receives the slashed tokens (cannot be the caller).
decisionbytesOff-chain reference to the dispute decision.

Events

Slashed

event Slashed(address indexed user, uint256 amount, address indexed recipient, bytes decision);

Parameters

NameTypeDescription
useraddressThe user whose balance was slashed.
amountuint256The amount of tokens slashed.
recipientaddressThe address that received the slashed tokens.
decisionbytesOff-chain reference to the dispute decision.

Errors

InsufficientBalance

The user does not have enough balance to cover the slash.

error InsufficientBalance();

RecipientIsAdjudicator

The recipient cannot be the adjudicator calling slash.

error RecipientIsAdjudicator();