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: Revenue sharing pool #7382

Merged

Conversation

ChefMomota
Copy link
Contributor

@ChefMomota ChefMomota commented Jul 20, 2023

🤖 Generated by Copilot at 6551e42

Summary

🍰🔒💸

Added new features and components for locked CAKE staking and revenue sharing pool. Users can now view and claim the benefits of locking CAKE in the vCake contract, such as yield boost, iCake, bCake and vCake tokens. Users can also join the revenue sharing pool, which distributes protocol revenue to locked CAKE stakers. Refactored some existing components and added new hooks, functions, constants and ABIs to support the new features.

We're sailing on the CAKE ship, with vCake in our hold
We're sharing all the revenue, with stakers brave and bold
We've boosted up our yield, with iCake and bCake too
So heave away, me hearties, heave away on the count of two

Walkthrough

  • Add the revenueSharingPoolABI and vCakeABI to define the interfaces of the new contracts for the revenue sharing feature (link, link)
  • Add the addresses of the vCake and revenueSharingPool contracts to the constants file for different chains (link)
  • Add the getVCakeContract and getRevenueSharingPoolContract functions to the contractHelpers file to get the instances of the new contracts using the getContract helper function (link, link, link)
  • Add the getVCakeAddress and getRevenueSharingPoolAddress functions to the addressHelpers file to get the addresses of the new contracts from the constants file (link)
  • Add the useVCakeContract and useRevenueSharingPoolContract hooks to the useContract hook to get the instances of the new contracts with the signer and chainId parameters (link, link)
  • Add the BenefitsModal component to render a modal that shows the benefits of locked CAKE staking and the revenue sharing pool information and actions (link)
  • Add the BenefitsText component to render a text row with a title, a value, an icon and an optional tooltip for the benefits of locked CAKE staking (link)
  • Add the ClaimButton component to render a button for claiming the available rewards from the revenue sharing pool (link)
  • Add the JoinButton component to render a button for joining the revenue sharing pool by syncing the CAKE staking position with the vCake contract (link)
  • Add the LockedBenefits component to render the information about the benefits of locked CAKE staking, such as yield boost, iCake, bCake and vCake (link)
  • Add the RevenueSharing component to render the information and actions related to the revenue sharing pool for locked CAKE stakers (link)
  • Add the SharingPoolNameCell component to render the name and amount of CAKE locked in the revenue sharing pool (link)
  • Add the JoinRevenueModal component to render a modal that shows the information and action for joining the revenue sharing pool by syncing the CAKE staking position with the vCake contract (link)
  • Add the LockedStaking component to render the locked CAKE staking information and actions in a reusable way for different views (link)
  • Add the View Benefits button to the CakeVaultCard and AutoHarvest components to show the BenefitsModal when the user has a locked position and the vCake contract is initialized (link, link, link, link, link, link, link, link)
  • Use the LockedStaking component to replace the redundant code for rendering the locked CAKE staking information and actions in the LockedStakingApy component (link, link, link, link, link, link, link)
  • Use the variant prop to set the variant of the Deposit and Withdraw buttons in the LockedActions component, or default to 'primary' if not provided (link, link, link, link, link)
  • Pass the buttonVariant prop to the LockedActions component in the AutoHarvest component to set the variant of the buttons to 'subtle' (link)
  • Remove the cakePrice prop from the FarmV3Card component as it was not used in the component (link)
  • Remove the stakingToken and stakingTokenBalance props from the LockedStakingApy component as they were not used in the component anymore (link)
  • Remove the unused variables and imports from the LockedStakingApy component (link, link, link, link)

@changeset-bot
Copy link

changeset-bot bot commented Jul 20, 2023

⚠️ No Changeset found

Latest commit: 411e300

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 Jul 20, 2023

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

Name Status Preview Comments Updated (UTC)
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2023 11:41am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
aptos-web ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2023 11:41am
blog ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2023 11:41am
bridge ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2023 11:41am
uikit ⬜️ Ignored (Inspect) Visit Preview Jul 31, 2023 11:41am

@vercel
Copy link

vercel bot commented Jul 20, 2023

@ChefMomota is attempting to deploy a commit to the PancakeSwap Team on Vercel.

A member of the Team first needs to authorize it.

@ChefMomota ChefMomota merged commit 1f068e9 into pancakeswap:develop Jul 31, 2023
9 checks passed
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.

3 participants