This project contains the main features of the pancake application.
If you want to contribute, please refer to the contributing guidelines of this project.
- Set environment config for the new chain, the example is described as follow
REACT_APP_API_PROFILE = https://profile.pancakeswap.com
REACT_APP_MAIN_CHAIN_ID = "25"
REACT_APP_NODE_1 = "https://rpc-eu-1.cyborgswap.io"
REACT_APP_NODE_2 = "https://rpc-eu-2.cyborgswap.io"
REACT_APP_GTAG = "GTM-T3K6P8M"
REACT_APP_API_NFT = "https://api.ebisusbay.com"
SKIP_PREFLIGHT_CHECK = true
REACT_APP_MAIN_CHAIN_ID = "25"
REACT_APP_TEST_CHAIN_ID = "97"
REACT_APP_ROUTER_ADDRESS = "0xD3B68a35002B1d328a5414cb60Ad95F458a8cf92"
REACT_APP_FACTORY_ADDRESS = "0x6C50Ee65CFcfC59B09C570e55D76daa7c67D6da5"
REACT_APP_INIT_CODE_HASH = "0xc98c8a44f227342a1b0a885d127d26c6fedc5cc43f38c469de814ed4d0e383b1"
REACT_APP_ETHER_CURRENCY = "18|CRO|CRO"
REACT_APP_WRAPPED_ETHER_CURRENCY = "18|WCRO|Wrapped CRO|https://www.cronos.org|0x5c7f8a570d578ed84e63fdfa7b1ee72deae1ae23"
Make sure
REACT_APP_NODE_<1|2|3>
pointing to the right URL.REACT_APP_ETHER_CURRENCY
store native token information with a pipe delimiter and the following format:<decimals>|<symbol>|<name>
-
Create chain specific config 2.1 Create a new folder inside
src/config
directory and named it with the chain id. For example, if you are create a config for a new chain -- let say chainId 137 -- then name the folder like thissrc/config/137
. 2.2 Copy thesrc/config/25
config tosrc/config/137
2.3 Adjust the value -
Make sure index
0
ofBASES_TO_TRACK_LIQUIDITY_FOR
is set to wrapped native token of its chain. For example, you need to set WCRO on index0
in CRO config and WBNB token is set on index0
in BSC config -
Make sure the native token and wrapped native token is registered on
src/config/<chainId>/tokens.ts
(the key have to be in lowercase)
yarn start
The start script will:
- build the config based on the value set on the env
REACT_APP_MAIN_CHAIN_ID
. For example, ifREACT_APP_MAIN_CHAIN_ID
is having a value of25
then it will build the config using./src/config/25
config. - build sdk
- run dev server
Everytime you make a changes on the config (
./src/config/<chain_id>
) , you need to runyarn build
unless you setup a file watcher and trigger the build script everytime the change occured
You need to set the environment variables and make sure dotenv is loaded from environment variables instead of dotfiles