Skip to content

DSS Interface

To enable seemless integration with Karak Restaking Core, the DSS contract must implement the provided IDSS interface. The IDSS interface mainly consists of hooks that can be implemented by the DSS in order to perform specific actions after Karak Core functions are called.

IDSS itself extends the ERC-165 interface for Standard Interface Detection which creates a standard method to publish and detect what interfaces a smart contract implements.

interface IDSS is IERC165 {
    // Called after registering Operator to DSS
    function registrationHook(
        address operator, 
        bytes memory extraData
    ) external;
 
    // Called after unregistering Operator from DSS
    function unregistrationHook(
        address operator, 
        bytes memory extraData
    ) external;
 
    // Called after Operator requests a stake update
    function requestUpdateStakeHook(
        address operator, 
        StakeUpdateRequest memory newStake
    ) external;
 
    // Called after Operator cancels a stake update
    function cancelUpdateStakeHook(
        address operator, 
        address vault
    ) external;
 
    // Called after Operator finalizes a stake update
    function finishUpdateStakeHook(address operator) external;
 
    // Called after DSS requests a slashing
    function requestSlashingHook(
        address operator, 
        uint256[] memory slashingPercentagesWad
    ) external;
 
    // Called after a slashing is cancelled
    function cancelSlashingHook(address operator) external;
 
    // Called after a slashing is finalized
    function finishSlashingHook(address operator) external;
}

Apart from this interface, the DSS contracts can incorporate custom logic tailored to their specific operational requirements. This flexibility allows DSS contracts to extend functionality beyond basic Core interactions, accommodating unique business processes or additional data handling needs.