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

Bounties Contract #715

Open
wants to merge 13 commits into
base: development
Choose a base branch
from
17 changes: 17 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 @@ -81,6 +81,7 @@ wynd-utils = "0.4"
cw-ownable = "0.5"

cw-admin-factory = { path = "./contracts/external/cw-admin-factory", version = "2.4.1" }
cw-bounties = { path = "contracts/external/cw-bounties", version = "*" }
JakeHartnell marked this conversation as resolved.
Show resolved Hide resolved
cw-denom = { path = "./packages/cw-denom", version = "2.4.1" }
cw-hooks = { path = "./packages/cw-hooks", version = "2.4.1" }
cw-paginate-storage = { path = "./packages/cw-paginate-storage", version = "2.4.1" }
Expand Down
33 changes: 33 additions & 0 deletions contracts/external/cw-bounties/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "cw-bounties"
authors = ["Jake Hartnell", "Mr T <[email protected]>"]
description = "A CosmWasm contract for creating and managing on-chain bounties."
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 }
cw-denom = { workspace = true }
cw-ownable = { workspace = true }
cw-paginate-storage = { workspace = true }
cw-storage-plus = { workspace = true }
cw-utils = { workspace = true }
cw2 = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
cosmwasm-schema = { workspace = true }
cw-multi-test = { workspace = true }
anyhow = { workspace = true }
19 changes: 19 additions & 0 deletions contracts/external/cw-bounties/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# cw-bounties

A simple bounties smart contract. The contract is instantiated with an owner who controls when bounties are payed out (usually a DAO).

NOTE: this contract has NOT BEEN AUDITED and is not recommended for production use. Use at your own risk.

## Overview

On `create` the bounty funds sent along with the transaction are taken and held in escrow.

On `update` funds are added or removed and bounty details can be updated. If the updated amount is less than the original amount, or if the `denom` for the payout has changed (for example, switching from $USDC to $JUNO), funds will be returned to the contract owner (again, usually a DAO).

On `close` funds are returned to the bounties contract owner.

Typical usage would involve a DAO DAO SubDAO with open proposal submission. Bounty hunters would be able to see a list of bounties, work on one and make a proposal to claim it.

## Future work
- [ ] Support partial claims (i.e. I did some meaninful work but didn't finish the bounty, so claiming only part of it).
- [ ] Support bounties with multiple claims (i.e. a task with the first three people to complete it pays out an equal reward to all).
11 changes: 11 additions & 0 deletions contracts/external/cw-bounties/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use cosmwasm_schema::write_api;
use cw_bounties::msg::{ExecuteMsg, InstantiateMsg, MigrateMsg, QueryMsg};

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