Git Source
Methods
BURNER_GAS_LIMIT
function BURNER_GAS_LIMIT() external view returns (uint256)
Get a gas limit for the burner.
Returns
Name | Type | Description |
---|
| uint256 | value of the burner gas limit |
BURNER_RESERVE
function BURNER_RESERVE() external view returns (uint256)
Get a reserve gas between the gas limit check and the burner’s execution.
Returns
Name | Type | Description |
---|
| uint256 | value of the reserve gas |
FACTORY
function FACTORY() external view returns (address)
Get the factory’s address.
Returns
Name | Type | Description |
---|
| address | address of the factory |
NETWORK_MIDDLEWARE_SERVICE
function NETWORK_MIDDLEWARE_SERVICE() external view returns (address)
Get the network middleware service’s address.
Returns
Name | Type | Description |
---|
| address | address of the network middleware service |
TYPE
function TYPE() external view returns (uint64)
Get the entity’s type.
Returns
Name | Type | Description |
---|
| uint64 | type of the entity |
VAULT_FACTORY
function VAULT_FACTORY() external view returns (address)
Get the vault factory’s address.
Returns
Name | Type | Description |
---|
| address | address of the vault factory |
cumulativeSlash
function cumulativeSlash(bytes32 subnetwork, address operator) external view returns (uint256)
Get a cumulative slash amount for an operator on a subnetwork.
Parameters
Name | Type | Description |
---|
subnetwork | bytes32 | full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) |
operator | address | address of the operator |
Returns
Name | Type | Description |
---|
| uint256 | cumulative slash amount |
cumulativeSlashAt
function cumulativeSlashAt(bytes32 subnetwork, address operator, uint48 timestamp, bytes hint) external view returns (uint256)
Get a cumulative slash amount for an operator on a subnetwork until a given timestamp (inclusively) using a hint.
Parameters
Name | Type | Description |
---|
subnetwork | bytes32 | full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) |
operator | address | address of the operator |
timestamp | uint48 | time point to get the cumulative slash amount until (inclusively) |
hint | bytes | hint for the checkpoint index |
Returns
Name | Type | Description |
---|
| uint256 | cumulative slash amount until the given timestamp (inclusively) |
isBurnerHook
function isBurnerHook() external view returns (bool)
Get if the burner is needed to be called on a slashing.
Returns
Name | Type | Description |
---|
| bool | if the burner is a hook |
latestSlashedCaptureTimestamp
function latestSlashedCaptureTimestamp(bytes32 subnetwork, address operator) external view returns (uint48 value)
Get the latest capture timestamp that was slashed on a subnetwork.
Parameters
Name | Type | Description |
---|
subnetwork | bytes32 | full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) |
operator | address | address of the operator |
Returns
Name | Type | Description |
---|
| uint48 | latest capture timestamp that was slashed |
slash
function slash(bytes32 subnetwork, address operator, uint256 amount, uint48 captureTimestamp, bytes hints) external nonpayable returns (uint256 slashedAmount)
Perform a slash using a subnetwork for a particular operator by a given amount using hints.
Only a network middleware can call this function.
Parameters
Name | Type | Description |
---|
subnetwork | bytes32 | full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) |
operator | address | address of the operator |
amount | uint256 | maximum amount of the collateral to be slashed |
captureTimestamp | uint48 | time point when the stake was captured |
hints | bytes | hints for checkpoints’ indexes |
Returns
Name | Type | Description |
---|
slashedAmount | uint256 | virtual amount of the collateral slashed |
slashableStake
function slashableStake(bytes32 subnetwork, address operator, uint48 captureTimestamp, bytes hints) external view returns (uint256)
Get a slashable amount of a stake got at a given capture timestamp using hints.
Parameters
Name | Type | Description |
---|
subnetwork | bytes32 | full identifier of the subnetwork (address of the network concatenated with the uint96 identifier) |
operator | address | address of the operator |
captureTimestamp | uint48 | time point to get the stake amount at |
hints | bytes | hints for the checkpoints’ indexes |
Returns
Name | Type | Description |
---|
| uint256 | slashable amount of the stake |
staticDelegateCall
function staticDelegateCall(address target, bytes data) external nonpayable
Make a delegatecall from this contract to a given target contract with a particular data (always reverts with a return data).
It allows to use this contract’s storage on-chain.
Parameters
Name | Type | Description |
---|
target | address | address of the contract to make a delegatecall to |
data | bytes | data to make a delegatecall with |
vault
function vault() external view returns (address)
Get the vault’s address.
Returns
Name | Type | Description |
---|
| address | address of the vault to perform slashings on |
Events
Initialized
event Initialized(uint64 version)
Triggered when the contract has been initialized or reinitialized.
Parameters
Name | Type | Description |
---|
version | uint64 | |
Slash
event Slash(bytes32 indexed subnetwork, address indexed operator, uint256 slashedAmount, uint48 captureTimestamp)
Emitted when a slash is performed.
Parameters
Name | Type | Description |
---|
subnetwork indexed | bytes32 | subnetwork that requested the slash |
operator indexed | address | operator that is slashed |
slashedAmount | uint256 | virtual amount of the collateral slashed |
captureTimestamp | uint48 | time point when the stake was captured |
Structs
BaseParams
struct BaseParams {
bool isBurnerHook;
}
Base parameters needed for slashers’ deployment.
Parameters
Name | Type | Description |
---|
isBurnerHook | bool | if the burner is needed to be called on a slashing |
InitParams
struct InitParams {
BaseParams baseParams;
}
Initial parameters needed for a slasher deployment.
Parameters
Name | Type | Description |
---|
baseParams | BaseParams | base parameters for slashers’ deployment |
GeneralDelegatorData
struct GeneralDelegatorData {
uint64 slasherType;
bytes data;
}
General data for the delegator.
Parameters
Name | Type | Description |
---|
slasherType | uint64 | type of the slasher |
data | bytes | slasher-dependent data for the delegator |
DelegatorData
struct DelegatorData {
uint256 slashableStake;
uint256 stakeAt;
}
Extra data for the delegator.
Parameters
Name | Type | Description |
---|
slashableStake | uint256 | amount of the slashable stake before the slash (cache) |
stakeAt | uint256 | amount of the stake at the capture time (cache) |
SlashableStakeHints
struct SlashableStakeHints {
bytes stakeHints;
bytes cumulativeSlashFromHint;
}
Hints for a slashable stake.
Parameters
Name | Type | Description |
---|
stakeHints | bytes | hints for the stake checkpoints |
cumulativeSlashFromHint | bytes | hint for the cumulative slash amount at a capture timestamp |
SlashHints
struct SlashHints {
bytes slashableStakeHints;
}
Hints for a slash.
Parameters
Name | Type | Description |
---|
slashableStakeHints | bytes | hints for the slashable stake checkpoints |