We are thrilled that you want to contribute to our contracts! The best way to contribute to the project is to get familiarized with the code, fork it, make your contributions and then create a pull request to be merged into the project.
The first thing you need to do is to fork the repository to your GitHub account and clone it to your local machine.
- Fork the repository.
- Go to our repository, i.e. White Whale Defi Platform.
- Click on the "fork" button located on the top right corner of the page.
- Click on your GitHub account where you want to fork the repo.
- Clone your fork to your local machine, preferably using the SSH URL. If you have issues cloning this repo, look at the GitHub docs.
git clone [email protected]:$USER/contracts.git
orgit clone https://github.com/$USER/contracts.git
- Set up your git user locally if you haven't already.
git config --global user.name "your name or alias"
git config --global user.email "your email address"
- Install our pre-commit hook. Do not skip this step. This will make sure that your code doesn't have any issues and is formatted correctly before you even commit. If you don't install this, you risk your future pull request to fail on CI.
./scripts/git_hooks/pre-commit.sh --install
- Make your contributions locally. The following are recommendations so that it is easier for anyone to understand what you are trying to achieve:
- Please make sure to use clear commit messages.
- Please favor small commits instead of large ones.
- Make sure to update the schemas if you have modified the messages.
cargo schema
- Make sure your code compiles, both for debug and production.
cargo build
cargo wasm
docker run --rm -v "$(pwd)":/code \ --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ cosmwasm/workspace-optimizer:0.12.3
- Test your code. Any changes you introduce need to be tested. Untested code will be rejected. If you are not sure how to create tests, please refer to existing ones.
cargo test
- Push your changes to your repository.
git push --set-upstream $YOUR_ORIGIN $YOUR_BRANCH_NAME"
- Create a pull request. Go to your repository and create a pull request against White Whale's repository main branch as base.
- Please fill in the template presented to you when creating the pull request. Follow the instructions on the template.
- Pull request that doesn't follow the template or is not filled in properly will be considered incomplete.
- Follow up the discussions on the PR as there might be requests from other members.
- Wait for your PR to be approved and merged.
Thank you so much for taking the time to review our contracts and help decentralizing the enforcement the peg! #BeTheWhale
When in doubt, please take a look at our Litepaper or our contract's documentation.