Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
9914812
feat: logic for lending pool creation + tests
l0r1s Mar 27, 2025
a52b4ab
cargo clippy
l0r1s Mar 27, 2025
3a87101
cargo fmt
l0r1s Mar 27, 2025
db28624
refacto to crowdloan instead of lending pool
l0r1s Mar 28, 2025
f123607
wip move specific subnet crowdloan to a more generic crowdloan pallet
l0r1s Mar 31, 2025
5f34018
track crowdloan account id
l0r1s Mar 31, 2025
a70a1d0
contribute to crowdloan + tests
l0r1s Mar 31, 2025
8f3b883
cleanup crowdloan from subtensor pallet
l0r1s Mar 31, 2025
549724f
wip refacto + withdraw
l0r1s Mar 31, 2025
b5f9a21
added tests for withdraw
l0r1s Mar 31, 2025
d5be5ee
added refund logic + tests
l0r1s Apr 1, 2025
5c989a8
refacto + fix tests
l0r1s Apr 2, 2025
32b6171
wip finalize logic
l0r1s Apr 2, 2025
a7528bc
add finalize event
l0r1s Apr 2, 2025
5f4ef76
some fix + tests for finalize
l0r1s Apr 2, 2025
52c6ee1
refacto depositor to creator
l0r1s Apr 2, 2025
857615a
add missing test for insufficient balance from contributor
l0r1s Apr 2, 2025
87bd5af
add missing tests on bad origin (root/none)
l0r1s Apr 2, 2025
1d2b3bb
make it such we can't exceed the cap when contributing
l0r1s Apr 3, 2025
58fb6a2
fix rust
l0r1s Apr 3, 2025
0655c43
added test pallet to ensure crowdloan id is available in the dispatch…
l0r1s Apr 3, 2025
46024f1
added readme and docs to crowdloan pallet
l0r1s Apr 3, 2025
bd5d687
remove unused comments
l0r1s Apr 3, 2025
7e3faaa
fix crowdloan pallet docs
l0r1s Apr 3, 2025
c33239b
revert spaces in files
l0r1s Apr 3, 2025
2069831
fix rust
l0r1s Apr 3, 2025
b732b54
fix tests + move to mock
l0r1s Apr 7, 2025
db922ce
fix some tests
l0r1s Apr 7, 2025
e2c0c89
fix some tests + rename event
l0r1s Apr 8, 2025
f2b2607
include crowdloan pallet into runtime
l0r1s Apr 8, 2025
cca8443
wip benchmarking
l0r1s Apr 8, 2025
4d9904e
fix tests + benchmarking finalize
l0r1s Apr 8, 2025
0fc7c30
run benchmarking + add weights to extrinsic
l0r1s Apr 8, 2025
8a89914
fix min/max block duration for crowdloan
l0r1s Apr 8, 2025
549dfae
store call of crowdloan in preimage storage
l0r1s Apr 9, 2025
31aaa81
update pallet instanciation
l0r1s Apr 9, 2025
f8660d6
update benchmark
l0r1s Apr 9, 2025
321f2fd
fix clippy error
l0r1s Apr 9, 2025
70438e1
fix tests
l0r1s Apr 9, 2025
d45452a
fix rust
l0r1s Apr 9, 2025
a0b5363
change crowdloan block duration with fast blocks
l0r1s Apr 14, 2025
fef947e
refacto to use balanced/mutable instead of currency trait + allow tar…
l0r1s Apr 14, 2025
14a1525
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 14, 2025
bc498d5
update doc
l0r1s Apr 14, 2025
00da5d9
commit Cargo.lock
l0r1s Apr 14, 2025
6bc719a
updated benchmarks
l0r1s Apr 15, 2025
e0b07b1
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 15, 2025
45b3f7d
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 16, 2025
060ba7a
replace identity hash key types with xxhash
l0r1s Apr 16, 2025
4b0bce2
added crowdloan funds account to storage for easy access/verification
l0r1s Apr 16, 2025
550184f
update benchmark weights
l0r1s Apr 16, 2025
c18b21b
cargo clippy
l0r1s Apr 16, 2025
e01f988
added absolute initial deposit + refacto create and tests
l0r1s Apr 17, 2025
735bcd0
make contribute/withdraw more flexible + fix tests
l0r1s Apr 17, 2025
2712e78
rework finalize + fix/add tests
l0r1s Apr 17, 2025
f3bd17f
added dissolve extrinsic + tests
l0r1s Apr 17, 2025
c9fda71
new update_min_contribution/update_end/update_cap extrinsics + tests
l0r1s Apr 18, 2025
9316c28
rename MinimumContribution to AbsoluteMinimumContribution
l0r1s Apr 18, 2025
1b6087d
fix benchmarking + added dissolve test + rework code
l0r1s Apr 21, 2025
86d31b0
fix refund tests
l0r1s Apr 21, 2025
4b8c87c
add missing events + add dissolve benchmark
l0r1s Apr 21, 2025
778908c
updated weights
l0r1s Apr 21, 2025
eb2f098
fix doc
l0r1s Apr 21, 2025
e1d1686
set max refunds to 50 and max block duration to 60 days
l0r1s Apr 21, 2025
60950cc
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 21, 2025
1a927e1
cargo fmt
l0r1s Apr 21, 2025
1d0ac80
make call optional
l0r1s Apr 22, 2025
c34f35f
rerun benchmarking
l0r1s Apr 22, 2025
d8481a5
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 22, 2025
72be7c5
bump spec version
l0r1s Apr 22, 2025
fc553ad
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 22, 2025
9e98765
fix readme
l0r1s Apr 23, 2025
c19866d
bump spec version
l0r1s Apr 24, 2025
fc7d72e
expose CrowdloanInfoOf
l0r1s Apr 24, 2025
9fe2d89
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 24, 2025
a247b67
expose CrowdloanInfoOf fix
l0r1s Apr 24, 2025
6e2631d
expose CrowdloanId
l0r1s Apr 24, 2025
9884a22
Merge branch 'devnet-ready' into feat/crowdloan-pallet
l0r1s Apr 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pallet-admin-utils = { default-features = false, path = "pallets/admin-utils" }
pallet-collective = { default-features = false, path = "pallets/collective" }
pallet-commitments = { default-features = false, path = "pallets/commitments" }
pallet-registry = { default-features = false, path = "pallets/registry" }
pallet-crowdloan = { default-features = false, path = "pallets/crowdloan" }
pallet-subtensor = { default-features = false, path = "pallets/subtensor" }
subtensor-custom-rpc = { default-features = false, path = "pallets/subtensor/rpc" }
subtensor-custom-rpc-runtime-api = { default-features = false, path = "pallets/subtensor/runtime-api" }
Expand Down
60 changes: 60 additions & 0 deletions pallets/crowdloan/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[package]
name = "pallet-crowdloan"
version = "0.1.0"
edition = "2024"
authors = ["Bittensor Nucleus Team"]
license = "Apache-2.0"
homepage = "https://bittensor.com"
description = "FRAME crowdloan pallet"
publish = false
repository = "https://github.com/opentensor/subtensor"

