🌐Smart Contracts and Networks

In this section, we'll guide you through the process of modifying essential variables within different parts of the project. You'll replace these variables with the addresses derived from the smart contracts you've already deployed on your network. This ensures that your project is tailored to your specific setup and configuration. Follow the instructions below to get started:

Smart Contracts

Frontend Contracts Integration:

Open the utils/constants.ts file within your project directory. This file typically contains various constant values and configurations.

  • Frontend Provider: Search for the definition of the FRONTEND_PROVIDER variable, and change it for your providers address. By following these steps, you will have successfully updated the FRONTEND_PROVIDER address to your team's multisig address, ensuring that swap fees are directed to the correct destination for hosting the frontend of your project.

Also in the same file change the other contracts addresses:

  • Multicall

  • Rewarder

  • Voter

ACTIVE_CHAIN is the network id is also going to be updated


Tokens contracts integration:

  1. Navigate to the utils/tokens.ts file within the project directory. Replace the default values of the constants with your specific configuration details. You'll need to update fields such as address, decimals, name, symbol, and image, among others, to align with your tokens: - TOKEN - OTOKEN - VTOKEN - BASE - DEMO_BASE (this token is the testing token).

  2. Add token images, for tokens. Place the token images in the public/images/tokens directory of your project, ensuring they are in PNG format. Keep in mind that the image filenames and paths must match the configurations you added in the previous step. For instance, if you used 'token.png' as the image path in step 1, make sure to name your image file 'pool.png' and save it in the public/images/tokens folder.

By following these steps, you'll effectively customize the primary tokens settings.

DEMO_BASE had a mint, REAL_BASE is going to be Wrapped Ethereum


Liquidity Pools Integration :

  1. Navigate to the utils/liquidityPools.ts file within the project directory. Replace the default values of the constants with your specific configuration details. You'll need to update fields such as address, decimals, name, symbol, and image, among others, to align with your liquidity pool tokens.

  2. Add Token Images, for your liquidity pool tokens. Place the token images in the public/images/tokens directory of your project, ensuring they are in PNG format. Keep in mind that the image filenames and paths must match the configurations you added in the previous step. For instance, if you used 'pool.png' as the image path in step 1, make sure to name your image file 'pool.png' and save it in the public/images/tokens folder.

By following these steps, you'll effectively customize the liquidity pool settings and improve the visual representation of your project.

Test Tokens Contracts:

In this step you have to do the same as the last two, this is only for testing and minting tokens on a testnet.

These LPs and Test tokens are not required in production


Network

1) Open the utils/constants.ts file within your project directory. This file contains essential network configuration variables.

2) Find the ACTIVE_CHAIN variable and modify it to specify the desired blockchain network for your project. You should set it to the network you intend to use, such as Polygon Mainnet or a testnet like Mumbai or Optimism.

export const ACTIVE_CHAIN = 80001 // POLYGON

3) Open the constants/networks.ts file within your project directory. This file contains the configuration settings for various blockchain networks.

Update these RPC endpoints to match the network you selected in step 2. Ensure you set the correct URL for your chosen network.

Lastly, you'll find website links for blockchain explorers. Update the NETWORK_SCAN object with the appropriate links for your chosen network. These links are used for viewing transaction and contract information.

By following these steps, you'll successfully configure the network settings for your project, allowing it to interact with the chosen blockchain network and provide accurate information through blockchain explorers.

Last updated