From e296dfa50b43bd4b21b881616444eb917be34a91 Mon Sep 17 00:00:00 2001 From: Patrick Gallagher Date: Wed, 31 Jul 2024 12:09:11 -0700 Subject: [PATCH 1/2] PT Assets (#666) * matomo race conditions (#613) * typo fix (#618) * Issue #606: Vaults explorer page (#611) * explore page * explore page more changes * fix explore page * more explore page fixes * revert yarn lock * explore table reorder, external link * add risk status, fix bugs * remove fuul (#620) * bump sdk (#621) * remove maintenance from bolts * add credit guild block (#622) * add credit guild block * update earn block * final copy * api url hotfix * Od-weth QA (#623) * round stability fee * OD_API_URL * New "initializing" loader (#609) * change waiting modal content * put modal content back * show loader if no title, text, hint, hash * rm loader modal from account checkking * close loader popup when vaults is fetched * prettier * fix loader and blinking * rm creating modal * prettier * lin fix * cleanup * Borrow + Deposit tabs cleanup (#631) * shape of tabs * tabs font styles * borders * fix lint warning * cleanup * Address ENS loading skeleton (#632) * add skeleton to vault stats * sidemenu and wallet info navbar * base color for skeleton in vault stats * base color for skeleton in ean page * prettier * Update react, react-router (#602) * widget at v2.10.2 * add yarn.lock * Update react-router to v6 * Update widget to v3 * add mui packages * fix onboarding props issue * yarn lock * make compatible with react router dom v6 * remove lifi widget * remove widget --------- Co-authored-by: jahabeebs * Issue #557: View internal balances (#633) * initial balance draft * initial balance draft * bump sdk version * fix lock file * fix lock file * fix lock file * fix vault block issue * fix infinite loop when pushed from other page (#640) * Issue #630: Explore page design improvements (#639) * explore page improvements * reuse function * fix svg rendering issue * fix navigate issue (#643) * Add GRT (#652) * Bump sdk to v1.7.4-rc.3 * lint * Issue #642: Reconnect on refresh (#644) * reconnect on refresh * fix loading logic * bump svg generator (#649) Co-authored-by: Patrick Gallagher * bump sdk * Replace all 'any' with correct Types (#638) * rm any from global styles: safe ones * global style: unused, wrong and empty * styling any * errors types and events * prettier and earn index strings type * earn and bolts * add pool data type * rm ts-ignore * lint fix * QA: Tracking error, empty vault (#645) * add error message when vault not excists * fix Tracking error * add error color * lint fix * cleanup console.log * App meta tags (#657) * update helmet * meta tags to home page * change home meta tags texts * vaults meta tags * create meta tags component * add tags to earn and stats * add bg to stats page * stats meta * add other meta tags to main pages * prettier * Issue #656 (app PR): country.is failure (#660) * add geoblock * no ip call * consolidate calls * Add PT-rETH PT-wstETH (#661) * update sdk * bump sdk * update icons * QA: Header (#646) * side menu fixed width * side menu display none id screen is wide * fix account arrangement * change camelot link color * fix bg (#659) * fix gnosis safe (#664) --------- Co-authored-by: Jacob Habib <47253537+jahabeebs@users.noreply.github.com> Co-authored-by: Iana <36742189+alekseevaiana@users.noreply.github.com> Co-authored-by: jahabeebs --- package.json | 4 +- public/index.html | 2 +- src/GlobalStyle.tsx | 42 +---- src/assets/gm-eth.svg | 17 ++ src/assets/grt.svg | 39 ++-- src/assets/pendle-pt-reth.svg | 107 +++++++++++ src/assets/pendle-pt-wsteth.svg | 53 ++++++ src/components/AccountCardsWeb3ReactV2.tsx | 2 +- src/components/ApproveToken.tsx | 7 +- src/components/AuctionBlock.tsx | 34 ++-- src/components/BidLine.tsx | 6 +- src/components/Bolts/AddressCell.tsx | 2 +- src/components/ConnectedWalletInfo.tsx | 9 +- src/components/Dropdown.tsx | 10 +- src/components/LinkButton.tsx | 3 +- src/components/MetaTags.tsx | 19 ++ src/components/Modals/WaitingModal.tsx | 4 +- src/components/NavLinks.tsx | 43 ++--- src/components/Navbar.tsx | 22 +-- src/components/NotificationPopup.tsx | 10 +- src/components/SideMenu.tsx | 22 ++- src/components/Slider.tsx | 7 +- src/components/WalletModal/Option.tsx | 10 +- src/components/Web3ReactManager/index.tsx | 13 +- src/components/connectorCards/Card.tsx | 4 +- src/containers/Analytics/DataTable.tsx | 22 ++- src/containers/Analytics/index.tsx | 167 +++++++++--------- .../CollateralAuctionBlock.tsx | 28 ++- src/containers/Auctions/index.tsx | 167 +++++++++--------- src/containers/Bolts/Leaderboard.tsx | 2 +- src/containers/Bolts/QuestBlock.tsx | 7 +- src/containers/Bolts/index.tsx | 115 ++++++------ src/containers/Bridge/index.tsx | 11 +- src/containers/Deposit/DepositFunds.tsx | 13 +- src/containers/Earn/PoolBlock.tsx | 19 +- src/containers/Earn/index.tsx | 113 ++++++------ src/containers/GeoBlockContainer.tsx | 6 +- src/containers/Shared.tsx | 77 +++----- src/containers/Vaults/ModifyVault.tsx | 2 - src/containers/Vaults/VaultDetails.tsx | 73 +++++--- src/containers/Vaults/VaultList.tsx | 3 + src/containers/Vaults/index.tsx | 3 + ...ctions.ts => checkGeoBlockAndSanctions.ts} | 4 +- src/utils/interfaces.ts | 1 + src/utils/metaInfo.ts | 54 ++++++ src/utils/retry.ts | 5 +- src/utils/themes/dark.ts | 1 + src/utils/themes/light.ts | 1 + src/utils/tokens.ts | 68 +++---- yarn.lock | 27 ++- 50 files changed, 873 insertions(+), 607 deletions(-) create mode 100644 src/assets/gm-eth.svg create mode 100644 src/assets/pendle-pt-reth.svg create mode 100644 src/assets/pendle-pt-wsteth.svg create mode 100644 src/components/MetaTags.tsx rename src/services/{checkSanctions.ts => checkGeoBlockAndSanctions.ts} (79%) create mode 100644 src/utils/metaInfo.ts diff --git a/package.json b/package.json index 4f18c00e..84261fdb 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@ethersproject/address": "^5.0.10", "@ethersproject/experimental": "5.4.0", "@ethersproject/providers": "5.4.5", - "@opendollar/sdk": "1.7.4-rc.3", + "@opendollar/sdk": "1.7.5", "@opendollar/svg-generator": "1.7.4", "@react-spring/web": "^9.7.3", "@sentry/cli": "^2.31.0", @@ -65,7 +65,7 @@ "react-device-detect": "^1.13.1", "react-dom": "^18.3.1", "react-feather": "^2.0.9", - "react-helmet-async": "^1.0.7", + "react-helmet-async": "^2.0.5", "react-i18next": "^11.7.2", "react-loading-skeleton": "^3.4.0", "react-number-format": "^5.2.2", diff --git a/public/index.html b/public/index.html index 2dea807c..a8f5971f 100644 --- a/public/index.html +++ b/public/index.html @@ -58,7 +58,7 @@ OD | App - + diff --git a/src/GlobalStyle.tsx b/src/GlobalStyle.tsx index 10e77195..37d6de6b 100644 --- a/src/GlobalStyle.tsx +++ b/src/GlobalStyle.tsx @@ -22,9 +22,8 @@ const GlobalStyle = createGlobalStyle` } body { - color: ${(props: any) => props.theme.colors.primary}; - background-color:${(props: any) => props.theme.colors.background}; background-image: url('/squares1x.webp'), url('/wavy-blue.webp'); + background-color: #E2F1FF; background-size: contain, 100%; background-position: bottom left, top right; background-repeat: no-repeat; @@ -60,27 +59,6 @@ const GlobalStyle = createGlobalStyle` } } -.place-left { - &:after{ - border-left-color:${(props: any) => props.theme.colors.foreground} !important - } - } - - .place-top { - &:after{ - border-top-color:${(props: any) => props.theme.colors.foreground} !important - } - } - .place-bottom { - &:after{ - border-bottom-color:${(props: any) => props.theme.colors.foreground} !important - } - } - .place-right { - &:after{ - border-right-color:${(props: any) => props.theme.colors.foreground} !important - } - } .Toastify__toast-container { padding: 0; @@ -92,12 +70,8 @@ const GlobalStyle = createGlobalStyle` padding-top: 20px; padding-bottom: 20px; border-radius: 5px; - color:${(props: any) => props.theme.colors.primary}; opacity: 1 !important; - background: ${(props: any) => props.theme.colors.foreground}; - border: ${(props: any) => props.theme.colors.border} !important; - box-shadow: 0 0 6px rgba(0, 0, 0, 0.16); - + box-shadow: 0 0 6px rgba(0, 0, 0, 0.16); } } ` @@ -109,8 +83,8 @@ export const ExternalLinkArrow = css` outline: none; padding: 0; margin: 0; - color: ${(props: any) => props.theme.colors.blueish}; - font-size: ${(props: any) => props.theme.font.small}; + color: ${(props) => props.theme.colors.blueish}; + font-size: ${(props) => props.theme.font.small}; font-weight: 600; line-height: 24px; letter-spacing: -0.18px; @@ -136,20 +110,20 @@ export const BtnStyle = css<{ color?: 'blueish' | 'greenish' | 'yellowish' | 'colorPrimary' | 'colorSecondary' border?: boolean }>` - pointer-events: ${({ theme, disabled }) => (disabled ? 'none' : 'inherit')}; + pointer-events: ${({ disabled }) => (disabled ? 'none' : 'inherit')}; outline: none; - cursor: ${({ theme, disabled }) => (disabled ? 'not-allowed' : 'pointer')}; + cursor: ${({ disabled }) => (disabled ? 'not-allowed' : 'pointer')}; min-width: 134px; border: ${({ theme, border }) => (border ? `1px solid ${theme.colors.blueish}` : 'none')}; box-shadow: none; line-height: 24px; - font-size: ${(props: any) => props.theme.font.small}; + font-size: ${(props) => props.theme.font.small}; font-weight: 600; padding: 8px 30px; color: ${({ theme, border }) => (border ? theme.colors.blueish : theme.colors.neutral)}; background: ${({ theme, disabled, color }) => disabled ? theme.colors.dimmedBackground : theme.colors[color ?? 'blueish']}; - border-radius: ${(props: any) => props.theme.global.borderRadius}; + border-radius: ${(props) => props.theme.global.borderRadius}; transition: all 0.3s ease; display: flex; align-items: center; diff --git a/src/assets/gm-eth.svg b/src/assets/gm-eth.svg new file mode 100644 index 00000000..7456a832 --- /dev/null +++ b/src/assets/gm-eth.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/assets/grt.svg b/src/assets/grt.svg index c9c33753..aa45d612 100644 --- a/src/assets/grt.svg +++ b/src/assets/grt.svg @@ -1,11 +1,30 @@ - - - - - - - - - - + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/assets/pendle-pt-reth.svg b/src/assets/pendle-pt-reth.svg new file mode 100644 index 00000000..a3a4a1e1 --- /dev/null +++ b/src/assets/pendle-pt-reth.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/pendle-pt-wsteth.svg b/src/assets/pendle-pt-wsteth.svg new file mode 100644 index 00000000..2537fdd4 --- /dev/null +++ b/src/assets/pendle-pt-wsteth.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/AccountCardsWeb3ReactV2.tsx b/src/components/AccountCardsWeb3ReactV2.tsx index 54988a59..97e2987e 100644 --- a/src/components/AccountCardsWeb3ReactV2.tsx +++ b/src/components/AccountCardsWeb3ReactV2.tsx @@ -93,7 +93,7 @@ const ErrorTextContainer = styled.div` const ErrorText = styled.div` font-family: 'Open Sans', sans-serif; font-weight: 400; - font-size: ${(props: any) => props.theme.font.xxSmall}; + font-size: ${(props) => props.theme.font.xxSmall}; color: #ddf08b; justify-content: start; text-align: center; diff --git a/src/components/ApproveToken.tsx b/src/components/ApproveToken.tsx index 89b957e1..a4d902e7 100644 --- a/src/components/ApproveToken.tsx +++ b/src/components/ApproveToken.tsx @@ -111,9 +111,10 @@ const ApproveToken = ({ bids, amount, handleBackBtn, handleSuccess, methodName, passedCheckForAllowance(allowance.toString(), amountBN.toString(), true) } - } catch (e: any) { + } catch (e) { popupsActions.setBlockBackdrop(false) - if (e?.code === 4001) { + const error = e as { code?: number; message: string } + if (error.code === 4001) { setTextPayload({ title: 'Transaction Rejected.', text: '', @@ -122,7 +123,7 @@ const ApproveToken = ({ bids, amount, handleBackBtn, handleSuccess, methodName, return } setTextPayload({ - title: e.message.includes('proxy') ? 'No Open Dollar Account' : 'Transaction Failed.', + title: error.message.includes('proxy') ? 'No Open Dollar Account' : 'Transaction Failed.', text: '', status: 'error', }) diff --git a/src/components/AuctionBlock.tsx b/src/components/AuctionBlock.tsx index c167e9cf..77aecc6f 100644 --- a/src/components/AuctionBlock.tsx +++ b/src/components/AuctionBlock.tsx @@ -303,7 +303,7 @@ const Container = styled.div` background: #05284c; ` const Header = styled.div` - font-size: ${(props: any) => props.theme.font.small}; + font-size: ${(props) => props.theme.font.small}; font-weight: 600; padding: 20px; display: flex; @@ -326,7 +326,7 @@ const Info = styled.div` ` const InfoCol = styled.div` - font-size: ${(props: any) => props.theme.font.small}; + font-size: ${(props) => props.theme.font.small}; min-width: 100px; ${({ theme }) => theme.mediaWidth.upToSmall` @@ -342,25 +342,25 @@ const InfoCol = styled.div` ` const InfoLabel = styled.div` - color: ${(props: any) => props.theme.colors.secondary}; - font-size: ${(props: any) => props.theme.font.xSmall}; + color: ${(props) => props.theme.colors.secondary}; + font-size: ${(props) => props.theme.font.xSmall}; ` const InfoValue = styled.div` margin-top: 3px; - color: ${(props: any) => props.theme.colors.primary}; + color: ${(props) => props.theme.colors.primary}; font-weight: normal; - font-size: ${(props: any) => props.theme.font.xSmall}; + font-size: ${(props) => props.theme.font.xSmall}; ` const Content = styled.div` padding: 20px 20px 20px 20px; - border-top: 1px solid ${(props: any) => props.theme.colors.border}; + border-top: 1px solid ${(props) => props.theme.colors.border}; background: #031f3a; border-radius: 0 0 15px 15px; ` const SectionContent = styled.div` - font-size: ${(props: any) => props.theme.font.default}; + font-size: ${(props) => props.theme.font.default}; ` const Link = styled.a` @@ -372,7 +372,7 @@ const BtnContainer = styled.div` padding-top: 15px; margin-bottom: -5px; margin-top: 10px; - border-top: 1px solid ${(props: any) => props.theme.colors.border}; + border-top: 1px solid ${(props) => props.theme.colors.border}; ` const LeftAucInfo = styled.div<{ type?: string }>` @@ -441,7 +441,7 @@ const Head = styled.div` font-size: 12px; font-weight: bold; text-transform: uppercase; - color: ${(props: any) => props.theme.colors.secondary}; + color: ${(props) => props.theme.colors.secondary}; padding-left: 10px; &:first-child { padding-left: 25px; @@ -454,7 +454,6 @@ const ListItemLabel = styled.div` display:block; margin-bottom:5px; font-weight:normal; - color: ${(props: any) => props.theme.colors.customSecondary}; `} ` @@ -466,19 +465,18 @@ const List = styled.div` background: #12385e; } &.winner { - background: ${(props: any) => props.theme.colors.greenish}; + background: ${(props) => props.theme.colors.greenish}; a, div { - color: ${(props: any) => props.theme.colors.neutral} !important; + color: ${(props) => props.theme.colors.neutral} !important; } ${ListItemLabel} { - color: ${(props: any) => props.theme.colors.background} !important; + color: ${(props) => props.theme.colors.background} !important; } } ${({ theme }) => theme.mediaWidth.upToSmall` flex-wrap:wrap; - border:1px solid ${(props: any) => props.theme.colors.border}; margin-bottom:10px; &:last-child { margin-bottom:0; @@ -489,8 +487,8 @@ const List = styled.div` const ListItem = styled.div` flex: 0 0 16.6%; - color: ${(props: any) => props.theme.colors.customSecondary}; - font-size: ${(props: any) => props.theme.font.xSmall}; + color: ${(props) => props.theme.colors.customSecondary}; + font-size: ${(props) => props.theme.font.xSmall}; padding: 15px 10px; &:first-child { padding-left: 25px; @@ -504,7 +502,7 @@ const ListItem = styled.div` flex: 0 0 50%; min-width:50%; - font-size: ${(props: any) => props.theme.font.xSmall}; + font-size: 16px; font-weight:900; `} ` diff --git a/src/components/BidLine.tsx b/src/components/BidLine.tsx index 9a1340c5..81a50736 100644 --- a/src/components/BidLine.tsx +++ b/src/components/BidLine.tsx @@ -70,14 +70,12 @@ const ListItemLabel = styled.div` display:block; margin-bottom:5px; font-weight:normal; - color: ${(props: any) => props.theme.colors.customSecondary}; `} ` const ListItem = styled.div` flex: 0 0 16.6%; - color: ${(props: any) => props.theme.colors.customSecondary}; - font-size: ${(props: any) => props.theme.font.xSmall}; + font-size: ${(props) => props.theme.font.xSmall}; padding: 15px 10px; &:first-child { padding-left: 25px; @@ -91,7 +89,7 @@ const ListItem = styled.div` flex: 0 0 50%; min-width:50%; - font-size: ${(props: any) => props.theme.font.xSmall}; + font-size: 16px; font-weight:900; `} ` diff --git a/src/components/Bolts/AddressCell.tsx b/src/components/Bolts/AddressCell.tsx index 528100d3..b6c4c28d 100644 --- a/src/components/Bolts/AddressCell.tsx +++ b/src/components/Bolts/AddressCell.tsx @@ -51,7 +51,7 @@ export default React.memo(AddressCell, (prevProps, nextProps) => { const Address = styled.span` font-family: 'Open Sans', sans-serif; font-weight: 700; - font-size: ${(props: any) => props.theme.font.xSmall}; + font-size: ${(props) => props.theme.font.xSmall}; line-height: 21.79px; letter-spacing: 0.05em; ` diff --git a/src/components/ConnectedWalletInfo.tsx b/src/components/ConnectedWalletInfo.tsx index 8f7b79bf..000503ef 100644 --- a/src/components/ConnectedWalletInfo.tsx +++ b/src/components/ConnectedWalletInfo.tsx @@ -16,6 +16,7 @@ import { MetaMask } from '@web3-react/metamask' import { Info } from 'react-feather' import { Tooltip as ReactTooltip } from 'react-tooltip' import { useAddress } from '~/hooks/useAddress' +import { GnosisSafe } from '@web3-react/gnosis-safe' const ConnectedWalletInfo = () => { const { t } = useTranslation() @@ -80,8 +81,12 @@ const ConnectedWalletInfo = () => { - - - - + <> + + +
+ Bolts + Welcome Vault Keepers! +
+ +
+ + + + +
+ +
+ Leaderboard + +
+ +
+ Quests + {QUESTS(boltsEarnedData).map((quest, index) => ( + + ))} +
+ +
+ Multipliers + {MULTIPLIERS(multipliersData).map((quest, index) => ( + + ))} +
+ +
+ + + +
+
+ ) } diff --git a/src/containers/Bridge/index.tsx b/src/containers/Bridge/index.tsx index e2b0eaf3..5af27665 100644 --- a/src/containers/Bridge/index.tsx +++ b/src/containers/Bridge/index.tsx @@ -1,11 +1,16 @@ import styled from 'styled-components' import BridgeFundsForm from './BridgeFundsForm' +import MetaTags from '~/components/MetaTags' +import metaInfo from '~/utils/metaInfo' const Bridge = () => { return ( - - - + <> + + + + + ) } diff --git a/src/containers/Deposit/DepositFunds.tsx b/src/containers/Deposit/DepositFunds.tsx index dd6ceeec..ee8e01b4 100644 --- a/src/containers/Deposit/DepositFunds.tsx +++ b/src/containers/Deposit/DepositFunds.tsx @@ -4,7 +4,6 @@ import { ArrowLeft, Info, AlertCircle } from 'react-feather' import styled from 'styled-components' import { useNavigate, useParams } from 'react-router-dom' import { useTranslation } from 'react-i18next' -import { useTheme } from 'styled-components' import { useTokenApproval, useProxyAddress, useActiveWeb3React } from '~/hooks' import { getTokenLogo, formatWithCommas, formatNumber } from '~/utils' import { useStoreState, useStoreActions } from '~/store' @@ -15,8 +14,6 @@ import Button from '~/components/Button' const DepositFunds = () => { const { t } = useTranslation() - //@ts-ignore - const { colors } = useTheme() const navigate = useNavigate() const { token } = useParams<{ token: string }>() const tokenSymbol = token?.toUpperCase() @@ -117,20 +114,14 @@ const DepositFunds = () => { {t('tokens_will_be_unlocked')} - + {shortStringDate(1677653610000)} - + {t('deposit_funds_warning')} diff --git a/src/containers/Earn/PoolBlock.tsx b/src/containers/Earn/PoolBlock.tsx index aee675ca..76668b32 100644 --- a/src/containers/Earn/PoolBlock.tsx +++ b/src/containers/Earn/PoolBlock.tsx @@ -3,7 +3,24 @@ import styled from 'styled-components' import { formatWithCommas, getTokenLogo } from '~/utils' import { Tooltip as ReactTooltip } from 'react-tooltip' -const PoolBlock = ({ nitroPoolAddress, nitroPoolData }: { nitroPoolAddress: string; nitroPoolData: any }) => { +interface PoolData { + nitroData: { + startTime: number + endTime: number + apy: number + tvlUSD: number + } + spNftData: { + apy: number + } + collateral0TokenSymbol: string + collateral1TokenSymbol: string + rewardToken1Symbol: string + rewardToken2Symbol: string +} + +const PoolBlock = ({ nitroPoolAddress, nitroPoolData }: { nitroPoolAddress: string; nitroPoolData: PoolData }) => { + console.log('DATA: ', nitroPoolData) const { collateral0TokenSymbol, collateral1TokenSymbol, rewardToken1Symbol, rewardToken2Symbol } = nitroPoolData const getTimePeriod = () => { diff --git a/src/containers/Earn/index.tsx b/src/containers/Earn/index.tsx index bfc25b27..d65116e7 100644 --- a/src/containers/Earn/index.tsx +++ b/src/containers/Earn/index.tsx @@ -12,6 +12,8 @@ import { PoolData } from '@opendollar/sdk' import Skeleton from 'react-loading-skeleton' import EarnBlock from './EarnBlock' import { getTokenLogo } from '~/utils' +import MetaTags from '~/components/MetaTags' +import metaInfo from '~/utils/metaInfo' interface Cache { [key: string]: PoolData @@ -31,7 +33,7 @@ const Earn = () => { return async () => { try { const poolResults = await Promise.all( - POOLS.map(async (pool: { camelotPoolAddress: any; nitroPoolAddress: any }) => { + POOLS.map(async (pool: { camelotPoolAddress: string; nitroPoolAddress: string }) => { const cacheKey = `${account}-${pool.camelotPoolAddress}-${pool.nitroPoolAddress}` if (cachedPools[cacheKey]) { return cachedPools[cacheKey] @@ -66,56 +68,65 @@ const Earn = () => { } return ( - - Earn - incentivized pools and strategies - -

Earn additional yield by staking your LP position in Camelot Nitro.

-

- When creating a OD-ETH position, use the "Auto" mode provided by Gamma.

See full - instructions{' '} - - here - - . -

-
- - Strategies - - Credit Guild {''} - - } - /> - {nitroPools.length > 0 ? ( - POOLS?.map( - ( - pool: JSX.IntrinsicAttributes & { nitroPoolAddress: string; nitroPoolData: any }, - i: number - ) => - ) - ) : ( - - )} - - - - - -
+ <> + + + Earn + incentivized pools and strategies + +

