saddle-finance / saddle-frontend

An open source UI for saddle.finance 🤠
https://saddle.exchange
54 stars 58 forks source link

Enable gauge staking, unstaking, and claiming rewards on side chain #1284

Closed nguyenaiden closed 1 year ago

nguyenaiden commented 2 years ago

Description: As part of cross-chain gauges, this PR enabled the staking, un-staking, and claiming features for gauges that are on side chains.

NOTE: This PR still requires to be put behind a feature flag, pending extra work on the contract side. Please take a close look at the gauges logic allowing the seamless usage between Mainnet and Sidechain versions of the contracts which provides similar information. Mainnet vs Sidechain

LiquidityGaugeV5 vs. ChildGauge (gauge specific calls)
GaugeController vs ChildGaugeFactory (to retrieve gauge counts)
GaugeMinterContract vs ChildGaugeFactory (rewards minting)
VotingEscrowContract vs ChildOracle (retrieve user's veSDL balance)
codecov[bot] commented 1 year ago

Codecov Report

Merging #1284 (a8fb82b) into master (69d4dd3) will decrease coverage by 0.09%. The diff coverage is 2.19%.

@@            Coverage Diff            @@
##           master   #1284      +/-   ##
=========================================
- Coverage    9.83%   9.73%   -0.10%     
=========================================
  Files         164     164              
  Lines        6312    6428     +116     
  Branches     2086    2120      +34     
=========================================
+ Hits          621     626       +5     
- Misses       5691    5802     +111     
Impacted Files Coverage Δ
src/components/TokenClaimDialog.tsx 0.00% <0.00%> (ø)
src/hooks/useUserGauge.ts 0.00% <0.00%> (ø)
src/pages/Farm/ClaimRewardsDlg.tsx 0.00% <0.00%> (ø)
src/pages/Farm/StakeDialog.tsx 0.00% <0.00%> (ø)
src/pages/VeSDL/VeSDLWrongNetworkModal.tsx 0.00% <0.00%> (ø)
src/providers/GaugeProvider.tsx 5.26% <0.00%> (+0.50%) :arrow_up:
src/utils/gauges.ts 1.27% <1.31%> (+0.38%) :arrow_up:
src/hooks/useContract.ts 5.06% <6.66%> (+0.41%) :arrow_up:
src/providers/useRegistryAddress.ts 9.09% <0.00%> (+9.09%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

nguyenaiden commented 1 year ago

Closing PR in favor of https://github.com/saddle-finance/saddle-frontend/pull/1287