update_cap

Call v273 → current #8

Updates the funding cap for a crowdloan.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developerssubnet owners

The Big Picture

Adjust target - lowering below raised enables finalization.

Use Cases

  • Adjust funding goal

From Chain Metadata

Update the cap of a non-finalized crowdloan. 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 update the cap of. `new_cap`: The new cap.

Input Parameters

#NameTypeDescription
0
crowdloan_id
Compact<u32> Cptcrowdloan_id (Compact<u32>) (SCALE compact -> integer)
1
new_cap
Compact<u64> Cptnew_cap (Compact<u64>) (SCALE compact -> integer)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Crowdloan not finalized
  • Signer is creator
  • Cap exceeds deposit

Effects

Events Emitted

Storage Modified

Postconditions

  • Cap updated
  • CapUpdated event emitted

Side Effects

  • If lowered below raised, may become finalizable

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

const call = api.tx[stringCamelCase("Crowdloan")][stringCamelCase("update_cap")](
  crowdloan_id,
  new_cap
);

Runtime Info

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