PancakeSwap
Launch App
Vietnamese
Vietnamese
  • PancakeSwap Intro
  • Get Started
    • Create a Wallet
    • Get BEP20 Tokens
    • Using PancakeSwap without Centralized Exchanges
    • Connect Your Wallet to PancakeSwap
  • Click Here for Help
    • Troubleshooting Errors
    • General FAQ
    • Fixing Stuck Pending Transactions on MetaMask
    • Binance Academy Guide
  • Contact Us
    • Business Partnerships
    • NFT Market Applications
    • Customer Support
    • Social Accounts & Communities
  • The Kitchen Team
  • Roadmap
  • Brand & Logos
  • Products
    • Exchange
      • Token Swaps
      • How to Trade
      • Liquidity Pools
      • How to Add/Remove Liquidity
      • 📝Limit Orders
        • Limit Orders FAQ
    • Yield Farming
      • How to Use Farms
      • How to Use Farms with BscScan
    • 🍯Syrup Pools
      • How to Stake in Syrup Pools
      • Auto CAKE Syrup Pool
      • Syrup Pool FAQ & Troubleshooting
    • Lottery v2
      • How to Play Lottery v2
      • Lottery FAQ
    • 🔮Prediction
      • How to Use Prediction
      • Prediction FAQ
      • Prediction Troubleshooting
    • 🖼️NFT Market
    • 🖼️NFT Profile System
      • How to Set Up an NFT Profile
      • Teams
    • IFO (Initial Farm Offering)
      • How to Participate in an IFO
      • How to Participate in an IFO with BscScan
      • Contract Details
    • Analytics (Info)
      • Analytics
    • Voting
      • How to Vote
      • How to Vote with SafePal Wallet
  • Tokenomics
    • CAKE
      • CAKE Tokenomics
      • Controlling CAKE supply
  • Developers
    • Contributing
      • Codebase Overview
    • Bug Bounty
    • Smart Contracts
      • PancakeSwap Exchange
        • Factory v2
        • Router v2
      • Main Staking/Syrup Pool/MasterChef Contract
      • Auto CAKE Syrup Pool (CakeVault)
      • Prediction V2
      • Lottery v2
Powered by GitBook
On this page
  • Setup your dev environment
  • Coding rules
  • Use the UIKit
  • Use the tools!
  • Some good practices
  • Committing
  • Creating your pull request

Was this helpful?

  1. Developers

Contributing

Thank you for expressing your interest in contributing to PancakeSwap!

PreviousControlling CAKE supplyNextCodebase Overview

Last updated 3 years ago

Was this helpful?

PancakeSwap is an open-source project. If you want to contribute to the project, this section is here to guide you through your first steps with the PancakeSwap team 🥞

Before starting any development, we highly encourage you to submit an issue on Github in order to discuss the problem, and the solution with the team.

Setup your dev environment

  1. $ git remote add upstream git@github.com:pancakeswap/pancake-frontend.git
  2. Make sure you have the latest version of the default branch ( develop or master )

    $ git checkout develop
    $ git pull upstream develop
  3. Create your own branch and install dependencies

    $ git checkout -b branch-name
    $ yarn
  4. Happy coding 🎉

Coding rules

We try to maintain as much consistency as we can between each of our repository. Your pull request has more chances to be accepted if you follow some the following rules, and write high quality code. Let's get started 💪

Use the UIKit

If a variant of a component needs to be created, use the corresponding component in the UI Kit as a base. For example:

import styled from 'styled-components'
import { Button } from '@pancakeswap-libs/uikit'

const NewButtonVariant = styled(Button)`
  // custom styles here
`

Use the tools!

Make sure your code is formatted with Prettier, and is free from any ESLint error before you submit a pull request.

Some good practices

  • Keep in mind that your code will be read and maintained by several other developers. Make it as clear and easy to update as possible.

Committing

Type
Description

build

Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)

ci

Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)

docs

Documentation only changes

feat

A new feature

fix

A bug fix

perf

A code change that improves performance

refactor

A code change that neither fixes a bug nor adds a feature

style

Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

test

Adding missing tests or correcting existing tests

Creating your pull request

Your code is ready to be submitted for review, congratulations🥳

  • All pull requests must have a description of what the PR is trying to accomplish.

  • Keep pull requests as small as possible. Larger pull requests should be broken up into smaller chunks with a dedicated base branch. Please tag the PR's that are merging into your base branch with the epic tag.

  • If possible self-review your PR and add comments where additional clarification is needed.

Thanks for helping us making PancakeSwap even more awesome ❤

Fork the repository and an . E.g.

Check the before you start doing anything. A lot of components are already created, and we don't want that you waste your time reinventing the wheel 😉

Most of our repos use , , and . Make sure you're familiar with Typescript’s best practices, and enable an ESLint and Prettier plugin for your IDE.

Keep components as small and as possible.

Use .

Our commit messages follow using .‌

More at ​

Create a as soon as possible so we can view your ongoing progress.

add upstream remote
UI Kit
Typescript
ESLint
Prettier
"dumb"
Composition over Inheritance
Conventional Commits
commitlint
Angular's guidelines
draft PR