BulkBalancesSet

Event Re-added v101 → v219, v233 → v265, v273 → v277, v290 → current #8

Emitted when balances are bulk-set (admin operation).

View events on chain
Useful for: developersanalyticsexchanges

The Big Picture

Bulk balance setting is an admin operation that modifies many account balances at once. This might happen during chain genesis, migrations, or administrative corrections. It's not a normal user operation - it signals significant administrative action on the chain.

Why This Matters

Bulk balance changes are significant events - they indicate administrative action modifying chain state. If you see this unexpectedly, investigate. During legitimate operations (genesis, migrations), it's expected. Otherwise, it's noteworthy.

Example Scenario

During a chain migration, admin needs to set balances for 1000 accounts from the old chain. BulkBalancesSet fires with the list of accounts and amounts. All migrated accounts now have their correct balances on the new chain.

Common Questions

Can normal users bulk set balances?
No, this requires admin/sudo privileges. Normal users can only transfer their own funds.
Does this create tokens out of thin air?
Potentially. Admin operations can mint, burn, or redistribute. Check if total issuance changed. Legitimate uses include migrations and corrections.
How do I know if bulk balance changes are legitimate?
Check governance announcements, verify admin key legitimacy, and compare with expected operations (genesis, announced migrations, etc.). Unexpected bulk changes warrant scrutiny.

Use Cases

  • Track administrative balance distributions
  • Monitor genesis or migration events
  • Detect unusual balance changes
  • Build chain state audit tools

How to Use This Event

  • Monitor for unexpected bulk balance changes
  • Track administrative operations on the chain
  • Build governance and audit tools

From Chain Metadata

FIXME: Not used yet

Triggers

Preconditions

  • Caller has admin/sudo privileges
  • Valid account-balance pairs

Effects

Postconditions

  • Multiple account balances updated

Side Effects

  • Administrative/genesis operation

Event Data

#NameTypeDescription
0
arg0
u16 Event field #0 (u16)
1
arg1
u16 Event field #1 (u16)

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 BulkBalancesSet events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("SubtensorModule") &&
      event.method === "BulkBalancesSet"
    )
    .forEach(({ event }) => {
      console.log("BulkBalancesSet:", event.data.toHuman());
    });
});

Version History

v101 block 1 2 args
v233 block 4,920,350 2 args
v273 block 5,659,032 2 args
v290 block 5,947,548 2 args Current

Runtime Info

View Source
Pallet Index
7
Event Index
8
First Version
v101
Current Version
v393