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

Merkle Staking/Bond function #1673

Draft
wants to merge 6 commits into
base: staging
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/components/_cards/PortfolioCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import { Rewards } from "./Rewards"
import { useNetwork } from "wagmi"
import WithdrawQueueCard from "../WithdrawQueueCard"
import withdrawQueueV0821 from "src/abi/withdraw-queue-v0.8.21.json"
import { CellarNameKey } from "data/types"
import { CellarNameKey, ConfigProps } from "data/types"
import { PointsDisplay } from "./PointsDisplay"
import { MerklePoints } from "./MerklePoints/MerklePoints"
import { BaseButton } from "components/_buttons/BaseButton"
Expand Down Expand Up @@ -171,6 +171,11 @@ export const PortfolioCard: VFC<BoxProps> = (props) => {
checkWithdrawRequest()
}, [withdrawQueueContract, address, cellarConfig])

const isArbCellar = (config: ConfigProps) => {
return config.cellarNameKey === CellarNameKey.REAL_YIELD_ETH_ARB
||config.cellarNameKey === CellarNameKey.REAL_YIELD_USD_ARB
}

return (
<TransparentCard
{...props}
Expand Down Expand Up @@ -381,9 +386,9 @@ export const PortfolioCard: VFC<BoxProps> = (props) => {
: "--")}
</CardStat>
</VStack>
{isBondButtonEnabled(cellarConfig) &&
isStakingAllowed &&
isMounted && (
{isMounted
&& (isArbCellar(cellarConfig) || isStakingAllowed)
&& (
<BondButton
disabled={
lpTokenDisabled || !buttonsEnabled
Expand Down Expand Up @@ -425,19 +430,16 @@ export const PortfolioCard: VFC<BoxProps> = (props) => {
</CardStat>
</VStack>
)}
{/* Insert PointsDisplay here */}
{isConnected &&
address &&
cellarConfig.cellarNameKey ===
CellarNameKey.TURBO_EETHV2 && (
<PointsDisplay userAddress={address} />
)}
{isConnected &&
address &&
(cellarConfig.cellarNameKey ===
CellarNameKey.REAL_YIELD_ETH_ARB ||
cellarConfig.cellarNameKey ===
CellarNameKey.REAL_YIELD_USD_ARB) && (
{isConnected
&& address
&& isArbCellar(cellarConfig)
&& (
<MerklePoints userAddress={address} merkleRewardsApy={strategyData?.merkleRewardsApy} />
)}
<CardStat label="Strategy Dashboard">
Expand Down
13 changes: 11 additions & 2 deletions src/data/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,8 @@ export const bondingPeriodOptions = (
config.cellarNameKey === CellarNameKey.TURBO_GHO ||
config.cellarNameKey === CellarNameKey.TURBO_SOMM ||
config.cellarNameKey === CellarNameKey.TURBO_EETH ||
config.cellarNameKey === CellarNameKey.REAL_YIELD_ETH_ARB ||
config.cellarNameKey ===
CellarNameKey.TEST_ARBITRUM_REAL_YIELD_USD ||
config.cellarNameKey === CellarNameKey.REAL_YIELD_USD_ARB ||
config.cellarNameKey === CellarNameKey.REAL_YIELD_BTC
) {
return [
Expand Down Expand Up @@ -323,6 +321,17 @@ export const bondingPeriodOptions = (
},
]
}
if (
config.cellarNameKey === CellarNameKey.REAL_YIELD_USD_ARB ||
config.cellarNameKey === CellarNameKey.REAL_YIELD_ETH_ARB) {
return [
{
title: "Merkle Points bonding",
amount: "Lock your vault tokens for Merkle Points",
value: 1,
},
]
}
if (
config.cellarNameKey === CellarNameKey.STEADY_BTC ||
config.cellarNameKey === CellarNameKey.STEADY_ETH ||
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11473,11 +11473,6 @@ number-is-nan@^1.0.0:
resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=

numeral@^2.0.6:
version "2.0.6"
resolved "https://registry.yarnpkg.com/numeral/-/numeral-2.0.6.tgz#4ad080936d443c2561aed9f2197efffe25f4e506"
integrity sha512-qaKRmtYPZ5qdw4jWJD6bxEf1FJEqllJrwxCLIm0sQU/A7v2/czigzOb+C2uSiFsa9lBUzeH7M1oK+Q+OLxL3kA==

object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
Expand Down