Transactions

contribute-crowdloan

Contribute TAO to an active crowdloan.

View as Markdown

Moves the amount from the signer into the crowdloan's pot. The contribution must meet the loan's minimum (and per-contributor maximum, if set) and the loan must still be open — contributing after end or past the cap fails. Contributions are not refunded automatically if the loan fails: they come back when the creator calls refund_crowdloan, or the contributor can withdraw_crowdloan themselves any time before finalization. On success, the funds go to the loan's target or fund its inner call.

SignerPalletWraps
coldkeyCrowdloanCrowdloan.contribute

Parameters

ParameterTypeRequiredDescription
crowdloan_idintegeryesIdentifier of the crowdloan, assigned when it was created.
amount_taonumber | "all"yesAmount to contribute; moved into the crowdloan's pot. Recoverable via refund or withdraw while the loan is not finalized.

Address parameters (--hotkey, --coldkey, --dest, ...) accept a raw ss58 address, an address-book or proxy-book name, or a local wallet/hotkey name.

CLI

Preview with --dry-run (shows fee, effects, and policy result without submitting), then submit:

btcli tx contribute-crowdloan \
  --crowdloan-id <int> \
  --amount-tao <amount|all> --dry-run
btcli tx contribute-crowdloan \
  --crowdloan-id <int> \
  --amount-tao <amount|all> -w my_coldkey

Python

import bittensor as sub
from bittensor.wallet import Wallet

wallet = Wallet(name="my_coldkey", hotkey="my_hotkey")
intent = sub.ContributeCrowdloan(crowdloan_id=0, amount_tao=1.0)

async with sub.Client("finney") as client:
    plan = await client.plan(intent, wallet)   # fee, effects, policy — no submission
    result = await client.execute(intent, wallet)
    if not result.success:
        print(result.error.code, result.error.remediation)

Or build it by op name, as an agent would:

await client.execute_tool("contribute_crowdloan", {...}, wallet)