Skip to content

Commit 1d0ed63

Browse files
authored
Improve contributing docs. (DA0-DA0#448)
1 parent ee2a848 commit 1d0ed63

File tree

3 files changed

+121
-94
lines changed

3 files changed

+121
-94
lines changed

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Code of conduct
1+
# Code of conduct
22

33
Be kind to one another.
44

CONTRIBUTING.md

+96-33
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,121 @@
1-
# Welcome to the DAO DAO contributing guide <!-- omit in toc -->
1+
# Contributing to DAO DAO
22

3-
Thank you for investing your time in contributing to our project!
3+
Thanks for your interest in contributing. We're excited to welcome you
4+
into our community. :)
45

5-
Read our [Code of Conduct](./CODE_OF_CONDUCT.md) to keep our community approachable and respectable.
6+
We value kindness, humility, and low-ego communication. You can read
7+
our [Code of Conduct](./CODE_OF_CONDUCT.md) for a poetic version of
8+
this.
69

7-
All contributions will fall under our [our open-source license agreement](./LICENSE).
10+
There are many ways you can contribute.
811

9-
In this guide you will get an overview of the contribution workflow from opening an issue, creating a PR, reviewing, and merging the PR.
12+
- If you're interested in doing smart contract work, you're in the
13+
right place.
14+
- If you want to work on our UI, check out the [dao-dao-ui
15+
repo](https://github.com/DA0-DA0/dao-dao-ui).
16+
- If you want to contribute documentation, check out our [docs
17+
repo](https://github.com/DA0-DA0/docs).
1018

11-
## New contributor guide
19+
Getting started contributing to an open source project can be
20+
daunting. A great place to ask questions is the [DAO DAO
21+
Discord](https://discord.gg/sAaGuyW3D2).
1222

13-
To get an overview of the project, read the [README](README.md). Here are some resources to help you get started with open source contributions:
23+
## Getting started
1424

15-
- [Finding ways to contribute to open source on GitHub](https://docs.github.com/en/get-started/exploring-projects-on-github/finding-ways-to-contribute-to-open-source-on-github)
16-
- [Set up Git](https://docs.github.com/en/get-started/quickstart/set-up-git)
17-
- [GitHub flow](https://docs.github.com/en/get-started/quickstart/github-flow)
18-
- [Collaborating with pull requests](https://docs.github.com/en/github/collaborating-with-pull-requests)
25+
To work on the DAO DAO smart contracts you'll need a reasonable
26+
understanding of the Rust programming language. The [Rust
27+
book](https://doc.rust-lang.org/book/) is a really good place to pick
28+
this up.
1929

20-
### Issues
30+
Before picking up any issues, you may also want to read our [design
31+
wiki
32+
page](https://github.com/DA0-DA0/dao-contracts/wiki/DAO-DAO-Contracts-Design)
33+
which gives an overview of how all of the DAO DAO smart contracts fit
34+
together.
2135

22-
#### Create a new issue
36+
Our development workflow is just like a regular Rust project:
2337

24-
If you spot a problem, [search if an issue already exists](https://docs.github.com/en/github/searching-for-information-on-github/searching-on-github/searching-issues-and-pull-requests#search-by-the-title-body-or-comments). If a related issue doesn't exist, you can open a new issue using a relevant [issue form](https://github.com/DA0-DA0/dao-contracts/issues/new/choose).
38+
- `cargo build` from the repository root to build the contracts.
39+
- `cargo test` from the repository root to test the contracts.
2540

26-
#### Solve an issue
41+
To build WASM files for deploying on a blockchain, run:
2742

28-
Scan through our [existing issues](https://github.com/DA0-DA0/dao-contracts/issues) to find one that interests you. You can narrow down the search using `labels` as filters. See [Labels](/contributing/how-to-use-labels.md) for more information. As a general rule, we don’t assign issues to anyone. If you find an issue to work on, you are welcome to open a PR with a fix.
43+
```
44+
docker run --rm -v "$(pwd)":/code \
45+
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
46+
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
47+
--platform linux/amd64 \
48+
cosmwasm/workspace-optimizer:0.12.6
49+
```
2950

30-
### Make Changes
51+
From the repository root.
3152

32-
#### Make changes in the UI
53+
## Getting ready to make a PR
3354

34-
1. [Install Git LFS](https://docs.github.com/en/github/managing-large-files/versioning-large-files/installing-git-large-file-storage).
55+
Before making a PR, you'll need to do two things to get CI passing:
3556

36-
2. Fork the repository.
57+
1. Generate schema files for the contracts.
58+
2. Generate typescript interfaces from those schemas.
3759

38-
3. Create a working branch and start with your changes!
60+
To generate schema files, run:
3961

40-
### Commit your update
62+
```
63+
./scripts/schema.sh
64+
```
4165

42-
Commit the changes once you are happy with them. See [Atom's contributing guide](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages) to know how to use emoji for commit messages.
66+
To generate the typescript interface, after generating the schema
67+
files, run:
4368

44-
### Pull Request
69+
```
70+
yarn --cwd ./types install --frozen-lockfile
71+
yarn --cwd ./types build
72+
yarn --cwd ./types codegen
73+
```
4574

46-
When you're finished with the changes, create a pull request, also known as a PR.
75+
To do this you'll need [yarn](https://yarnpkg.com/) installed.
4776

48-
- Don't forget to [link the PR to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one.
49-
Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information.
50-
- We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch.
51-
- As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations).
52-
- If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues.
77+
## Deploying in a development environment
5378

54-
### Your PR is merged!
79+
Build and deploy the contracts to a local chain running in Docker with:
5580

56-
Congratulations :tada::tada: DAO DAO thanks you :sparkles:.
81+
```sh
82+
bash scripts/deploy_local.sh juno10j9gpw9t4jsz47qgnkvl5n3zlm2fz72k67rxsg
83+
```
5784

58-
Once your PR is merged, your contributions will be publicly visible.
85+
> Note: This Wasm account is from the [default
86+
> account](default-account.txt), which you can use for testing (DO NOT
87+
> store any real funds with this account). You can pass in any wasm
88+
> account address you want to use.
89+
90+
This will run a chain locally in a docker container, then build and
91+
deploy the contracts to that chain.
92+
93+
The script will output something like:
94+
95+
```sh
96+
NEXT_PUBLIC_CW20_CODE_ID=1
97+
NEXT_PUBLIC_CW4GROUP_CODE_ID=2
98+
NEXT_PUBLIC_CWCORE_CODE_ID=7
99+
NEXT_PUBLIC_CWPROPOSALSINGLE_CODE_ID=11
100+
NEXT_PUBLIC_CW4VOTING_CODE_ID=5
101+
NEXT_PUBLIC_CW20STAKEDBALANCEVOTING_CODE_ID=4
102+
NEXT_PUBLIC_STAKECW20_CODE_ID=13
103+
NEXT_PUBLIC_DAO_CONTRACT_ADDRESS=juno1zlmaky7753d2fneyhduwz0rn3u9ns8rse3tudhze8rc2g54w9ysqgjt23l
104+
NEXT_PUBLIC_V1_FACTORY_CONTRACT_ADDRESS=juno1pvrwmjuusn9wh34j7y520g8gumuy9xtl3gvprlljfdpwju3x7ucssml9ug
105+
```
106+
107+
This output can be directly copy and pased into a `.env` file in the
108+
[DAO DAO UI](https://github.com/DA0-DA0/dao-dao-ui) for local
109+
development.
110+
111+
Note, to send commands to the docker container:
112+
113+
```sh
114+
docker exec -i cosmwasm junod status
115+
```
116+
117+
Some commands require a password which defaults to `xxxxxxxxx`. You can use them like so:
118+
119+
```sh
120+
echo xxxxxxxxx | docker exec -i cosmwasm junod keys show validator -a
121+
```

README.md

+24-60
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,46 @@
11
# DAO DAO Contracts
2+
23
[![codecov](https://codecov.io/gh/DA0-DA0/dao-contracts/branch/main/graph/badge.svg?token=SCKOIPYZPV)](https://codecov.io/gh/DA0-DA0/dao-contracts)
34

5+
This is a collection for smart contracts for building composable,
6+
modular, and upgradable DAOs.
7+
8+
For an overview of our contract design, see [our
9+
wiki](https://github.com/DA0-DA0/dao-contracts/wiki/DAO-DAO-Contracts-Design).
10+
411
| Audited contracts | Description |
512
| :----------------------------------------------------------------------- | :--------------------------------------------------------- |
613
| [cw-core](contracts/cw-core) | The core module for a DAO DAO DAO. |
714
| [cw-proposal-single](contracts/cw-proposal-single) | A proposal module for single choice (yes / no) voting. |
815
| [cw20-staked-balance-voting](contracts/cw20-staked-balance-voting) | A voting power module for staked governance tokens. |
916
| [cw4-voting](contracts/cw4-voting) | A voting power module for multisig-style voting. |
1017
| [cw20-stake](contracts/cw20-stake) | A contract for staking cw20 tokens. |
18+
| [stake-external-rewards](contracts/cw20-stake-external-rewards) | A contract for providing external stakinig rewards. |
19+
| [cw20-stake-reward-distributor](contracts/cw20-stake-external-rewards) | A contract for distributing rewards via stake-cw20. |
1120

1221

1322
| Unaudited contracts | Description |
1423
| :----------------------------------------------------------------------- | :--------------------------------------------------------- |
1524
| [cw-named-groups](contracts/cw-named-groups) | A contract for managing named groups of addresses. |
16-
| [cw-proposal-sudo](contracts/cw-proposal-sudo) | A proposal module that allows an admin to control a DAO. |
17-
| [cw20-balance-voting](contracts/cw20-balance-voting) | TESTING ONLY - a voting module based on cw20 balances. |
18-
| [proposal-hooks-counter](contracts/proposal-hooks-counter) | TESTING ONLY - a contract for testing proposal hooks. |
19-
| [stake-external-rewards](contracts/cw20-stake-external-rewards) | A contract for providing external stakinig rewards. |
20-
| [cw20-stake-reward-distributor](contracts/cw20-stake-external-rewards) | A contract for distributing rewards via stake-cw20. |
2125
| [cw-proposal-multiple](contracts/cw-proposal-multiple) | A proposal module for multiple choice proposals. |
22-
Audited contracts have completed [an
23-
audit](https://github.com/securityDAO/audits/blob/7bb8e4910baaea89fddfc025591658f44adbc27c/cosmwasm/dao-contracts/v0.3%20DAO%20DAO%20audit.pdf)
24-
by security DAO. A second audit is forthcoming.
25-
26-
## Contributing
27-
28-
Interested in contributing to DAO DAO? Check out [CONTRIBUTING.md](./CONTRIBUTING.md).
29-
30-
## Deploying in a development environment
31-
32-
_Note: this will deploy the legacy version of the contracts currently
33-
running at [daodao.zone](https://daodao.zone)._
34-
35-
Build and deploy the contracts to a local chain running in Docker with:
36-
37-
```sh
38-
bash scripts/deploy_local.sh juno10j9gpw9t4jsz47qgnkvl5n3zlm2fz72k67rxsg
39-
```
40-
41-
> Note: This Wasm account is from the [default account](default-account.txt), which you can use for testing (DO NOT store any real funds with this account). You can pass in any wasm account address you want to use.
42-
43-
This will run a chain locally in a docker container, then build and deploy the contracts to that chain.
44-
45-
The script will output something like:
46-
47-
```sh
48-
NEXT_PUBLIC_CW20_CODE_ID=1
49-
NEXT_PUBLIC_CW4GROUP_CODE_ID=2
50-
NEXT_PUBLIC_CWCORE_CODE_ID=7
51-
NEXT_PUBLIC_CWPROPOSALSINGLE_CODE_ID=11
52-
NEXT_PUBLIC_CW4VOTING_CODE_ID=5
53-
NEXT_PUBLIC_CW20STAKEDBALANCEVOTING_CODE_ID=4
54-
NEXT_PUBLIC_STAKECW20_CODE_ID=13
55-
NEXT_PUBLIC_DAO_CONTRACT_ADDRESS=juno1zlmaky7753d2fneyhduwz0rn3u9ns8rse3tudhze8rc2g54w9ysqgjt23l
56-
NEXT_PUBLIC_V1_FACTORY_CONTRACT_ADDRESS=juno1pvrwmjuusn9wh34j7y520g8gumuy9xtl3gvprlljfdpwju3x7ucssml9ug
57-
```
58-
59-
You can then instantiate and interact with contracts.
60-
61-
Note, to send commands to the docker container:
62-
63-
```sh
64-
docker exec -i cosmwasm junod status
65-
```
6626

67-
Some commands require a password which defaults to `xxxxxxxxx`. You can use them like so:
27+
Audited contracts have completed audits by
28+
[securityDAO](https://github.com/securityDAO/audits/blob/7bb8e4910baaea89fddfc025591658f44adbc27c/cosmwasm/dao-contracts/v0.3%20DAO%20DAO%20audit.pdf)
29+
and [Oak
30+
Security](https://github.com/oak-security/audit-reports/blob/2377ba8cfcfd505283c789d706311b06771d6db4/DAO%20DAO/2022-06-22%20Audit%20Report%20-%20DAO%20DAO%20v1.0.pdf).
6831

69-
```sh
70-
echo xxxxxxxxx | docker exec -i cosmwasm junod keys show validator -a
71-
```
32+
## Developers
7233

73-
## Generating schema for all contracts
74-
As we have a workflow to check schema differences on commit, to quickly run `cargo schema` against all contracts
75-
simply run the following from the repo root:
76-
```sh
77-
./scripts/schema.sh
78-
```
34+
Information about our development workflow and how to contribute can
35+
be found in [CONTRIBUTING.md](./CONTRIBUTING.md).
7936

8037
## Disclaimer
8138

82-
DAO DAO TOOLING IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND. No developer or entity involved in creating the DAO DAO UI or smart contracts will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of DAO DAO tooling, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
39+
DAO DAO TOOLING IS PROVIDED “AS IS”, AT YOUR OWN RISK, AND WITHOUT
40+
WARRANTIES OF ANY KIND. No developer or entity involved in creating
41+
the DAO DAO UI or smart contracts will be liable for any claims or
42+
damages whatsoever associated with your use, inability to use, or your
43+
interaction with other users of DAO DAO tooling, including any direct,
44+
indirect, incidental, special, exemplary, punitive or consequential
45+
damages, or loss of profits, cryptocurrencies, tokens, or anything
46+
else of value.

0 commit comments

Comments
 (0)