Slashed

Event v101 → current #9

Emitted when tokens are removed as punishment.

View events on chain

From Chain Metadata

Some amount was removed from the account (e.g. for misbehavior).

Triggers

Preconditions

  • Account has balance to slash
  • Slash condition triggered

Effects

Postconditions

  • Account balance decreased by slash amount

Side Effects

  • Slashed funds may be burned or redistributed

Event Data

#NameTypeDescription
0
who
AccountId Who account address (hex -> SS58)
1
amount
u64 Amount in RAO (÷10⁹ for TAO) (RAO -> TAO (/ 10^9))

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 });

// Subscribe to Slashed events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Balances") &&
      event.method === "Slashed"
    )
    .forEach(({ event }) => {
      console.log("Slashed:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
5
Event Index
9
First Version
v101
Current Version
v393