-
Notifications
You must be signed in to change notification settings - Fork 144
Bounties Contract #715
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
Open
JakeHartnell
wants to merge
13
commits into
development
Choose a base branch
from
bounties
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Bounties Contract #715
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f263a6c
First draft of cw-bounties contract
JakeHartnell 6195be2
fixed: change status on close, added: consider different denom on upd…
taitruong 3e7d91d
Add note for future work
JakeHartnell 4e77dc9
Schema
JakeHartnell b80c3d2
add author (#722)
taitruong 9b846b5
fix bug on bounty update (#730)
taitruong 23d6c76
Update schema
JakeHartnell ad7d180
Fix path
JakeHartnell 73cb89e
to_binary -> to_json_binary
JakeHartnell 983dba8
Add more info to readme, including disclaimer
JakeHartnell 0d831d0
Clean up comments
JakeHartnell 12adcb4
new_amount -> new_coin
JakeHartnell 793085a
Post rebase fixups
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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, | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.