create

Call v273 → current #0

Creates a new crowdloan campaign to raise funds for a project.

View calls on chain

Click items to navigate. Pan and zoom to explore.

Used by: developerssubnet ownersstakers

The Big Picture

Enables decentralized fundraising on Bittensor with built-in protections.

Use Cases

  • Launch crowdfunding campaign
  • Raise TAO for subnet development

From Chain Metadata

Create a crowdloan that will raise funds up to a maximum cap and if successful, will transfer funds to the target address if provided and dispatch the call (using creator origin). The initial deposit will be transfered to the crowdloan account and will be refunded in case the crowdloan fails to raise the cap. Additionally, the creator will pay for the execution of the call. The dispatch origin for this call must be _Signed_. Parameters: `deposit`: The initial deposit from the creator. `min_contribution`: The minimum contribution required to contribute to the crowdloan. `cap`: The maximum amount of funds that can be raised. `end`: The block number at which the crowdloan will end. `call`: The call to dispatch when the crowdloan is finalized. `target_address`: The address to transfer the raised funds to if provided.

Input Parameters

#NameTypeDescription
0
deposit
Compact<u64> CptDeposit in RAO (÷10⁹ for TAO) (RAO -> TAO (/ 10^9))
1
min_contribution
Compact<u64> Cptmin_contribution (Compact<u64>) (SCALE compact -> integer)
2
cap
Compact<u64> Cptcap (Compact<u64>) (SCALE compact -> integer)
3
end
Compact<u32> Cptend (Compact<u32>) (SCALE compact -> integer)
4
call
Option call (Option)
5
target_address
Option target_address (Option)

Permissions

Origin
Signed
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Signer has sufficient balance for deposit
  • Cap exceeds deposit
  • End block is valid

Effects

Events Emitted

Storage Modified

Postconditions

  • New crowdloan created
  • Deposit transferred
  • Created event emitted

Side Effects

  • NextCrowdloanId incremented

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 create call
const deposit = 0;
const min_contribution = 0;
const cap = 0;
const end = 0;
const call = 0 as any /* Option */;
const target_address = 0 as any /* Option */;

const call = api.tx[stringCamelCase("Crowdloan")][stringCamelCase("create")](
  deposit,
  min_contribution,
  cap,
  end,
  call,
  target_address
);

Runtime Info

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