finalize
Call v273 → current #3Finalizes a successful crowdloan that reached its cap.
View calls on chainCall Workflow
Click items to navigate. Pan and zoom to explore.
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
| # | Name | Type | Description |
|---|---|---|---|
| 0 | crowdloan_id | Compact<u32> Cpt CrowdloanId | crowdloan_id: Crowdloan identifier (SCALE compact -> integer) |
Permissions
Permission data inferred from metadata. May be incomplete.
Requirements
- Crowdloan reached cap
- Signer is creator
Effects
Events Emitted
Storage Modified
Postconditions
- Funds transferred to target
- Optional call dispatched
- Finalized event emitted
Side Effects
- CurrentCrowdloanId set temporarily
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 finalize call (typed, named args)
const crowdloan_id = 0;
const tx = api.tx.Crowdloan.finalize({
crowdloan_id,
});Runtime Info
- Pallet Index
- 27
- Call Index
- 3
- First Version
- v273
- Current Version
- v411