Karak Core Interactions
Managing Operator Stake in DSS
To effectively manage operator stake within a Distributed Secure Service (DSS), it's crucial to interact with the Karak Restaking Core contract, Core.sol
. One fundamental operation is fetching the vaults staked by an operator with the DSS. This can be achieved by calling the fetchVaultsStakedInDSS
function, which returns an array of vault addresses owned by the operator and staked within the DSS.
function fetchVaultsStakedInDSS(address operator, IDSS dss) public view returns (address[] memory vaults)
Each vault will contain ERC20 tokens. To determine the total amount of tokens within a vault, you can utilize the totalAssets
function in the corresponding vault contract Vault.sol
, adhering to the ERC4626 standard.
function totalAssets() external view returns (uint256);
Once you have retrieved all relevant vaults and their assets, it may be necessary to standardize tokens and amounts into a unified denomination for consistency.
Slashing Mechanism in DSS
In cases where an operator fails to meet performance standards within the DSS, slashing their staked tokens may be necessary. This process is initiated by calling the requestSlashing
function in Core.sol
, which submits a slash request for the specified operator.
struct SlashRequest {
address operator;
uint96[] slashPercentagesWad;
address[] vaults;
}
function requestSlashing(SlashRequest calldata slashingRequest) external;
After a slash request is generated, a two-day period is allotted for the slashing committee to review and potentially veto the request. If the committee decides against vetoing, the finalizeSlashing
function can be called to execute the slashing process.
function finalizeSlashing(SlasherLib.QueuedSlashing memory queuedSlashing) external;
This structured approach ensures that the DSS maintains operational integrity by holding operators accountable for their performance, supported by robust mechanisms for stake management and enforcement.