Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: farm on zksync #7477

Merged
merged 3 commits into from
Aug 2, 2023
Merged

feat: farm on zksync #7477

merged 3 commits into from
Aug 2, 2023

Conversation

Chef-Yogi
Copy link
Contributor

@Chef-Yogi Chef-Yogi commented Aug 2, 2023

🤖 Generated by Copilot at fb5abab

Summary

🚀🍰🌾

This pull request adds support for the zkSync mainnet, a layer 2 scaling solution for Ethereum, to the farms and farm v3 features of the PancakeSwap frontend. It updates the farms API, the tokens package, the constants, the token list, the token image component, and the trading reward config with the zkSync chain ID, subgraph URL, node URL, token address, and metadata. It also creates new files for the farm v3 configurations and the CAKE token instance for the zkSync mainnet.

Sing, O Muse, of the valiant PancakeSwap developers
Who scaled the heights of Ethereum with zkSync, the swift layer two
And added support for the CAKE token, the golden reward of the farmers
And the farm v3 feature, the ingenious invention of the master chef

Walkthrough

  • Add support for the zkSync mainnet to the farms and trading reward features (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add the ZKSYNC_NODE environment variable to the .dev.vars and wrangler.toml files to store the URL of the zkSync mainnet node (link, link)
  • Add the ZKSYNC chain ID and the corresponding subgraph URLs to the BLOCKS_CLIENT_WITH_CHAIN and V3_SUBGRAPH_CLIENTS objects to create GraphQL clients for querying the block and exchange data from the zkSync mainnet (link, link)
  • Import the zkSync chain object from the viem package and create a public client for the zkSync mainnet using the createPublicClient function in the provider.ts file (link, link)
  • Add a case for the ZKSYNC chain ID to the viemProviders object to return the zksyncClient for the zkSync mainnet in the provider.ts file (link)
  • Add the ZKSYNC chain ID to the zChainId array to filter the supported chains for the PancakeSwap v3 exchange in the v3.ts file (link)
  • Add the ZKSYNC chain ID and the corresponding token image path to the tokenImageChainNameMapping object to display the token logos for the zkSync mainnet in the TokenImage component (link)
  • Add the ZKSYNC chain ID to the SUPPORT_FARMS array to check if the zkSync mainnet is supported by the farms feature in the supportChains.ts file (link)
  • Add the ZKSYNC chain ID and an empty array to the pairs object to configure the trading reward feature for the zkSync mainnet in the index.tsx file (link)
  • Import the zksyncTokens object from the tokens package to the common/index.ts file and add the ZKSYNC chain ID and the corresponding chain name, price helper tokens, and default common price to the CHAIN_ID_TO_CHAIN_NAME, priceHelperTokens, and DEFAULT_COMMON_PRICE objects in the common/index.ts file (link, link, link, link)
  • Add the ZKSYNC chain ID to the supportedChainIdV3 array and the master chef v3 address to the masterChefV3Addresses object in the const.ts file (link, link)
  • Add the CAKE token address and metadata for the zkSync mainnet to the token list and the tokens package (link, link, link, link)
    • Add the CAKE token address and metadata for the ZKSYNC chain ID to the pancake-default.tokenlist.json file (link)
    • Import the CAKE token from the common.ts file and add the CAKE token instance for the zkSync mainnet to the zksyncTokens object in the 324.ts file (link, link)
    • Add the CAKE token instance for the zkSync mainnet to the CAKE object in the common.ts file (link)
  • Add the farm v3 configurations for the zkSync mainnet to the farms package and the farms API (link, link, link, link)
    • Create a new file named 324.ts in the constants folder to store the farm v3 configurations for the zkSync mainnet using the defineFarmV3Configs function (link)
    • Import the farm324 object from the 324.ts file and add the ZKSYNC chain ID and the corresponding farm324 object to the farmsV3ConfigChainMap object in the v3/index.ts file (link, link)
    • Add the farm v3 configurations for the zkSync mainnet to the mainnetFarms array in the v3.test.ts file (link)

@changeset-bot
Copy link

changeset-bot bot commented Aug 2, 2023

⚠️ No Changeset found

Latest commit: 960d44c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aptos-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 6:42am
blog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 6:42am
bridge ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 6:42am
uikit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 6:42am
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 2, 2023 6:42am

chefjackson
chefjackson previously approved these changes Aug 2, 2023
@Chef-Yogi Chef-Yogi merged commit 4b28f18 into develop Aug 2, 2023
12 of 13 checks passed
@Chef-Yogi Chef-Yogi deleted the feat/farm-on-zkevm branch August 2, 2023 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants