BuildapireferenceITangleSlashing

ITangleSlashing

Source: https://github.com/tangle-network/tnt-core/blob/main/src/interfaces/ITangleSlashing.sol

ITangleSlashing

Slashing interface for Tangle protocol

Functions

proposeSlash

function proposeSlash(uint64 serviceId, address operator, uint256 amount, bytes32 evidence) external returns (uint64 slashId)

Propose a slash against an operator

Parameters
NameTypeDescription
serviceIduint64The service where violation occurred
operatoraddressThe operator to slash
amountuint256Amount to slash
evidencebytes32Evidence hash
Return Values
NameTypeDescription
slashIduint64The ID of the created slash proposal

disputeSlash

function disputeSlash(uint64 slashId, string reason) external

Dispute a slash proposal

executeSlash

function executeSlash(uint64 slashId) external returns (uint256 actualSlashed)

Execute a slash proposal

executeSlashBatch

function executeSlashBatch(uint64[] slashIds) external returns (uint256 totalSlashed, uint256 executedCount)

Execute a batch of slashes

getExecutableSlashes

function getExecutableSlashes(uint64 fromId, uint64 toId) external view returns (uint64[] ids)

Get list of executable slash IDs in a range

cancelSlash

function cancelSlash(uint64 slashId, string reason) external

Cancel a slash proposal

setSlashConfig

function setSlashConfig(uint64 disputeWindow, bool instantSlashEnabled, uint16 maxSlashBps) external

Update slashing configuration

getSlashProposal

function getSlashProposal(uint64 slashId) external view returns (struct SlashingLib.SlashProposal)

Get slash proposal details

Events

SlashProposed

event SlashProposed(uint64 serviceId, address operator, uint256 amount, bytes32 evidence)

SlashExecuted

event SlashExecuted(uint64 serviceId, address operator, uint256 amount)