From abadba1e1e297f15c39fa41172b678d42ec8cd83 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 14 Sep 2023 11:24:22 +0200 Subject: [PATCH 01/14] Add newest version of coverage pools Up until now we only had one version of coverage pools installed. On relesae branch we use v1.0.0, which is related to keep token. Here we add another version of coverage pools and call it `@threshold-network/coverage-pools` to indicate that this one is related to T token. We use `development` tag for both of the libs as default but on production we should use `1.0.0` for `@keep-network/coverage-pools` and `2.0.0` for `@threshold-network/coverage-pools`. --- package.json | 1 + yarn.lock | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/package.json b/package.json index c0368454d..e620635fa 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "@testing-library/react": "^11.1.0", "@testing-library/user-event": "^12.1.10", "@threshold-network/components": "development", + "@threshold-network/coverage-pools": "npm:@keep-network/coverage-pools@development", "@threshold-network/solidity-contracts": "development", "@types/jest": "^27.0.1", "@types/node": "^16.9.1", diff --git a/yarn.lock b/yarn.lock index e106ec6a9..a5d80305e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4086,6 +4086,17 @@ resolved "https://registry.npmjs.org/@threshold-network/components/-/components-1.0.0-dev.31.tgz#7767a9f136156f8d4f3044d90e87a1014eb07a67" integrity sha512-ftzJV6p2He3Co0wLYky+sX0NAFVGrJCRvBDI0n3KF4POBO425Qy3yodS7HOkT1TgGRNU8AGO0KebS2X7gfgAEA== +"@threshold-network/coverage-pools@npm:@keep-network/coverage-pools@development": + version "2.1.0-dev.3" + resolved "https://registry.yarnpkg.com/@keep-network/coverage-pools/-/coverage-pools-2.1.0-dev.3.tgz#95b2c7df4a109a6d82fcb067ea1f4bbac4e9434a" + integrity sha512-b6UMu5/8Rd/OS33T6RwMAHyyJtIInzJVwVFx4ZxMwKvPBE/orRAIVkgkCUWUNM04WWexgt/i5h393lia9d00IQ== + dependencies: + "@keep-network/keep-core" "1.8.1-dev.0" + "@keep-network/tbtc" "1.1.2-dev.1" + "@openzeppelin/contracts" "^4.8" + "@thesis/solidity-contracts" "github:thesis/solidity-contracts#4985bcf" + "@threshold-network/solidity-contracts" "1.3.0-dev.5" + "@threshold-network/solidity-contracts@1.3.0-dev.5", "@threshold-network/solidity-contracts@development": version "1.3.0-dev.5" resolved "https://registry.yarnpkg.com/@threshold-network/solidity-contracts/-/solidity-contracts-1.3.0-dev.5.tgz#f7a2727d627a10218f0667bc0d33e19ed8f87fdc" From 9626b24235bb80c8787f06661e942167c12c1b0a Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 14 Sep 2023 11:27:38 +0200 Subject: [PATCH 02/14] Create two separate hooks for asset pools Creates two separate hooks for both Kepp Asset Pool and Threshold Asset Pool contracts. --- src/web3/hooks/index.ts | 1 + src/web3/hooks/useAssetPoolContract.ts | 2 +- src/web3/hooks/useKeepAssetPoolContract.ts | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 src/web3/hooks/useKeepAssetPoolContract.ts diff --git a/src/web3/hooks/index.ts b/src/web3/hooks/index.ts index d1a1b7293..474a3d491 100644 --- a/src/web3/hooks/index.ts +++ b/src/web3/hooks/index.ts @@ -13,6 +13,7 @@ export * from "./useVendingMachineRatio" export * from "./useMulticallContract" export * from "./useKeepBondingContract" export * from "./useAssetPoolContract" +export * from "./useKeepAssetPoolContract" export * from "./useTBTCTokenContract" export * from "./useTStakingContract" export * from "./useKeepTokenStakingContract" diff --git a/src/web3/hooks/useAssetPoolContract.ts b/src/web3/hooks/useAssetPoolContract.ts index 99f20fa29..1dafb7bac 100644 --- a/src/web3/hooks/useAssetPoolContract.ts +++ b/src/web3/hooks/useAssetPoolContract.ts @@ -1,6 +1,6 @@ import { useContract } from "./useContract" import AssetPool from "@keep-network/coverage-pools/artifacts/AssetPool.json" -export const useKeepAssetPoolContract = () => { +export const useAssetPoolContract = () => { return useContract(AssetPool.address, AssetPool.abi) } diff --git a/src/web3/hooks/useKeepAssetPoolContract.ts b/src/web3/hooks/useKeepAssetPoolContract.ts new file mode 100644 index 000000000..de2fa8d91 --- /dev/null +++ b/src/web3/hooks/useKeepAssetPoolContract.ts @@ -0,0 +1,6 @@ +import { useContract } from "./useContract" +import AssetPool from "@threshold-network/coverage-pools/artifacts/AssetPool.json" + +export const useKeepAssetPoolContract = () => { + return useContract(AssetPool.address, AssetPool.abi) +} From 6ff0e93f20f6fb64e24a7ad07bce19d7e2c3700d Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 14 Sep 2023 11:29:23 +0200 Subject: [PATCH 03/14] Add t cov pool tvl to `useFetchTVL` hook --- src/hooks/useFetchTvl.ts | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/hooks/useFetchTvl.ts b/src/hooks/useFetchTvl.ts index a145dbb59..9c72fe0e4 100644 --- a/src/hooks/useFetchTvl.ts +++ b/src/hooks/useFetchTvl.ts @@ -13,10 +13,12 @@ import { useETHData } from "./useETHData" import { useToken } from "./useToken" import { Token } from "../enums" import { toUsdBalance } from "../utils/getUsdBalance" +import { useAssetPoolContract } from "../web3/hooks/useAssetPoolContract" interface TVLRawData { ecdsaTVL: string tbtcv1TVL: string + coveragePoolTVL: string keepCoveragePoolTVL: string keepStakingTVL: string tStakingTVL: string @@ -27,6 +29,7 @@ interface TVLRawData { interface TVLData { ecdsa: string tbtcv1: string + coveragePool: string keepCoveragePool: string keepStaking: string tStaking: string @@ -38,6 +41,7 @@ const initialState = { ecdsaTVL: "0", tbtcv1TVL: "0", tBTC: "0", + coveragePoolTVL: "0", keepCoveragePoolTVL: "0", keepStakingTVL: "0", tStakingTVL: "0", @@ -52,6 +56,7 @@ export const useFetchTvl = (): [ const { ecdsaTVL, tbtcv1TVL: tbtcTVL, + coveragePoolTVL, keepCoveragePoolTVL, keepStakingTVL, tStakingTVL, @@ -64,6 +69,7 @@ export const useFetchTvl = (): [ const t = useToken(Token.T) const keepBonding = useKeepBondingContract() const multicall = useMulticallContract() + const assetPool = useAssetPoolContract() const keepAssetPool = useKeepAssetPoolContract() const tTokenStaking = useTStakingContract() const keepTokenStaking = useKeepTokenStakingContract() @@ -81,6 +87,11 @@ export const useFetchTvl = (): [ interface: tbtcv1.contract?.interface!, method: "totalSupply", }, + { + address: assetPool?.address!, + interface: assetPool?.interface!, + method: "totalValue", + }, { address: keepAssetPool?.address!, interface: keepAssetPool?.interface!, @@ -112,7 +123,8 @@ export const useFetchTvl = (): [ const [ ethInKeepBonding, tbtcv1TokenTotalSupply, - coveragePoolTvl, + coveragePoolTVL, + keepCoveragePoolTVL, keepStaking, tStaking, tBTCTokenTotalSupply, @@ -121,7 +133,8 @@ export const useFetchTvl = (): [ const data: TVLRawData = { ecdsaTVL: ethInKeepBonding, tbtcv1TVL: tbtcv1TokenTotalSupply, - keepCoveragePoolTVL: coveragePoolTvl, + coveragePoolTVL: coveragePoolTVL, + keepCoveragePoolTVL: keepCoveragePoolTVL, keepStakingTVL: keepStaking, tStakingTVL: tStaking, tBTC: tBTCTokenTotalSupply, @@ -137,6 +150,11 @@ export const useFetchTvl = (): [ const tbtcv1USD = toUsdBalance(formatUnits(tbtcTVL), tbtcv1.usdConversion) const tBTCUSD = toUsdBalance(formatUnits(tBTCTVL), tBTCToken.usdConversion) + const coveragePool = toUsdBalance( + formatUnits(coveragePoolTVL), + t.usdConversion + ) + const keepCoveragePool = toUsdBalance( formatUnits(keepCoveragePoolTVL), keep.usdConversion @@ -152,6 +170,7 @@ export const useFetchTvl = (): [ return { ecdsa: ecdsa.toString(), tbtcv1: tbtcv1USD.toString(), + coveragePool: coveragePool.toString(), keepCoveragePool: keepCoveragePool.toString(), keepStaking: keepStaking.toString(), tStaking: tStaking.toString(), From 24f58ac19b323b302884b32888460728fd2e521d Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 14 Sep 2023 11:57:12 +0200 Subject: [PATCH 04/14] Create CoveragePoolsTVLCard --- src/pages/Overview/Network/index.tsx | 2 ++ .../CoveragePools/CoveragePoolsTVLCard.tsx | 22 +++++++++++++++++++ src/pages/tBTC/CoveragePools/index.tsx | 1 + 3 files changed, 25 insertions(+) create mode 100644 src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx create mode 100644 src/pages/tBTC/CoveragePools/index.tsx diff --git a/src/pages/Overview/Network/index.tsx b/src/pages/Overview/Network/index.tsx index 0ee45b9a7..e6d2833b8 100644 --- a/src/pages/Overview/Network/index.tsx +++ b/src/pages/Overview/Network/index.tsx @@ -21,6 +21,7 @@ import { useAppDispatch, useAppSelector } from "../../../hooks/store" import { selectBridgeActivity, tbtcSlice } from "../../../store/tbtc" import ButtonLink from "../../../components/ButtonLink" import upgradeToTIcon from "../../../static/images/upgrade-to-t.svg" +import { CoveragePoolsTVLCard } from "../../tBTC/CoveragePools" const Network: PageComponent = () => { const [tvlInUSD, fetchtTvlData, tvlInTokenUnits] = useFetchTvl() @@ -58,6 +59,7 @@ const Network: PageComponent = () => { isBridgeActivityFetching={isBridgeActivityFetching} /> + diff --git a/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx b/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx new file mode 100644 index 000000000..7363cf530 --- /dev/null +++ b/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx @@ -0,0 +1,22 @@ +import { FC } from "react" +import { H1, BoxProps } from "@threshold-network/components" +import { formatFiatCurrencyAmount } from "../../../utils/formatAmount" +import CardTemplate from "../../Overview/Network/CardTemplate" + +export interface CoveragePoolsTVLCardProps extends BoxProps { + tvl: string +} + +export const CoveragePoolsTVLCard: FC = ({ + tvl, + ...restProps +}) => { + const coveragePoolTVL = formatFiatCurrencyAmount(tvl) + return ( + +

+ {formatFiatCurrencyAmount(coveragePoolTVL)} +

+
+ ) +} diff --git a/src/pages/tBTC/CoveragePools/index.tsx b/src/pages/tBTC/CoveragePools/index.tsx new file mode 100644 index 000000000..951f255d8 --- /dev/null +++ b/src/pages/tBTC/CoveragePools/index.tsx @@ -0,0 +1 @@ +export * from "./CoveragePoolsTVLCard" From 8f8ebbaa7e1fdb9e69c046a7609a1b46aad8d027 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 15 Sep 2023 15:34:56 +0200 Subject: [PATCH 05/14] Create StatHighlightCard Create StatHighlightCard component using compound component pattern. This way we can make simple cards with big value label (which I've called stat highight) more reusable. --- src/components/Link/index.tsx | 4 +- src/components/StatHighlightCard.tsx | 63 +++++++++++++++++++ src/enums/externalHref.ts | 1 + .../Overview/Network/TotalValueLocked.tsx | 16 ++--- src/pages/Overview/Network/index.tsx | 2 +- src/pages/Staking/StakingTVLCard.tsx | 22 ++++++- src/pages/Staking/index.tsx | 2 +- .../CoveragePools/CoveragePoolsTVLCard.tsx | 52 ++++++++++++--- 8 files changed, 138 insertions(+), 24 deletions(-) create mode 100644 src/components/StatHighlightCard.tsx diff --git a/src/components/Link/index.tsx b/src/components/Link/index.tsx index 989bd0c62..abc31f4fc 100644 --- a/src/components/Link/index.tsx +++ b/src/components/Link/index.tsx @@ -17,9 +17,9 @@ type ConditionalLinkProps = | { isExternal?: false; to: string; href?: never } | { isExternal: true; to?: never; href: string } -export type LinkProps = CommonLinkProps & ConditionalLinkProps +export type LinkProps = ChakraLinkProps & CommonLinkProps & ConditionalLinkProps -const Link: FC = forwardRef( +const Link: FC = forwardRef( ({ isExternal, href, to, icon, children, ...props }, ref) => { const defaultColor = useColorModeValue("brand.500", "white") const finalColor = props.color ? props.color : defaultColor diff --git a/src/components/StatHighlightCard.tsx b/src/components/StatHighlightCard.tsx new file mode 100644 index 000000000..2ce38f5d4 --- /dev/null +++ b/src/components/StatHighlightCard.tsx @@ -0,0 +1,63 @@ +import { + BoxProps, + Card, + H1, + HStack, + IconProps, + LabelSm, + TextProps, + VStack, +} from "@threshold-network/components" +import { FC } from "react" +import TooltipIcon from "./TooltipIcon" + +export const StatHighlightCard: FC = ({ children, ...restProps }) => { + return ( + + {children} + + ) +} + +export const StatHighlightTitle: FC<{ title: string } & TextProps> = ({ + title, + children, + ...restProps +}) => { + return ( + + + {title} + + {children} + + ) +} + +export const StatHighlightTitleTooltip: FC< + { label: string | JSX.Element } & IconProps +> = ({ label, ...restProps }) => { + return +} + +export const StatHighlightValue: FC<{ value: string & TextProps }> = ({ + value, + ...restProps +}) => { + return ( +

+ {value} +

+ ) +} + +export const StatHighlightLink: FC<{ href: string & TextProps }> = ({ + href, + ...restProps +}) => { + return ( +

+ {href} +

+ ) +} diff --git a/src/enums/externalHref.ts b/src/enums/externalHref.ts index 46c1dd2f4..86c30a254 100644 --- a/src/enums/externalHref.ts +++ b/src/enums/externalHref.ts @@ -34,4 +34,5 @@ export enum ExternalHref { mintersAndGuardiansDocs = "https://blog.threshold.network/minters-guardians-and-a-strong-tbtc/", tBTCDuneDashboard = "https://dune.com/threshold/tbtc", delight = "https://delightlabs.io", + coveragePoolsDocs = "https://docs.threshold.network/applications/tbtc-v2/coverage-pool", } diff --git a/src/pages/Overview/Network/TotalValueLocked.tsx b/src/pages/Overview/Network/TotalValueLocked.tsx index 37095c983..d76bb8dc8 100644 --- a/src/pages/Overview/Network/TotalValueLocked.tsx +++ b/src/pages/Overview/Network/TotalValueLocked.tsx @@ -1,7 +1,10 @@ import { FC } from "react" -import CardTemplate from "./CardTemplate" -import { H1 } from "@threshold-network/components" import { formatFiatCurrencyAmount } from "../../../utils/formatAmount" +import { + StatHighlightCard, + StatHighlightTitle, + StatHighlightValue, +} from "../../../components/StatHighlightCard" const TotalValueLocked: FC<{ totalValueLocked: number | string }> = ({ totalValueLocked, @@ -9,11 +12,10 @@ const TotalValueLocked: FC<{ totalValueLocked: number | string }> = ({ const tvl = formatFiatCurrencyAmount(totalValueLocked) return ( - -

- {tvl} -

-
+ + + + ) } diff --git a/src/pages/Overview/Network/index.tsx b/src/pages/Overview/Network/index.tsx index e6d2833b8..de606996f 100644 --- a/src/pages/Overview/Network/index.tsx +++ b/src/pages/Overview/Network/index.tsx @@ -59,7 +59,7 @@ const Network: PageComponent = () => { isBridgeActivityFetching={isBridgeActivityFetching} /> - + diff --git a/src/pages/Staking/StakingTVLCard.tsx b/src/pages/Staking/StakingTVLCard.tsx index 88bd6a70f..31167d92e 100644 --- a/src/pages/Staking/StakingTVLCard.tsx +++ b/src/pages/Staking/StakingTVLCard.tsx @@ -1,18 +1,34 @@ import { FC } from "react" import { H1, LabelSm, Card, BoxProps } from "@threshold-network/components" import { formatFiatCurrencyAmount } from "../../utils/formatAmount" +import { + StatHighlightCard, + StatHighlightTitle, + StatHighlightValue, +} from "../../components/StatHighlightCard" export interface StakingTvlCardProps extends BoxProps { - tvl: string + stakingTVL: string } -const StakingTVLCard: FC = ({ tvl, ...restProps }) => { +const StakingTVLCard: FC = ({ + stakingTVL, + ...restProps +}) => { + const formattedStakingTVL = formatFiatCurrencyAmount(stakingTVL) + + return ( + + + + + ) return ( staking tvl -

{formatFiatCurrencyAmount(tvl)}

+

{formatFiatCurrencyAmount(stakingTVL)}

) } diff --git a/src/pages/Staking/index.tsx b/src/pages/Staking/index.tsx index 2d2d58793..01453839a 100644 --- a/src/pages/Staking/index.tsx +++ b/src/pages/Staking/index.tsx @@ -106,7 +106,7 @@ const StakingPage: PageComponent = (props) => { totalRewardsBalance={totalRewardsBalance} /> - + {hasStakes && }
diff --git a/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx b/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx index 7363cf530..66535a0c0 100644 --- a/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx +++ b/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx @@ -1,22 +1,54 @@ import { FC } from "react" -import { H1, BoxProps } from "@threshold-network/components" +import { H1, BoxProps, Center } from "@threshold-network/components" import { formatFiatCurrencyAmount } from "../../../utils/formatAmount" -import CardTemplate from "../../Overview/Network/CardTemplate" +import { + StatHighlightCard, + StatHighlightTitle, + StatHighlightTitleTooltip, + StatHighlightValue, +} from "../../../components/StatHighlightCard" +import Link, { LinkProps } from "../../../components/Link" +import { ExternalHref } from "../../../enums" export interface CoveragePoolsTVLCardProps extends BoxProps { - tvl: string + coveragePoolTVL: string +} + +type LearnMoreLinkProps = Omit + +const LearnMoreLink: FC = ({ children, ...restProps }) => { + return ( + + {children} + + ) } export const CoveragePoolsTVLCard: FC = ({ - tvl, + coveragePoolTVL, ...restProps }) => { - const coveragePoolTVL = formatFiatCurrencyAmount(tvl) + const formattedTVL = formatFiatCurrencyAmount(coveragePoolTVL) + const tooltipLabel = ( + <> + Threshold Coverage Pool serves as a backstop for assets secured by the + tBTC protocol. In the event that secured Bitcoin is los from protocol, + assets from the coverage pool are withdrawn by the risk manager, converted + to BTC, an put back into the protocol to achieve the supply peg as closely + as possible. Learn more + + ) return ( - -

- {formatFiatCurrencyAmount(coveragePoolTVL)} -

-
+ + + + + +
+ + Learn more about Coverage Pools + +
+
) } From 6e3499dfc1990a84b9b25152cc6b33bea4584a89 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 15 Sep 2023 15:43:09 +0200 Subject: [PATCH 06/14] Fix Stat Highlight Tooltip UI --- src/components/StatHighlightCard.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/components/StatHighlightCard.tsx b/src/components/StatHighlightCard.tsx index 2ce38f5d4..6f90c8fe3 100644 --- a/src/components/StatHighlightCard.tsx +++ b/src/components/StatHighlightCard.tsx @@ -37,7 +37,18 @@ export const StatHighlightTitle: FC<{ title: string } & TextProps> = ({ export const StatHighlightTitleTooltip: FC< { label: string | JSX.Element } & IconProps > = ({ label, ...restProps }) => { - return + return ( + + ) } export const StatHighlightValue: FC<{ value: string & TextProps }> = ({ From 4c2547b1736813e0f5f78d119502d4d28a722653 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 15 Sep 2023 16:50:19 +0200 Subject: [PATCH 07/14] Change "TVL" occurences to camelCase The codebases mixes `TVL` and `Tvl` in the variable names. We should stick with one version everywhere. Based on my research all words in camelCase (including names, abbreviations etc.) should have only first letter capitalized (except the first word where all leters should be lowercase). That's why I've changed all occurences of `TVL` to `Tvl`. --- src/components/tBTC/Stats.tsx | 4 +- src/hooks/useFetchTvl.ts | 100 +++++++++--------- src/pages/Overview/Network/index.tsx | 4 +- .../Overview/Network/tBTCBridgeStats.tsx | 8 +- src/pages/Staking/StakingTVLCard.tsx | 14 +-- src/pages/Staking/index.tsx | 4 +- .../components/BridgeProcessEmptyState.tsx | 4 +- .../CoveragePools/CoveragePoolsTVLCard.tsx | 12 +-- src/pages/tBTC/CoveragePools/index.tsx | 2 +- 9 files changed, 76 insertions(+), 76 deletions(-) diff --git a/src/components/tBTC/Stats.tsx b/src/components/tBTC/Stats.tsx index 5501d0e36..a3cdfc160 100644 --- a/src/components/tBTC/Stats.tsx +++ b/src/components/tBTC/Stats.tsx @@ -7,12 +7,12 @@ import { ExternalHref } from "../../enums" import { RecentDeposit } from "../../hooks/tbtc" import Link from "../Link" -export type TVLProps = { +export type TvlProps = { tvl: string tvlInUSD: string } -export const TVL: FC = ({ tvl, tvlInUSD }) => { +export const Tvl: FC = ({ tvl, tvlInUSD }) => { return ( <> TVL diff --git a/src/hooks/useFetchTvl.ts b/src/hooks/useFetchTvl.ts index 9c72fe0e4..5183cd5cc 100644 --- a/src/hooks/useFetchTvl.ts +++ b/src/hooks/useFetchTvl.ts @@ -15,18 +15,18 @@ import { Token } from "../enums" import { toUsdBalance } from "../utils/getUsdBalance" import { useAssetPoolContract } from "../web3/hooks/useAssetPoolContract" -interface TVLRawData { - ecdsaTVL: string - tbtcv1TVL: string - coveragePoolTVL: string - keepCoveragePoolTVL: string - keepStakingTVL: string - tStakingTVL: string +interface TvlRawData { + ecdsaTvl: string + tbtcv1Tvl: string + coveragePoolTvl: string + keepCoveragePoolTvl: string + keepStakingTvl: string + tStakingTvl: string tBTC: string // TODO: add PRE and NU TVL } -interface TVLData { +interface TvlData { ecdsa: string tbtcv1: string coveragePool: string @@ -38,29 +38,29 @@ interface TVLData { } const initialState = { - ecdsaTVL: "0", - tbtcv1TVL: "0", + ecdsaTvl: "0", + tbtcv1Tvl: "0", tBTC: "0", - coveragePoolTVL: "0", - keepCoveragePoolTVL: "0", - keepStakingTVL: "0", - tStakingTVL: "0", + coveragePoolTvl: "0", + keepCoveragePoolTvl: "0", + keepStakingTvl: "0", + tStakingTvl: "0", } export const useFetchTvl = (): [ - TVLData, - () => Promise, - TVLRawData + TvlData, + () => Promise, + TvlRawData ] => { - const [rawData, setRawData] = useState(initialState) + const [rawData, setRawData] = useState(initialState) const { - ecdsaTVL, - tbtcv1TVL: tbtcTVL, - coveragePoolTVL, - keepCoveragePoolTVL, - keepStakingTVL, - tStakingTVL, - tBTC: tBTCTVL, + ecdsaTvl, + tbtcv1Tvl: tbtcTvl, + coveragePoolTvl, + keepCoveragePoolTvl, + keepStakingTvl, + tStakingTvl, + tBTC: tBTCTvl, } = rawData const eth = useETHData() @@ -116,27 +116,27 @@ export const useFetchTvl = (): [ }, ]) - const fetchTVLData = useCallback(async () => { + const fetchTvlData = useCallback(async () => { const chainData = await fetchOnChainData() if (chainData.length === 0) return initialState const [ ethInKeepBonding, tbtcv1TokenTotalSupply, - coveragePoolTVL, - keepCoveragePoolTVL, + coveragePoolTvl, + keepCoveragePoolTvl, keepStaking, tStaking, tBTCTokenTotalSupply, ] = chainData.map((amount: BigNumberish) => amount.toString()) - const data: TVLRawData = { - ecdsaTVL: ethInKeepBonding, - tbtcv1TVL: tbtcv1TokenTotalSupply, - coveragePoolTVL: coveragePoolTVL, - keepCoveragePoolTVL: keepCoveragePoolTVL, - keepStakingTVL: keepStaking, - tStakingTVL: tStaking, + const data: TvlRawData = { + ecdsaTvl: ethInKeepBonding, + tbtcv1Tvl: tbtcv1TokenTotalSupply, + coveragePoolTvl: coveragePoolTvl, + keepCoveragePoolTvl: keepCoveragePoolTvl, + keepStakingTvl: keepStaking, + tStakingTvl: tStaking, tBTC: tBTCTokenTotalSupply, } setRawData(data) @@ -145,27 +145,27 @@ export const useFetchTvl = (): [ }, [fetchOnChainData]) const data = useMemo(() => { - const ecdsa = toUsdBalance(formatUnits(ecdsaTVL), eth.usdPrice) + const ecdsa = toUsdBalance(formatUnits(ecdsaTvl), eth.usdPrice) - const tbtcv1USD = toUsdBalance(formatUnits(tbtcTVL), tbtcv1.usdConversion) - const tBTCUSD = toUsdBalance(formatUnits(tBTCTVL), tBTCToken.usdConversion) + const tbtcv1USD = toUsdBalance(formatUnits(tbtcTvl), tbtcv1.usdConversion) + const tBTCUSD = toUsdBalance(formatUnits(tBTCTvl), tBTCToken.usdConversion) const coveragePool = toUsdBalance( - formatUnits(coveragePoolTVL), + formatUnits(coveragePoolTvl), t.usdConversion ) const keepCoveragePool = toUsdBalance( - formatUnits(keepCoveragePoolTVL), + formatUnits(keepCoveragePoolTvl), keep.usdConversion ) const keepStaking = toUsdBalance( - formatUnits(keepStakingTVL), + formatUnits(keepStakingTvl), keep.usdConversion ) - const tStaking = toUsdBalance(formatUnits(tStakingTVL), t.usdConversion) + const tStaking = toUsdBalance(formatUnits(tStakingTvl), t.usdConversion) return { ecdsa: ecdsa.toString(), @@ -182,14 +182,14 @@ export const useFetchTvl = (): [ .addUnsafe(tStaking) .addUnsafe(tBTCUSD) .toString(), - } as TVLData + } as TvlData }, [ - ecdsaTVL, - keepCoveragePoolTVL, - tbtcTVL, - keepStakingTVL, - tStakingTVL, - tBTCTVL, + ecdsaTvl, + keepCoveragePoolTvl, + tbtcTvl, + keepStakingTvl, + tStakingTvl, + tBTCTvl, eth.usdPrice, keep.usdConversion, tbtcv1.usdConversion, @@ -197,5 +197,5 @@ export const useFetchTvl = (): [ tBTCToken.usdConversion, ]) - return [data, fetchTVLData, rawData] + return [data, fetchTvlData, rawData] } diff --git a/src/pages/Overview/Network/index.tsx b/src/pages/Overview/Network/index.tsx index de606996f..0cdf8002a 100644 --- a/src/pages/Overview/Network/index.tsx +++ b/src/pages/Overview/Network/index.tsx @@ -21,7 +21,7 @@ import { useAppDispatch, useAppSelector } from "../../../hooks/store" import { selectBridgeActivity, tbtcSlice } from "../../../store/tbtc" import ButtonLink from "../../../components/ButtonLink" import upgradeToTIcon from "../../../static/images/upgrade-to-t.svg" -import { CoveragePoolsTVLCard } from "../../tBTC/CoveragePools" +import { CoveragePoolsTvlCard } from "../../tBTC/CoveragePools" const Network: PageComponent = () => { const [tvlInUSD, fetchtTvlData, tvlInTokenUnits] = useFetchTvl() @@ -59,7 +59,7 @@ const Network: PageComponent = () => { isBridgeActivityFetching={isBridgeActivityFetching} /> - + diff --git a/src/pages/Overview/Network/tBTCBridgeStats.tsx b/src/pages/Overview/Network/tBTCBridgeStats.tsx index c4c563eb7..041a4a45c 100644 --- a/src/pages/Overview/Network/tBTCBridgeStats.tsx +++ b/src/pages/Overview/Network/tBTCBridgeStats.tsx @@ -4,11 +4,11 @@ import { ProtocolHistory, ProtocolHistoryProps, TBTCText, - TVL, - TVLProps, + Tvl, + TvlProps, } from "../../../components/tBTC" -type TBTCBridgeStatsProps = ProtocolHistoryProps & TVLProps +type TBTCBridgeStatsProps = ProtocolHistoryProps & TvlProps export const TBTCBridgeStats: FC = ({ tvl, @@ -20,7 +20,7 @@ export const TBTCBridgeStats: FC = ({ Bridge Stats - + diff --git a/src/pages/Staking/StakingTVLCard.tsx b/src/pages/Staking/StakingTVLCard.tsx index 31167d92e..fbf7b94ca 100644 --- a/src/pages/Staking/StakingTVLCard.tsx +++ b/src/pages/Staking/StakingTVLCard.tsx @@ -8,19 +8,19 @@ import { } from "../../components/StatHighlightCard" export interface StakingTvlCardProps extends BoxProps { - stakingTVL: string + stakingTvl: string } -const StakingTVLCard: FC = ({ - stakingTVL, +const StakingTvlCard: FC = ({ + stakingTvl, ...restProps }) => { - const formattedStakingTVL = formatFiatCurrencyAmount(stakingTVL) + const formattedStakingTvl = formatFiatCurrencyAmount(stakingTvl) return ( - + ) return ( @@ -28,9 +28,9 @@ const StakingTVLCard: FC = ({ staking tvl -

{formatFiatCurrencyAmount(stakingTVL)}

+

{formatFiatCurrencyAmount(stakingTvl)}

) } -export default StakingTVLCard +export default StakingTvlCard diff --git a/src/pages/Staking/index.tsx b/src/pages/Staking/index.tsx index 01453839a..c80a79641 100644 --- a/src/pages/Staking/index.tsx +++ b/src/pages/Staking/index.tsx @@ -1,5 +1,5 @@ import { useEffect, useMemo } from "react" -import StakingTVLCard from "./StakingTVLCard" +import StakingTvlCard from "./StakingTvlCard" import StakedPortfolioCard from "./StakedPortfolioCard" import PageLayout from "../PageLayout" import StakeCard from "./StakeCard" @@ -106,7 +106,7 @@ const StakingPage: PageComponent = (props) => { totalRewardsBalance={totalRewardsBalance} /> - + {hasStakes && }
diff --git a/src/pages/tBTC/Bridge/components/BridgeProcessEmptyState.tsx b/src/pages/tBTC/Bridge/components/BridgeProcessEmptyState.tsx index d7891a6eb..a97b1cd47 100644 --- a/src/pages/tBTC/Bridge/components/BridgeProcessEmptyState.tsx +++ b/src/pages/tBTC/Bridge/components/BridgeProcessEmptyState.tsx @@ -6,7 +6,7 @@ import { ProtocolHistoryRecentDeposits, ProtocolHistoryTitle, ProtocolHistoryViewMoreLink, - TVL, + Tvl, } from "../../../../components/tBTC" import { useFetchRecentDeposits } from "../../../../hooks/tbtc" import { useFetchTvl } from "../../../../hooks/useFetchTvl" @@ -32,7 +32,7 @@ export const BridgeProcessEmptyState: FC<{
{title}
- + @@ -24,11 +24,11 @@ const LearnMoreLink: FC = ({ children, ...restProps }) => { ) } -export const CoveragePoolsTVLCard: FC = ({ - coveragePoolTVL, +export const CoveragePoolsTvlCard: FC = ({ + coveragePoolTvl, ...restProps }) => { - const formattedTVL = formatFiatCurrencyAmount(coveragePoolTVL) + const formattedTvl = formatFiatCurrencyAmount(coveragePoolTvl) const tooltipLabel = ( <> Threshold Coverage Pool serves as a backstop for assets secured by the @@ -43,7 +43,7 @@ export const CoveragePoolsTVLCard: FC = ({ - +
Learn more about Coverage Pools diff --git a/src/pages/tBTC/CoveragePools/index.tsx b/src/pages/tBTC/CoveragePools/index.tsx index 951f255d8..363963aab 100644 --- a/src/pages/tBTC/CoveragePools/index.tsx +++ b/src/pages/tBTC/CoveragePools/index.tsx @@ -1 +1 @@ -export * from "./CoveragePoolsTVLCard" +export * from "./CoveragePoolsTvlCard" From bf1048794d164649b07e6fdc1ce423de23331311 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 15 Sep 2023 18:34:54 +0200 Subject: [PATCH 08/14] Rename CoveragePoolsTVLCard --- .../{CoveragePoolsTVLCard.tsx => CoveragePoolsTvlCard.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/pages/tBTC/CoveragePools/{CoveragePoolsTVLCard.tsx => CoveragePoolsTvlCard.tsx} (100%) diff --git a/src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx b/src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx similarity index 100% rename from src/pages/tBTC/CoveragePools/CoveragePoolsTVLCard.tsx rename to src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx From 203a931ed0a9e97c7d74060620519546d1430b4e Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 15 Sep 2023 18:40:20 +0200 Subject: [PATCH 09/14] Remove `StatHighlightLink` The component was pushed by mistake - it is not used anywhere. --- src/components/StatHighlightCard.tsx | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/components/StatHighlightCard.tsx b/src/components/StatHighlightCard.tsx index 6f90c8fe3..8e0a5b536 100644 --- a/src/components/StatHighlightCard.tsx +++ b/src/components/StatHighlightCard.tsx @@ -61,14 +61,3 @@ export const StatHighlightValue: FC<{ value: string & TextProps }> = ({ ) } - -export const StatHighlightLink: FC<{ href: string & TextProps }> = ({ - href, - ...restProps -}) => { - return ( -

- {href} -

- ) -} From 772aaf55ff25f6e59b0973472e6eef41e05d92fb Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Mon, 18 Sep 2023 14:29:53 +0200 Subject: [PATCH 10/14] Import correct cov pools version `useAssetPoolContract` should import t coverage pools and `useKeepAssetPoolContract` should import keep coverage pools. --- src/web3/hooks/useAssetPoolContract.ts | 2 +- src/web3/hooks/useKeepAssetPoolContract.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web3/hooks/useAssetPoolContract.ts b/src/web3/hooks/useAssetPoolContract.ts index 1dafb7bac..a4d4aea00 100644 --- a/src/web3/hooks/useAssetPoolContract.ts +++ b/src/web3/hooks/useAssetPoolContract.ts @@ -1,5 +1,5 @@ import { useContract } from "./useContract" -import AssetPool from "@keep-network/coverage-pools/artifacts/AssetPool.json" +import AssetPool from "@threshold-network/coverage-pools/artifacts/AssetPool.json" export const useAssetPoolContract = () => { return useContract(AssetPool.address, AssetPool.abi) diff --git a/src/web3/hooks/useKeepAssetPoolContract.ts b/src/web3/hooks/useKeepAssetPoolContract.ts index de2fa8d91..99f20fa29 100644 --- a/src/web3/hooks/useKeepAssetPoolContract.ts +++ b/src/web3/hooks/useKeepAssetPoolContract.ts @@ -1,5 +1,5 @@ import { useContract } from "./useContract" -import AssetPool from "@threshold-network/coverage-pools/artifacts/AssetPool.json" +import AssetPool from "@keep-network/coverage-pools/artifacts/AssetPool.json" export const useKeepAssetPoolContract = () => { return useContract(AssetPool.address, AssetPool.abi) From 552188c2eca6ac2ba563e0369636ced8a28ea3b0 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Mon, 18 Sep 2023 14:43:17 +0200 Subject: [PATCH 11/14] Rename `StakingTvlCard` --- src/pages/Staking/{StakingTVLCard.tsx => StakingTvlCard.tsx} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/pages/Staking/{StakingTVLCard.tsx => StakingTvlCard.tsx} (100%) diff --git a/src/pages/Staking/StakingTVLCard.tsx b/src/pages/Staking/StakingTvlCard.tsx similarity index 100% rename from src/pages/Staking/StakingTVLCard.tsx rename to src/pages/Staking/StakingTvlCard.tsx From 76a097a834a9bc94cba4c4c356f6c69ba6f79f20 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 21 Sep 2023 17:32:02 +0200 Subject: [PATCH 12/14] Remove unnecessary margin The margin doesn't do anything and is not needed since `LearnMoreLink` component is wrapped with `Center` component. --- src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx b/src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx index b2eef4094..3e75b38d1 100644 --- a/src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx +++ b/src/pages/tBTC/CoveragePools/CoveragePoolsTvlCard.tsx @@ -45,9 +45,7 @@ export const CoveragePoolsTvlCard: FC = ({
- - Learn more about Coverage Pools - + Learn more about Coverage Pools
) From 223a0344020cc53cc527e909fbd3875af6099119 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Thu, 21 Sep 2023 17:52:54 +0200 Subject: [PATCH 13/14] Fix tests for `useFetchTvl` hook Adds t coverage pool to the `useFetchTvl` hook test. Thanks to the tests I've noticed that I didn't add t coverage pool to the `total` value. Always write tests i guess... --- src/hooks/__tests__/useFetchTvl.test.tsx | 48 ++++++++++++++++++------ src/hooks/useFetchTvl.ts | 3 +- 2 files changed, 39 insertions(+), 12 deletions(-) diff --git a/src/hooks/__tests__/useFetchTvl.test.tsx b/src/hooks/__tests__/useFetchTvl.test.tsx index 7b0444fba..923517741 100644 --- a/src/hooks/__tests__/useFetchTvl.test.tsx +++ b/src/hooks/__tests__/useFetchTvl.test.tsx @@ -2,6 +2,7 @@ import { renderHook } from "@testing-library/react-hooks" import * as ethersUnits from "@ethersproject/units" import { Token } from "../../enums" import { + useAssetPoolContract, useKeepAssetPoolContract, useKeepBondingContract, useKeepTokenStakingContract, @@ -15,9 +16,11 @@ import * as useTokenModule from "../useToken" import { TokenContext } from "../../contexts/TokenContext" import * as usdUtils from "../../utils/getUsdBalance" import { useTBTCv2TokenContract } from "../../web3/hooks/useTBTCv2TokenContract" +import { FC } from "react" jest.mock("../../web3/hooks", () => ({ ...(jest.requireActual("../../web3/hooks") as {}), + useAssetPoolContract: jest.fn(), useKeepAssetPoolContract: jest.fn(), useKeepBondingContract: jest.fn(), useKeepTokenStakingContract: jest.fn(), @@ -63,10 +66,11 @@ describe("Test `useFetchTvl` hook", () => { const mockedKeepBondingContract = { address: "0x0" } const mockedTStakingContract = { address: "0x2" } const mockedMultiCallContract = { interface: {}, address: "0x3" } - const mockedKeepAssetPoolContract = { interface: {}, address: "0x4" } - const mockedtBTCTokenContract = { interface: {}, address: "0x5" } + const mockedAssetPoolContract = { interface: {}, address: "0x4" } + const mockedKeepAssetPoolContract = { interface: {}, address: "0x5" } + const mockedtBTCTokenContract = { interface: {}, address: "0x6" } - const wrapper = ({ children }) => ( + const wrapper: FC = ({ children }) => ( { ;(useMulticallContract as jest.Mock).mockReturnValue( mockedMultiCallContract ) + ;(useAssetPoolContract as jest.Mock).mockReturnValue( + mockedAssetPoolContract + ) ;(useKeepAssetPoolContract as jest.Mock).mockReturnValue( mockedKeepAssetPoolContract ) @@ -108,7 +115,11 @@ describe("Test `useFetchTvl` hook", () => { // given const ethInKeepBonding = { raw: "10000000000000000000", format: "10.0" } const tbtcTokenTotalSupply = { raw: "5000000000000000000", format: "5.0" } - const coveragePoolTvl = { raw: "300000000000000000000", format: "300.0" } + const coveragePoolTvl = { raw: "500000000000000000000", format: "500.0" } + const keepCoveragePoolTvl = { + raw: "300000000000000000000", + format: "300.0", + } const keepStaking = { raw: "500000000000000000000", format: "500.0" } const tStaking = { raw: "600000000000000000000", format: "600.0" } const tBTC = { raw: "700000000000000000000", format: "700.0" } @@ -117,6 +128,7 @@ describe("Test `useFetchTvl` hook", () => { ethInKeepBonding.raw, tbtcTokenTotalSupply.raw, coveragePoolTvl.raw, + keepCoveragePoolTvl.raw, keepStaking.raw, tStaking.raw, tBTC.raw, @@ -131,7 +143,8 @@ describe("Test `useFetchTvl` hook", () => { const _expectedResult = { ecdsa: +ethInKeepBonding.format * mockedETHData.usdPrice, tbtc: +tbtcTokenTotalSupply.format * tbtcv1Context.usdConversion, - keepCoveragePool: +coveragePoolTvl.format * keepContext.usdConversion, + coveragePool: +coveragePoolTvl.format * tContext.usdConversion, + keepCoveragePool: +keepCoveragePoolTvl.format * keepContext.usdConversion, keepStaking: +keepStaking.format * keepContext.usdConversion, tStaking: +tStaking.format * tContext.usdConversion, tBTC: +tBTC.format * tBTCContext.usdConversion, @@ -142,6 +155,7 @@ describe("Test `useFetchTvl` hook", () => { const expectedResult = { ecdsa: `${_expectedResult.ecdsa.toString()}.0`, tbtcv1: `${_expectedResult.tbtc.toString()}.0`, + coveragePool: `${_expectedResult.coveragePool.toString()}.0`, keepCoveragePool: `${_expectedResult.keepCoveragePool.toString()}.0`, keepStaking: `${_expectedResult.keepStaking.toString()}.0`, tStaking: `${_expectedResult.tStaking.toString()}.0`, @@ -149,6 +163,7 @@ describe("Test `useFetchTvl` hook", () => { total: `${ _expectedResult.ecdsa + _expectedResult.tbtc + + _expectedResult.coveragePool + _expectedResult.keepCoveragePool + _expectedResult.keepStaking + _expectedResult.tStaking + @@ -169,6 +184,7 @@ describe("Test `useFetchTvl` hook", () => { expect(spyOnUseToken).toHaveBeenCalledWith(Token.TBTCV2) expect(useKeepBondingContract).toHaveBeenCalled() expect(useMulticallContract).toHaveBeenCalled() + expect(useAssetPoolContract).toHaveBeenCalled() expect(useKeepAssetPoolContract).toHaveBeenCalled() expect(useTStakingContract).toHaveBeenCalled() expect(useKeepTokenStakingContract).toHaveBeenCalled() @@ -184,6 +200,11 @@ describe("Test `useFetchTvl` hook", () => { address: tbtcv1Context.contract.address, method: "totalSupply", }, + { + interface: mockedAssetPoolContract.interface, + address: mockedAssetPoolContract.address, + method: "totalValue", + }, { interface: mockedKeepAssetPoolContract.interface, address: mockedKeepAssetPoolContract.address, @@ -225,32 +246,37 @@ describe("Test `useFetchTvl` hook", () => { ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 7, + 8, ethInKeepBonding.format, mockedETHData.usdPrice ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 8, + 9, tbtcTokenTotalSupply.format, tbtcv1Context.usdConversion ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 9, + 10, tBTC.format, tBTCContext.usdConversion ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 10, + 11, coveragePoolTvl.format, + tContext.usdConversion + ) + expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( + 12, + keepCoveragePoolTvl.format, keepContext.usdConversion ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 11, + 13, keepStaking.format, keepContext.usdConversion ) expect(spyOnToUsdBalance).toHaveBeenNthCalledWith( - 12, + 14, tStaking.format, tContext.usdConversion ) diff --git a/src/hooks/useFetchTvl.ts b/src/hooks/useFetchTvl.ts index 5183cd5cc..fc21632da 100644 --- a/src/hooks/useFetchTvl.ts +++ b/src/hooks/useFetchTvl.ts @@ -5,6 +5,7 @@ import { useKeepBondingContract, useMulticall, useMulticallContract, + useAssetPoolContract, useKeepAssetPoolContract, useTStakingContract, useKeepTokenStakingContract, @@ -13,7 +14,6 @@ import { useETHData } from "./useETHData" import { useToken } from "./useToken" import { Token } from "../enums" import { toUsdBalance } from "../utils/getUsdBalance" -import { useAssetPoolContract } from "../web3/hooks/useAssetPoolContract" interface TvlRawData { ecdsaTvl: string @@ -177,6 +177,7 @@ export const useFetchTvl = (): [ tBTC: tBTCUSD.toString(), total: ecdsa .addUnsafe(tbtcv1USD) + .addUnsafe(coveragePool) .addUnsafe(keepCoveragePool) .addUnsafe(keepStaking) .addUnsafe(tStaking) From b53ac0263d988c88bcb5a7db0fcaa080ccd6a620 Mon Sep 17 00:00:00 2001 From: michalsmiarowski Date: Fri, 22 Sep 2023 12:43:19 +0200 Subject: [PATCH 14/14] Update README with proper goerli contracts --- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d237a38a1..c8b3c04af 100644 --- a/README.md +++ b/README.md @@ -61,18 +61,30 @@ REACT_APP_MULTICALL_ADDRESS=$MULTICALL_ADDRESS ## Install Görli contracts ``` -yarn upgrade @threshold-network/solidity-contracts@goerli \ - @keep-network/keep-core@1.8.1-goerli.0 \ +yarn upgrade @keep-network/coverage-pools@goerli \ + @keep-network/ecdsa@goerli \ + @keep-network/keep-core@goerli \ @keep-network/keep-ecdsa@goerli \ + @keep-network/random-beacon@goerli \ @keep-network/tbtc@goerli \ - @keep-network/coverage-pools@goerli + @keep-network/tbtc-v2@goerli \ + @keep-network/tbtc-v2.ts@goerli \ + @threshold-network/coverage-pools@npm:@keep-network/coverage-pools@goerli \ + @threshold-network/solidity-contracts@goerli \ ``` -**NOTE 1:** We provide explicit version of the `keep-core` package, because -using `goerli` tag results in `expected manifest` error - probably caused by bug -in Yarn: https://github.com/yarnpkg/yarn/issues/4731. +**NOTE 1:** We use the same Goerli versions for both +`@keep-network/coverage-pools` and `@threshold-network/coverage-pools`, because +we don't have the newest version of the package on Goerli network, only on the +Mainnet. -**NOTE 2:** The `token-dashboard` package contains an indirect dependency to +**NOTE 2:** If you encounter an `expected manifest` error while executing this, +then try providing an explicit version of the `keep-core` package: +`@keep-network/keep-core@1.8.1-goerli.0` +The error is probably caused by a bug in Yarn: +https://github.com/yarnpkg/yarn/issues/4731. + +**NOTE 3:** The `token-dashboard` package contains an indirect dependency to `@summa-tx/relay-sol@2.0.2` package, which downloads one of its sub-dependencies via unathenticated `git://` protocol. That protocol is no longer supported by GitHub. This means that in certain situations installation of the package or