Earn additional yield by staking your LP position in Camelot Nitro.

+

+ When creating a OD-ETH position, use the "Auto" mode provided by Gamma.

See full + instructions{' '} + + here + + . +

+
+ + Strategies + + Credit Guild {''} + + } + /> + {nitroPools.length > 0 ? ( + POOLS?.map( + ( + pool: JSX.IntrinsicAttributes & { nitroPoolAddress: string; nitroPoolData: PoolData }, + i: number + ) => ( + + ) + ) + ) : ( + + )} + + + + + +
+ ) } diff --git a/src/containers/GeoBlockContainer.tsx b/src/containers/GeoBlockContainer.tsx index 59717a33..dbdf5826 100644 --- a/src/containers/GeoBlockContainer.tsx +++ b/src/containers/GeoBlockContainer.tsx @@ -90,7 +90,7 @@ const RightAlign = styled.div` ` const Text = styled.p` - color: ${(props: any) => props.theme.colors.tertiary}; + color: ${(props) => props.theme.colors.tertiary}; margin-bottom: 16px; font-size: 18px; line-height: 1.6; @@ -109,7 +109,7 @@ const Link = styled.a` ` const Textarea = styled.textarea` - color: ${(props: any) => props.theme.colors.tertiary}; + color: ${(props) => props.theme.colors.tertiary}; width: 100%; min-height: 150px; margin-top: 16px; @@ -161,7 +161,7 @@ const Button = styled.button` ` const BigText = styled(Text)` - color: ${(props: any) => props.theme.colors.primary}; + color: ${(props) => props.theme.colors.primary}; margin-bottom: 20px; font-size: 36px; font-weight: 900; diff --git a/src/containers/Shared.tsx b/src/containers/Shared.tsx index 063c3e2c..01683950 100644 --- a/src/containers/Shared.tsx +++ b/src/containers/Shared.tsx @@ -19,14 +19,13 @@ import { IS_IN_IFRAME, timeout, } from '~/utils' -import axios from 'axios' import useTokenData from '~/hooks/useTokenData' import useSafeData from '~/hooks/useSafeData' import useCoinBalanceUpdate from '~/hooks/useCoinBalanceUpdate' import useAuctionDataUpdate from '~/hooks/useAuctionDataUpdate' import useAllowanceCheck from '~/hooks/useAllowanceCheck' -import checkSanctions from '~/services/checkSanctions' +import checkGeoBlockAndSanctions from '~/services/checkGeoBlockAndSanctions' import ToastPayload from '~/components/ToastPayload' import WalletModal, { checkAndSwitchMetamaskNetwork } from '~/components/WalletModal' import SideMenu from '~/components/SideMenu' @@ -89,7 +88,6 @@ const Shared = ({ children, ...rest }: Props) => { const toastId = 'networkToastHash' const sanctionsToastId = 'sanctionsToastHash' - const bannedCountryCodes = ['US', 'IR', 'KP'] const resetModals = () => { popupsActions.setIsConnectedWalletModalOpen(false) @@ -110,28 +108,6 @@ const Shared = ({ children, ...rest }: Props) => { connectWalletActions.setTokensData(tokensData) }, [connectWalletActions, tokensData]) - const fetchUserCountry = async () => { - try { - const response = await axios.get('https://api.country.is') - return response.data?.country - } catch (error) { - console.error('Error fetching country:', error) - return null - } - } - - const isUserGeoBlocked = async () => { - if (!isGeofenceEnabled) { - return false - } - - const userCountry = await fetchUserCountry() - if (userCountry && bannedCountryCodes.includes(userCountry)) { - return true - } - return false - } - async function accountChecker() { if (!account || !chainId || !provider || !geb) return @@ -184,45 +160,36 @@ const Shared = ({ children, ...rest }: Props) => { } } - async function sanctionsCheck() { - if (account && process.env.NODE_ENV === 'production') { - const response = await checkSanctions(account) - if (response?.identifications.length > 0) { - connectWalletActions.setIsWrongNetwork(true) - toast( - , - { autoClose: false, type: 'warning', toastId: sanctionsToastId } - ) - return false - } else { - return true - } - } - return true - } - async function haiUserCheck() { if (process.env.REACT_APP_NETWORK_ID === '10') { toast(, { autoClose: false, type: 'warning', toastId: sanctionsToastId }) } } - async function geoBlockCheck() { - if (account && isGeofenceEnabled) { - const isBlocked = await isUserGeoBlocked() - if (isBlocked) { + async function sanctionsAndGeoBlockCheck() { + if (account && (isGeofenceEnabled || process.env.NODE_ENV === 'production')) { + const botAPIResponse = await checkGeoBlockAndSanctions(account) + const isBlocked = botAPIResponse.data?.message?.includes('geoblocked') + const isSanctioned = botAPIResponse?.identifications.length > 0 + if (isBlocked && isGeofenceEnabled) { popupsActions.setIsConnectedWalletModalOpen(false) popupsActions.setIsConnectorsWalletOpen(false) navigate('/geoblock') connectWalletActions.setIsWrongNetwork(true) settingsActions.setBlockBody(true) return false + } else if (isSanctioned && process.env.NODE_ENV === 'production') { + connectWalletActions.setIsWrongNetwork(true) + toast( + , + { autoClose: false, type: 'warning', toastId: sanctionsToastId } + ) } else { return true } @@ -300,8 +267,7 @@ const Shared = ({ children, ...rest }: Props) => { settingsActions.setBlockBody(false) connectWalletActions.setIsWrongNetwork(false) if (account) { - sanctionsCheck() - geoBlockCheck() + sanctionsAndGeoBlockCheck() connectWalletActions.setStep(1) accountChecker() } @@ -340,8 +306,7 @@ const Shared = ({ children, ...rest }: Props) => { settingsActions.setBlockBody(false) connectWalletActions.setIsWrongNetwork(false) if (account) { - sanctionsCheck() - geoBlockCheck() + sanctionsAndGeoBlockCheck() accountChecker() } checkAndSwitchMetamaskNetwork() diff --git a/src/containers/Vaults/ModifyVault.tsx b/src/containers/Vaults/ModifyVault.tsx index 65d153a5..a02e9e7e 100644 --- a/src/containers/Vaults/ModifyVault.tsx +++ b/src/containers/Vaults/ModifyVault.tsx @@ -257,7 +257,6 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw text={'Deposit & Borrow'} url={`/vaults/${vaultId}/deposit`} disabled={!isOwner} - //@ts-ignore color={isDeposit ? 'linear-gradient(180deg, #1A74EC 100%, #6396FF 0%)' : 'white'} className={isDeposit ? 'active' : ''} /> @@ -265,7 +264,6 @@ const ModifyVault = ({ isDeposit, isOwner, vaultId }: { isDeposit: boolean; isOw id="repay_withdraw" text={'Repay & Withdraw'} url={`/vaults/${vaultId}/withdraw`} - //@ts-ignore color={!isDeposit ? 'linear-gradient(180deg, #1A74EC 100%, #6396FF 0%)' : 'white'} className={!isDeposit ? 'active' : ''} /> diff --git a/src/containers/Vaults/VaultDetails.tsx b/src/containers/Vaults/VaultDetails.tsx index 45fa0d50..9acbcaff 100644 --- a/src/containers/Vaults/VaultDetails.tsx +++ b/src/containers/Vaults/VaultDetails.tsx @@ -1,4 +1,4 @@ -import { useEffect, useMemo } from 'react' +import { useEffect, useMemo, useState } from 'react' import { useParams, useLocation, useNavigate } from 'react-router-dom' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -16,6 +16,7 @@ import { ethers } from 'ethers' import Loader from '~/components/Loader' const VaultDetails = () => { + const [error, setError] = useState(false) const geb = useGeb() const { t } = useTranslation() const { account, provider } = useActiveWeb3React() @@ -38,10 +39,20 @@ const VaultDetails = () => { const safes = safeState.list const safe = safes.find((safe) => safe.id === safeId) + const [isLoading, setIsLoading] = useState(true) + const fetchSingleVaultData = async () => { + if (!isNumeric(safeId)) { + setIsLoading(false) + return + } + + setIsLoading(true) + if (safe && safeId && geb && liquidationData) { safeActions.setSingleSafe(safe) safeActions.setSafeData(DEFAULT_SAFE_STATE) + setIsLoading(false) return } @@ -49,13 +60,17 @@ const VaultDetails = () => { const safeDataResponse = await geb.contracts.safeManager.connect(geb.provider).safeData(safeId) const ODProxyAddress = safeDataResponse[1] if (ODProxyAddress.startsWith('0x000000')) { + setError(true) + setIsLoading(false) return } + const ODProxyContract = new ethers.Contract( ODProxyAddress, '[{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyOwner","type":"error"},{"inputs":[],"name":"TargetAddressRequired","type":"error"},{"inputs":[{"internalType":"bytes","name":"_response","type":"bytes"}],"name":"TargetCallFailed","type":"error"},{"inputs":[],"name":"OWNER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_target","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"execute","outputs":[{"internalType":"bytes","name":"_response","type":"bytes"}],"stateMutability":"payable","type":"function"}]', provider ) + const ownerAddress = await ODProxyContract.OWNER() const userSafes = await gebManager.getUserSafesRpc({ address: ownerAddress, @@ -74,6 +89,8 @@ const VaultDetails = () => { safeActions.setLiquidationData(constructedLiquidationData) const safeById = userSafes.safes.find((safe) => safe.safeId === safeId) if (!safeById) { + setIsLoading(false) + setError(true) return } const formattedSafe = formatUserSafe( @@ -84,12 +101,15 @@ const VaultDetails = () => { formattedSafe[0].ownerAddress = ownerAddress safeActions.setSingleSafe(formattedSafe[0]) safeActions.setSafeData(DEFAULT_SAFE_STATE) + setIsLoading(false) } } useEffect(() => { if (!liquidationData || !singleSafe) { fetchSingleVaultData() + } else { + setIsLoading(false) } return () => { safeActions.setSingleSafe(null) @@ -104,33 +124,38 @@ const VaultDetails = () => { } }, [account, provider, navigate, safeId]) - const isLoading = !(liquidationData && singleSafe?.collateralName) - return ( <> - - {isLoading ? ( - - - + {error ? ( + This vault does not exist ) : ( - + <> + {isLoading ? ( + + + + ) : ( + + )} + + {(isDeposit || isWithdraw) && !isLoading && isOwner ? ( + + ) : null} + + {/* Users can only repay debt from a vault they don't own */} + {!isLoading && !isOwner ? ( + + ) : null} + + {!isOwner ? ( + + + + ) : null} + )} - - {(isDeposit || isWithdraw) && !isLoading && isOwner ? ( - - ) : null} - - {/* Users can only repay debt from a vault they don't own */} - {!isLoading && !isOwner ? : null} - - {!isOwner ? ( - - - - ) : null} ) @@ -138,6 +163,10 @@ const VaultDetails = () => { export default VaultDetails +const ErrorMessage = styled.div` + color: ${({ theme }) => theme.colors.error}; +` + const Container = styled.div` max-width: 880px; margin: 50px auto; diff --git a/src/containers/Vaults/VaultList.tsx b/src/containers/Vaults/VaultList.tsx index 506aa859..f4942b34 100644 --- a/src/containers/Vaults/VaultList.tsx +++ b/src/containers/Vaults/VaultList.tsx @@ -8,6 +8,8 @@ import VaultBlock from '~/components/VaultBlock' import CheckBox from '~/components/CheckBox' import { returnState, ISafe } from '~/utils' import { useActiveWeb3React } from '~/hooks' +import MetaTags from '~/components/MetaTags' +import metaInfo from '~/utils/metaInfo' const VaultList = ({ address }: { address?: string }) => { const [showEmpty, setShowEmpty] = useState(true) @@ -34,6 +36,7 @@ const VaultList = ({ address }: { address?: string }) => { if (safeState.list.length > 0) { return ( +
{'Vaults'} diff --git a/src/containers/Vaults/index.tsx b/src/containers/Vaults/index.tsx index da17b12d..fe1af8b9 100644 --- a/src/containers/Vaults/index.tsx +++ b/src/containers/Vaults/index.tsx @@ -10,6 +10,8 @@ import Accounts from './Accounts' import Loader from '~/components/Loader' import useGeb from '~/hooks/useGeb' import { useWeb3React } from '@web3-react/core' +import MetaTags from '~/components/MetaTags' +import metaInfo from '~/utils/metaInfo' interface OnBoardingProps { className?: string @@ -42,6 +44,7 @@ const OnBoarding = ({ className }: OnBoardingProps) => { return ( + {safeState.safeCreated ? ( <> diff --git a/src/services/checkSanctions.ts b/src/services/checkGeoBlockAndSanctions.ts similarity index 79% rename from src/services/checkSanctions.ts rename to src/services/checkGeoBlockAndSanctions.ts index 14d54bdc..129c4158 100644 --- a/src/services/checkSanctions.ts +++ b/src/services/checkGeoBlockAndSanctions.ts @@ -1,7 +1,7 @@ import axios from 'axios' import { OD_API_URL } from '~/utils/constants' -async function checkSanctions(address: string) { +async function checkGeoBlockAndSanctions(address: string) { let res try { const BOT_API = `${OD_API_URL}/screen?address=${address}` @@ -16,4 +16,4 @@ async function checkSanctions(address: string) { } } -export default checkSanctions +export default checkGeoBlockAndSanctions diff --git a/src/utils/interfaces.ts b/src/utils/interfaces.ts index 98ae62fc..838548e4 100644 --- a/src/utils/interfaces.ts +++ b/src/utils/interfaces.ts @@ -28,6 +28,7 @@ interface IColors { background: string accent: string gradientBg: string + error: string // deprecated colors gradient: string overlay: string diff --git a/src/utils/metaInfo.ts b/src/utils/metaInfo.ts new file mode 100644 index 00000000..deeea29a --- /dev/null +++ b/src/utils/metaInfo.ts @@ -0,0 +1,54 @@ +export interface MetaInfo { + title: string + description: string + keywords: string +} + +const metaInfo: { [key: string]: MetaInfo } = { + home: { + title: 'Open Dollar - Low-Interest DeFi Loans & Tradable CDPs', + description: + 'Discover Open Dollar, a DeFi platform offering low-interest tradable onchain loans. Secure and trade your collateral with ease. The future of onchain lending is here.', + keywords: + 'Open Dollar, DeFi, low-interest loans, tradable assets, decentralized finance, collateral, stablecoins, tradeable CDPs', + }, + vaults: { + title: 'Open Dollar Vaults - Secure Collateral for Low-Interest Loans', + description: + 'Utilize Open Dollar Vaults to securely lock collateral for minting stablecoins at low interest. Trade your assets with ease on our DeFi platform.', + keywords: 'Open Dollar vaults, secure collateral, low-interest loans, mint stablecoins, DeFi trading', + }, + earn: { + title: 'Open Dollar Staking - Explore earning opportunities in the Open Dollar ecosystem', + description: + 'Stake your assets on Open Dollar to earn rewards while benefiting from low-interest loans. Enhance your DeFi experience with our staking options.', + keywords: 'Open Dollar staking, earn rewards, low-interest loans, DeFi staking, asset staking', + }, + stats: { + title: 'Open Dollar Stats - Numbers and stuff.', + description: + 'Access Open Dollar Stats for insights on low-interest loans, collateral, and trading activities. Make informed decisions with comprehensive Open Dollar data.', + keywords: + 'Open Dollar analytics, Open Dollar stats, low-interest loans, trading insights, DeFi data, collateral analysis', + }, + bolts: { + title: 'Open Dollar Bolts - Join the Open Dollar Bolts campaign today', + description: 'Test the newest primitives in DeFi for a chance at a stake in the future of Open Dollar.', + keywords: + 'Open Dollar Bolts, points, open dollar points, low-interest loans, liquidity, DeFi platform, gain OD, open dollar', + }, + bridge: { + title: 'Open Dollar Bridge - Seamless Cross-Chain Asset Transfers', + description: 'Deposit collateral into Open Dollar cross-chain with extreme ease.', + keywords: + 'Open Dollar Bridge, cross-chain transfers, asset transfers, DeFi, secure blockchain transfers, seamless transactions', + }, + auctions: { + title: 'Open Dollar Auctions - Bid on Collateral for Great Discounts', + description: 'Participate in Open Dollar Auctions to bid on collateral and get the best price in the market.', + keywords: + 'Open Dollar Auctions, bid on collateral, maximize profits, decentralized auction, DeFi opportunities, collateral auctions, cheap crypto, best place to buy crypto', + }, +} + +export default metaInfo diff --git a/src/utils/retry.ts b/src/utils/retry.ts index 6af52638..164a1688 100644 --- a/src/utils/retry.ts +++ b/src/utils/retry.ts @@ -53,12 +53,11 @@ export function retry( completed = true } break - //@ts-ignore - } catch (error: any) { + } catch (error) { if (completed) { break } - if (n <= 0 || !error.isRetryableError) { + if (n <= 0 || !(error instanceof RetryableError)) { reject(error) completed = true break diff --git a/src/utils/themes/dark.ts b/src/utils/themes/dark.ts index 42162a06..cc27cf9b 100755 --- a/src/utils/themes/dark.ts +++ b/src/utils/themes/dark.ts @@ -13,6 +13,7 @@ const darkTheme: Theme = { background: '#E2F1FF', accent: '#1C293A', gradientBg: 'linear-gradient(180deg, #1A74EC 0%, #6396FF 100%); ', + error: '#E75966', gradient: '', overlay: '', border: '', diff --git a/src/utils/themes/light.ts b/src/utils/themes/light.ts index cc8740fc..d7918982 100755 --- a/src/utils/themes/light.ts +++ b/src/utils/themes/light.ts @@ -10,6 +10,7 @@ const lightTheme: Theme = { neutral: '#FFFFFF', background: '#E2F1FF', accent: '#1C293A', + error: '#E75966', gradient: '', gradientBg: 'linear-gradient(180deg, #1A74EC 0%, #6396FF 100%)', overlay: '', diff --git a/src/utils/tokens.ts b/src/utils/tokens.ts index 92908167..732ef3bc 100644 --- a/src/utils/tokens.ts +++ b/src/utils/tokens.ts @@ -3,48 +3,21 @@ import OP from '../assets/op-img.svg' import OD from '../assets/od-token.svg' import ODG from '../assets/odg-token.svg' import GRT from '../assets/grt.svg' - +import PT_wstETH_26JUN2025 from '../assets/pendle-pt-wsteth.svg' +import PT_rETH_26JUN2025 from '../assets/pendle-pt-reth.svg' import WSTETH from '../assets/wsteth.svg' import CBETH from '../assets/cbETH.svg' import RETH from '../assets/rETH.svg' import ARB from '../assets/arb.svg' import MAGIC from '../assets/magic.svg' import PUFETH from '../assets/pufeth.svg' +import FALLBACK_TOKEN_ICON from '../assets/unknown-token.svg' + import { Provider } from '@ethersproject/providers' import { ethers } from 'ethers' import { ERC20__factory } from '@opendollar/sdk/lib/typechained' import { RPC_URL_ETHEREUM, RPC_URL_ARBITRUM, RPC_URL_OPTIMISM, RPC_URL_POLYGON, RPC_URL_BASE } from '~/chains' -// Helper function to dynamically import SVGs -const importTokenIcon = (tokenName: string) => { - switch (tokenName) { - case 'WETH': - return WETH - case 'OP': - return OP - case 'OD': - return OD - case 'ODG': - return ODG - case 'WSTETH': - return WSTETH - case 'CBETH': - return CBETH - case 'RETH': - return RETH - case 'ARB': - return ARB - case 'MAGIC': - return MAGIC - case 'PUFETH': - return PUFETH - case 'GRT': - return GRT - default: - return require('../assets/unknown-token.svg').default - } -} - export type Tokens = { [key: string]: { name: string @@ -55,23 +28,24 @@ export type Tokens = { } } -export const TOKEN_LOGOS: { [key: string]: string } = { - WETH: importTokenIcon('WETH'), - OP: importTokenIcon('OP'), - OD: importTokenIcon('OD'), - ODG: importTokenIcon('ODG'), - WSTETH: importTokenIcon('WSTETH'), - CBETH: importTokenIcon('CBETH'), - RETH: importTokenIcon('RETH'), - ARB: importTokenIcon('ARB'), - MAGIC: importTokenIcon('MAGIC'), - PUFETH: importTokenIcon('PUFETH'), - GRT: importTokenIcon('GRT'), - ETH: importTokenIcon('WETH'), -} - export function getTokenLogo(token: string): string { - return TOKEN_LOGOS[token] || importTokenIcon('').default + const TOKEN_LOGOS: { [key: string]: string } = { + WETH: WETH, + OP: OP, + OD: OD, + ODG: ODG, + WSTETH: WSTETH, + CBETH: CBETH, + RETH: RETH, + ARB: ARB, + MAGIC: MAGIC, + PUFETH: PUFETH, + GRT: GRT, + ETH: WETH, + 'PT-rETH-26JUN2025': PT_rETH_26JUN2025, + 'PT-wstETH-26JUN2025': PT_wstETH_26JUN2025, + } + return TOKEN_LOGOS[token] || FALLBACK_TOKEN_ICON } const gasTokenArray = [ diff --git a/yarn.lock b/yarn.lock index 2aa9d3bf..532b3f36 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3695,15 +3695,15 @@ __metadata: languageName: node linkType: hard -"@opendollar/sdk@npm:1.7.4-rc.3": - version: 1.7.4-rc.3 - resolution: "@opendollar/sdk@npm:1.7.4-rc.3" +"@opendollar/sdk@npm:1.7.5": + version: 1.7.5 + resolution: "@opendollar/sdk@npm:1.7.5" dependencies: "@opendollar/abis": 0.0.0-605371bd ethers: 5.4.7 peerDependencies: utf-8-validate: ^5.0.2 - checksum: 8ed9174b048af9d688f1160ecc470c929da2874f0f4f6624f703cafde7b298914996afa0e0fb10f4dcbe0f9d2dd507db441278a7fa24c190c336cdc92c763bf8 + checksum: a43b6e7d6bb02822685522f7171dcf12bbf99b2bfa0e4274f00f6736dd730061950a6f1370e722ddf289953002c5ebdb6e8f129ed979ef9f4a89e6096d4fa455 languageName: node linkType: hard @@ -15006,7 +15006,7 @@ __metadata: "@ethersproject/address": ^5.0.10 "@ethersproject/experimental": 5.4.0 "@ethersproject/providers": 5.4.5 - "@opendollar/sdk": 1.7.4-rc.3 + "@opendollar/sdk": 1.7.5 "@opendollar/svg-generator": 1.7.4 "@react-spring/web": ^9.7.3 "@sentry/cli": ^2.31.0 @@ -15067,7 +15067,7 @@ __metadata: react-device-detect: ^1.13.1 react-dom: ^18.3.1 react-feather: ^2.0.9 - react-helmet-async: ^1.0.7 + react-helmet-async: ^2.0.5 react-i18next: ^11.7.2 react-loading-skeleton: ^3.4.0 react-number-format: ^5.2.2 @@ -16949,7 +16949,7 @@ __metadata: languageName: node linkType: hard -"react-fast-compare@npm:^3.2.0": +"react-fast-compare@npm:^3.2.2": version: 3.2.2 resolution: "react-fast-compare@npm:3.2.2" checksum: 0bbd2f3eb41ab2ff7380daaa55105db698d965c396df73e6874831dbafec8c4b5b08ba36ff09df01526caa3c61595247e3269558c284e37646241cba2b90a367 @@ -16967,19 +16967,16 @@ __metadata: languageName: node linkType: hard -"react-helmet-async@npm:^1.0.7": - version: 1.3.0 - resolution: "react-helmet-async@npm:1.3.0" +"react-helmet-async@npm:^2.0.5": + version: 2.0.5 + resolution: "react-helmet-async@npm:2.0.5" dependencies: - "@babel/runtime": ^7.12.5 invariant: ^2.2.4 - prop-types: ^15.7.2 - react-fast-compare: ^3.2.0 + react-fast-compare: ^3.2.2 shallowequal: ^1.1.0 peerDependencies: react: ^16.6.0 || ^17.0.0 || ^18.0.0 - react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 - checksum: 8f3e6d26beff61d2ed18f7b41561df3e4d83a7582914c7196aa65158c7f3cce939276547d7a0b8987952d9d44131406df74efba02d1f8fa8a3940b49e6ced70b + checksum: f390ea8bf13c2681850e5f8eb5b73d8613f407c245a5fd23e9db9b2cc14a3700dd1ce992d3966632886d1d613083294c2aeee009193f49dfa7d145d9f13ea2b0 languageName: node linkType: hard From 829ca3ff0c6ad159476cf1ff0ee3522f5067d1d9 Mon Sep 17 00:00:00 2001 From: Patrick Gallagher Date: Thu, 1 Aug 2024 14:26:34 -0700 Subject: [PATCH 2/2] Hotfix: stability fee (#669) * matomo race conditions (#613) * typo fix (#618) * Issue #606: Vaults explorer page (#611) * explore page * explore page more changes * fix explore page * more explore page fixes * revert yarn lock * explore table reorder, external link * add risk status, fix bugs * remove fuul (#620) * bump sdk (#621) * remove maintenance from bolts * add credit guild block (#622) * add credit guild block * update earn block * final copy * api url hotfix * Od-weth QA (#623) * round stability fee * OD_API_URL * New "initializing" loader (#609) * change waiting modal content * put modal content back * show loader if no title, text, hint, hash * rm loader modal from account checkking * close loader popup when vaults is fetched * prettier * fix loader and blinking * rm creating modal * prettier * lin fix * cleanup * Borrow + Deposit tabs cleanup (#631) * shape of tabs * tabs font styles * borders * fix lint warning * cleanup * Address ENS loading skeleton (#632) * add skeleton to vault stats * sidemenu and wallet info navbar * base color for skeleton in vault stats * base color for skeleton in ean page * prettier * Update react, react-router (#602) * widget at v2.10.2 * add yarn.lock * Update react-router to v6 * Update widget to v3 * add mui packages * fix onboarding props issue * yarn lock * make compatible with react router dom v6 * remove lifi widget * remove widget --------- Co-authored-by: jahabeebs * Issue #557: View internal balances (#633) * initial balance draft * initial balance draft * bump sdk version * fix lock file * fix lock file * fix lock file * fix vault block issue * fix infinite loop when pushed from other page (#640) * Issue #630: Explore page design improvements (#639) * explore page improvements * reuse function * fix svg rendering issue * fix navigate issue (#643) * Add GRT (#652) * Bump sdk to v1.7.4-rc.3 * lint * Issue #642: Reconnect on refresh (#644) * reconnect on refresh * fix loading logic * bump svg generator (#649) Co-authored-by: Patrick Gallagher * bump sdk * Replace all 'any' with correct Types (#638) * rm any from global styles: safe ones * global style: unused, wrong and empty * styling any * errors types and events * prettier and earn index strings type * earn and bolts * add pool data type * rm ts-ignore * lint fix * QA: Tracking error, empty vault (#645) * add error message when vault not excists * fix Tracking error * add error color * lint fix * cleanup console.log * App meta tags (#657) * update helmet * meta tags to home page * change home meta tags texts * vaults meta tags * create meta tags component * add tags to earn and stats * add bg to stats page * stats meta * add other meta tags to main pages * prettier * Issue #656 (app PR): country.is failure (#660) * add geoblock * no ip call * consolidate calls * Add PT-rETH PT-wstETH (#661) * update sdk * bump sdk * update icons * QA: Header (#646) * side menu fixed width * side menu display none id screen is wide * fix account arrangement * change camelot link color * fix bg (#659) * fix gnosis safe (#664) * fix stability fee by removing multiplication (#667) (#668) * fix stability fee by removing multiplication * lint cleanup --------- Co-authored-by: Jacob Habib <47253537+jahabeebs@users.noreply.github.com> Co-authored-by: Iana <36742189+alekseevaiana@users.noreply.github.com> Co-authored-by: jahabeebs --- src/containers/Analytics/index.tsx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/containers/Analytics/index.tsx b/src/containers/Analytics/index.tsx index dd9fe306..b0f95a7c 100644 --- a/src/containers/Analytics/index.tsx +++ b/src/containers/Analytics/index.tsx @@ -11,7 +11,6 @@ import { AddressLink } from '~/components/AddressLink' import { contractsDescriptions } from '~/utils/contractsDescription' import { formatDataNumber, - multiplyRates, multiplyWad, transformToWadPercentage, transformToAnnualRate, @@ -299,13 +298,7 @@ const Analytics = () => { , formatDataNumber(value?.currentPrice?.toString() || '0', 18, 2, true), formatDataNumber(value?.nextPrice?.toString() || '0', 18, 2, true), - transformToAnnualRate( - multiplyRates( - value?.stabilityFee?.toString(), - analyticsData.redemptionRate?.toString() - ) || '0', - 27 - ), + transformToAnnualRate(value?.stabilityFee?.toString(), 27), formatDataNumber(value?.debtAmount?.toString() || '0', 18, 2, true, true), transformToWadPercentage(value?.debtAmount?.toString(), value?.debtCeiling?.toString()), formatDataNumber(value?.lockedAmount?.toString() || '0', 18, 2, false, true) + ' ' + key,