force_slash_deposit

Call v154 → current #5

Slash a deposit from a safe-mode activator/extender (privileged origin only).

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: validatorsdevelopers

The Big Picture

The deposit mechanism deters frivolous safe-mode activations. This call lets governance punish bad actors by confiscating their deposits for abuse.

Use Cases

  • Punish frivolous safe-mode activations
  • Deter abuse of the mechanism

From Chain Metadata

Slash a deposit for an account that entered or extended safe-mode at a given historical block. This can only be called while safe-mode is entered. Emits a [`Event::DepositSlashed`] event on success. Errors with [`Error::Entered`] if safe-mode is entered. Can only be called by the [`Config::ForceDepositOrigin`] origin.

Input Parameters

#NameTypeDescription
0
account
AccountId Account account address (hex -> SS58)
1
block
u32 block (u32)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Caller is ForceDepositOrigin
  • Safe-mode is currently entered
  • Account has a deposit at the specified block

Effects

Events Emitted

Storage Modified

Postconditions

  • Deposit is slashed (not returned to account)
  • DepositSlashed event emitted

Side Effects

  • Slashed funds may go to treasury depending on config

Code Examples

import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";

const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });

// Build force_slash_deposit call
const account = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const block = 0;

const call = api.tx[stringCamelCase("SafeMode")][stringCamelCase("force_slash_deposit")](
  account,
  block
);

Runtime Info

Pallet Index
20
Call Index
5
First Version
v154
Current Version
v393