[lints]
workspace = true

[dependencies]
subtensor-macros.workspace = true
scale-info = { workspace = true, features = ["derive"] }
codec = { workspace = true, features = ["max-encoded-len"] }
frame-benchmarking = { optional = true, workspace = true }
frame-support.workspace = true
frame-system.workspace = true
sp-runtime.workspace = true
sp-std.workspace = true

[dev-dependencies]
pallet-balances = { default-features = true, workspace = true }
pallet-preimage = { default-features = true, workspace = true }
sp-core = { default-features = true, workspace = true }
sp-io = { default-features = true, workspace = true }

[features]
default = ["std"]
std = [
"codec/std",
"frame-benchmarking?/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
"sp-core/std",
"pallet-balances/std",
"pallet-preimage/std",
]
runtime-benchmarks = [
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"pallet-balances/runtime-benchmarks",
"pallet-preimage/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
"sp-runtime/try-runtime",
"pallet-balances/try-runtime",
"pallet-preimage/try-runtime",
]
19 changes: 19 additions & 0 deletions pallets/crowdloan/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Crowdloan Pallet

A pallet that enables the creation and management of generic crowdloans for transferring funds and executing an arbitrary call.

Users of this pallet can create a crowdloan by providing a deposit, a cap, an end block, an optional target address and an optional call.

Users can contribute to a crowdloan by providing funds to the crowdloan they choose to support.

Once the crowdloan is finalized, the funds will be transferred to the target address if provided; otherwise, the end user is expected to transfer them manually on-chain if the call is a pallet extrinsic. The call will be dispatched with the current crowdloan ID stored as a temporary item.

If the crowdloan fails to reach the cap, the initial deposit will be returned to the creator, and contributions will be refunded to the contributors.

## Overview

## Interface

## Dispatchable Functions

License: Apache-2.0
Loading