Skip to content

Commit

Permalink
dao-abc-factory contract
Browse files Browse the repository at this point in the history
Creates new cw-abc DAOs.
  • Loading branch information
JakeHartnell committed Dec 23, 2023
1 parent 1d7846c commit 9f78478
Show file tree
Hide file tree
Showing 13 changed files with 828 additions and 5 deletions.
20 changes: 20 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 @@ -101,6 +101,7 @@ cw-wormhole = { path = "./packages/cw-wormhole", version = "2.4.0" }
cw20-stake = { path = "./contracts/staking/cw20-stake", version = "2.4.0" }
cw721-controllers = { path = "./packages/cw721-controllers", version = "2.4.0" }
cw721-roles = { path = "./contracts/external/cw721-roles", version = "2.4.0" }
dao-abc-factory = { path = "/contracts/external/dao-abc-factory", version = "*" }
dao-cw721-extensions = { path = "./packages/dao-cw721-extensions", version = "2.4.0" }
dao-dao-core = { path = "./contracts/dao-dao-core", version = "2.4.0" }
dao-dao-macros = { path = "./packages/dao-dao-macros", version = "2.4.0" }
Expand Down
2 changes: 1 addition & 1 deletion contracts/external/cw-abc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Implments an [Augmented Bonding Curve](https://medium.com/commonsstack/deep-dive

Forked from and heavily inspired by the work on [cw20-bonding](https://github.com/cosmwasm/cw-tokens/tree/main/contracts/cw20-bonding). This contract uses native and token factory tokens instead.

NOTE: this contract is unaudited and experimental. NOT RECOMMENDED FOR PRODUCTION USE.
NOTE: this contract is NOT AUDITED and experimental. NOT RECOMMENDED FOR PRODUCTION USE. Use at your own risk.

## What are Augmented Bonding Curves?
Before we get to the *Augmented* part, we must first describe bonding curves themselves.
Expand Down
8 changes: 4 additions & 4 deletions contracts/external/cw-abc/src/queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn get_denom(deps: Deps) -> StdResult<DenomResponse> {

pub fn query_donations(
deps: Deps,
start_aftor: Option<String>,
start_after: Option<String>,
limit: Option<u32>,
) -> StdResult<DonationsResponse> {
let donations = cw_paginate_storage::paginate_map(
Expand All @@ -50,7 +50,7 @@ pub fn query_donations(
querier: QuerierWrapper::new(deps.querier.deref()),
},
&DONATIONS,
start_aftor
start_after
.map(|addr| deps.api.addr_validate(&addr))
.transpose()?
.as_ref(),
Expand All @@ -64,7 +64,7 @@ pub fn query_donations(
/// Query hatchers who contributed during the hatch phase
pub fn query_hatchers(
deps: Deps,
start_aftor: Option<String>,
start_after: Option<String>,
limit: Option<u32>,
) -> StdResult<HatchersResponse> {
let hatchers = cw_paginate_storage::paginate_map(
Expand All @@ -74,7 +74,7 @@ pub fn query_hatchers(
querier: QuerierWrapper::new(deps.querier.deref()),
},
&HATCHERS,
start_aftor
start_after
.map(|addr| deps.api.addr_validate(&addr))
.transpose()?
.as_ref(),
Expand Down
4 changes: 4 additions & 0 deletions contracts/external/dao-abc-factory/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
unit-test = "test --lib"
schema = "run --example schema"
35 changes: 35 additions & 0 deletions contracts/external/dao-abc-factory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "dao-abc-factory"
authors = ["Jake Hartnell"]
description = "A factory contract for cw-abc, intended for use with DAO DAO."
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }
version = { workspace = true }

[lib]
crate-type = ["cdylib", "rlib"]

[features]
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all instantiate/execute/query exports
library = []

[dependencies]
cosmwasm-std = { workspace = true }
cosmwasm-schema = { workspace = true }
cosmwasm-storage = { workspace = true }
cw-abc = { workspace = true }
cw2 = { workspace = true }
cw-ownable = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
thiserror = { workspace = true }
dao-dao-macros = { workspace = true }
dao-interface = { workspace = true }
dao-voting = { workspace = true }
cw-tokenfactory-issuer = { workspace = true, features = ["library"] }

[dev-dependencies]
cw-multi-test = { workspace = true }
4 changes: 4 additions & 0 deletions contracts/external/dao-abc-factory/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# DAO ABC Factory
Used for creating DAOs with `dao-voting-token-staked` and `cw-abc`.

NOTE: this contract is NOT AUDITED, use at your own risk.
10 changes: 10 additions & 0 deletions contracts/external/dao-abc-factory/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use cosmwasm_schema::write_api;
use dao_abc_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg};

fn main() {
write_api! {
instantiate: InstantiateMsg,
query: QueryMsg,
execute: ExecuteMsg,
}
}
Loading

0 comments on commit 9f78478

Please sign in to comment.