Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mccallofthewild/cw-kickstarter
Kickstarter Crowdfunding Model in CosmWasm
https://github.com/mccallofthewild/cw-kickstarter
Last synced: 4 days ago
JSON representation
Kickstarter Crowdfunding Model in CosmWasm
- Host: GitHub
- URL: https://github.com/mccallofthewild/cw-kickstarter
- Owner: mccallofthewild
- License: apache-2.0
- Created: 2022-07-31T00:28:06.000Z (over 2 years ago)
- Default Branch: 1.0-minimal
- Last Pushed: 2022-08-06T19:37:58.000Z (over 2 years ago)
- Last Synced: 2023-03-21T10:14:55.473Z (over 1 year ago)
- Language: Rust
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cosmwasm Kickstarter Crowdfunding Contract
> **NOTE: This was built for fun in a couple hours. Not production ready. Non-standard rust patterns (top level const closures) were implemented for experimentation purposes only.**
## Summary
Simple kickstarter crowdfunding contract that enables users to fund projects, but only if they reach their funding goals by a set deadline. If the goal is reached, an execute message can be invoked. If it is not reached, the contract will automatically enable anyone to claim their funds and/or refund others.## Instantiate
* `owner` - the owner of the contract
* must be instantiator!
* `denom` - the token denomination to use for the funding.
* `goal` - the funding goal in tokens.
* `start` - the start time for the funding period to begin
* Rules:
* Optional! If not provided, the funding period will begin immediately.
* Must be in the future.
* `deadline` - the deadline for the funding goal to be reached
* Rules: `deadline` must be in the future, 60 days or less from now
* `name` - the name of the project
* Rules: less than 32 characters
* `description` - the description of the project
* Rules: less than 256 characters## Queries
* `get_config`: returns the goal, deadline, name, and description of the project
* `get_shares`: returns a user's shares in the project.
* `get_funders`: returns a list of all funders and their shares.
* `get_funds`: returns the total funds raised so far.## Actions
* `fund`: fund the project with a given amount of tokens.
* Rules:
* project must be started!
* project must not be closed!
* tokens must be more than zero!
* must be of type `Config.denom`!
* `execute`: execute the project if the goal is reached.
* Rules:
* project must be closed!
* project must be fully funded!
* `refund`: refund the project if the goal is not reached.
* Rules:
* project must be closed!
* project must be partially funded!
* `claim`: claim the project's funds if the goal is reached.
* Rules:
* project must be closed!
* project must be partially funded!## State
* `config`: the project's configuration
* `shares`: all users' shares in the project as a map
* `total_shares`: the total amount of tokens raised so far
* `execute_msg`: the message to be executed if the goal is reached