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 (32 bytes, SS58-encoded) (hex -> SS58)
1
block
u32 BlockNumberFor<T>block: Block number

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 { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build force_slash_deposit call (typed, named args)
const account = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
const block = 0;

const tx = api.tx.SafeMode.force_slash_deposit({
  account,
  block,
});

Runtime Info

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