Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pallet-flow #8

Merged
merged 18 commits into from
Mar 13, 2022
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
root = true
[*]
indent_style=tab
indent_size=tab
tab_width=4
end_of_line=lf
charset=utf-8
trim_trailing_whitespace=true
max_line_length=120
insert_final_newline=true

[*.{yml,yaml}]
indent_style=space
indent_size=2
tab_width=8
end_of_line=lf
56 changes: 56 additions & 0 deletions flow/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[package]
name = "pallet-flow"
version = "1.0.1-dev"
authors = ["zero.io","gamedao.co"]
edition = "2018"
license = "GPL-3.0-or-later"
description = "Simple Crowdfunding module, supporting multiple campaigns, which are all settled with the platform currency."
repository = "https://github.com/gamedaoco/gamedao-protocol"

[dependencies]
serde = { version = "1.0.124", optional = true }
codec = { package = "parity-scale-codec", version = "2.3.1", default-features = false }
scale-info = { version = "1.0", default-features = false, features = ["derive"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
frame-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13", default-features = false, optional = true }

orml-traits = { path = "../../orml/traits", default-features = false }
zero-primitives = { package = "zero-primitives", path = "../../primitives", default-features = false }
gamedao-protocol-support = { package = "gamedao-protocol-support", path = "../support", default-features = false }

[dev-dependencies]
frame-support-test = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }

pallet-timestamp = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }
pallet-balances = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.13" }

orml-tokens = { path = "../../orml/tokens", default-features = false }
orml-currencies = { path = "../../orml/currencies", default-features = false }

[features]
default = ["std"]
runtime-benchmarks = ["frame-benchmarking"]
std = [
"codec/std",
"serde/std",
"scale-info/std",

"frame-support/std",
"frame-system/std",
"frame-benchmarking/std",

"sp-core/std",
"sp-std/std",
"sp-runtime/std",
"orml-traits/std",
"orml-tokens/std",
"orml-currencies/std",
"gamedao-protocol-support/std",
]
try-runtime = ["frame-support/try-runtime"]
21 changes: 21 additions & 0 deletions flow/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Module Flow

Simple Crowdfunding module, supporting multiple campaigns, which are all settled with the platform currency.

This pallet provides a simple on-chain crowdfunding mechanism:
- creator can create a campaign with individual length and amount of funds in PLAY to raise
- investor can invest his funds into one of the running campaigns and become an investor

Upon finalization:
- creator can request allocation of funds
- investors can collectively approve allocation of funds

TODO:
- supervisor can lock, cancel campaigns
...

1. create campaigns with custom funding goal and runtime
2. invest into open campaigns

3. request withdrawal (unreserve) as creator from successful campaign
4. approve withdrawals (unreserve) as investor from successfully funded campaigns
Loading