Contributed

Event v273 → current #1

Emitted when TAO is contributed to a crowdloan.

View events on chain
Useful for: stakersdevelopersanalytics

The Big Picture

Someone has backed a crowdfunding campaign.

Use Cases

  • Track contributions
  • Monitor fundraising progress

From Chain Metadata

A contribution was made to an active crowdloan.

Triggers

Emitted by

Preconditions

  • Crowdloan is active
  • Contributor has balance
  • Meets minimum

Effects

Storage Modified

Postconditions

  • Contribution recorded
  • Funds transferred

Side Effects

  • Total raised increased

Event Data

#NameTypeDescription
0
crowdloan_id
u32 Crowdloan identifier
1
contributor
AccountId Account that contributed (hex -> SS58)
2
amount
u64 Amount contributed (RAO) (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 Contributed events
api.query.system.events((events) => {
  events
    .filter(({ event }) =>
      event.section === stringCamelCase("Crowdloan") &&
      event.method === "Contributed"
    )
    .forEach(({ event }) => {
      console.log("Contributed:", event.data.toHuman());
    });
});

Runtime Info

Pallet Index
27
Event Index
1
First Version
v273
Current Version
v393