finalize

Call v273 → current #3

Finalizes a successful crowdloan that reached its cap.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developerssubnet owners

The Big Picture

Transfers raised funds and optionally executes configured call.

Use Cases

  • Complete successful fundraising

From Chain Metadata

Finalize a successful crowdloan. The call will transfer the raised amount to the target address if it was provided when the crowdloan was created and dispatch the call that was provided using the creator origin. The CurrentCrowdloanId will be set to the crowdloan id being finalized so the dispatched call can access it temporarily by accessing the `CurrentCrowdloanId` storage item. The dispatch origin for this call must be _Signed_ and must be the creator of the crowdloan. Parameters: `crowdloan_id`: The id of the crowdloan to finalize.

Input Parameters

#NameTypeDescription
0
crowdloan_id
Compact<u32> Cptcrowdloan_id (Compact<u32>) (SCALE compact -> integer)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Crowdloan reached cap
  • Signer is creator

Effects

Events Emitted

Postconditions

  • Funds transferred to target
  • Optional call dispatched
  • Finalized event emitted

Side Effects

  • CurrentCrowdloanId set temporarily

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 finalize call
const crowdloan_id = 0;

const call = api.tx[stringCamelCase("Crowdloan")][stringCamelCase("finalize")](
  crowdloan_id
);

Runtime Info

Pallet Index
27
Call Index
3
First Version
v273
Current Version
v393