Skip to content

Commit

Permalink
WETH collateral release (#628)
Browse files Browse the repository at this point in the history
* 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

---------

Co-authored-by: Jacob Habib <[email protected]>
Co-authored-by: Iana <[email protected]>
  • Loading branch information
3 people authored Jul 10, 2024
1 parent 8d46f47 commit c796625
Show file tree
Hide file tree
Showing 25 changed files with 955 additions and 437 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
"@ethersproject/address": "^5.0.10",
"@ethersproject/experimental": "5.4.0",
"@ethersproject/providers": "5.4.5",
"@fuul/sdk": "^4.7.1",
"@opendollar/sdk": "1.7.3-rc.1",
"@opendollar/sdk": "1.7.4-rc.1",
"@opendollar/svg-generator": "1.0.5",
"@react-spring/web": "^9.7.3",
"@sentry/cli": "^2.31.0",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@
<title>OD | App</title>

<!-- Matomo -->
<script src="./tracking.js" defer></script>
<script src="https://usekeyp.matomo.cloud/matomo.js" async defer></script>
<script src="./tracking.js"></script>
<script src="https://usekeyp.matomo.cloud/matomo.js"></script>
<!-- End Matomo Code -->
<script type="text/javascript" src="https://kb.wowto.ai/widgets/M4cmuZpuJqb/widget.js" async defer></script>
</head>
Expand Down
18 changes: 3 additions & 15 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ import GeoBlockContainer from './containers/GeoBlockContainer'
import * as Sentry from '@sentry/react'
import Earn from './containers/Earn'
import Bolts from './containers/Bolts'
import { Fuul } from '@fuul/sdk'
import EarnDetails from './containers/Earn/EarnDetails'
import Marketplace from './containers/Marketplace'
import ScreenLoader from '~/components/Modals/ScreenLoader'
import Explore from '~/containers/Explore'

import 'react-loading-skeleton/dist/skeleton.css'

const ToastContainer = lazy(() => import('react-toastify').then((module) => ({ default: module.ToastContainer })))
Expand All @@ -47,20 +48,6 @@ Sentry.init({
environment: process.env.NODE_ENV,
})

const network = process.env.REACT_APP_NETWORK_ID
const fuulApiKey = process.env.REACT_APP_FUUL_API_KEY
// Only initialize Fuul on Arbitrum One
if (network === '42161' && fuulApiKey) {
try {
Fuul.init({
apiKey: fuulApiKey,
})
Fuul.sendPageview()
} catch (e) {
console.log(e)
}
}

const App = () => {
const location = useLocation()

Expand Down Expand Up @@ -101,6 +88,7 @@ const App = () => {
<Route exact strict component={Marketplace} path={'/marketplace'} />
<Route exact strict component={CreateVault} path={'/vaults/create'} />
<Route exact strict component={Bridge} path={'/bridge'} />
<Route exact strict component={Explore} path={'/explore'} />
<Route
exact
strict
Expand Down
98 changes: 58 additions & 40 deletions src/components/Modals/WaitingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,54 +71,72 @@ const WaitingModal = () => {
)
}
}

return (
<Modal width={'445px'} isModalOpen={popupsState.isWaitingModalOpen} handleModalContent>
<InnerContainer data-test-id="waiting-modal" ref={modalRef}>
{returnStatusIcon(status)}
<TextColumnContainer>
{
<Title data-test-id="waiting-modal-title" className={status}>
{title ? title : t('initializing')}
</Title>
}

{text || (status === 'success' && !isCreate) ? (
<Text className={status}>
{status === 'success' && chainId && hash ? (
<a
href={getEtherscanLink(chainId, hash, 'transaction')}
target="_blank"
rel="noopener noreferrer"
>
{t('view_arbiscan')}
</a>
) : status === 'success' && isCreate ? (
<CreateNew>
<Loader width={'14px'} /> {text}
</CreateNew>
) : (
text
)}
</Text>
) : null}
{hint && <Hint>{hint}</Hint>}

{status !== 'loading' && !isCreate ? (
<BtnContainer>
<Button
text={status === 'success' ? 'close' : 'dismiss'}
onClick={() => popupsActions.setIsWaitingModalOpen(false)}
/>
</BtnContainer>
) : null}
</TextColumnContainer>
</InnerContainer>
<Wrapper data-test-id="waiting-modal" ref={modalRef}>
{!title && !text && !hint && !hash ? (
<LoaderWrapper>
<Loader width="200px" color="#1A74EC" />
</LoaderWrapper>
) : (
<InnerContainer>
{returnStatusIcon(status)}
<TextColumnContainer>
{
<Title data-test-id="waiting-modal-title" className={status}>
{title ? title : t('initializing')}
</Title>
}

{text || (status === 'success' && !isCreate) ? (
<Text className={status}>
{status === 'success' && chainId && hash ? (
<a
href={getEtherscanLink(chainId, hash, 'transaction')}
target="_blank"
rel="noopener noreferrer"
>
{t('view_arbiscan')}
</a>
) : status === 'success' && isCreate ? (
<CreateNew>
<Loader width={'14px'} /> {text}
</CreateNew>
) : (
text
)}
</Text>
) : null}
{hint && <Hint>{hint}</Hint>}

{status !== 'loading' && !isCreate ? (
<BtnContainer>
<Button
text={status === 'success' ? 'close' : 'dismiss'}
onClick={() => popupsActions.setIsWaitingModalOpen(false)}
/>
</BtnContainer>
) : null}
</TextColumnContainer>
</InnerContainer>
)}
</Wrapper>
</Modal>
)
}

export default WaitingModal

const Wrapper = styled.div``

const LoaderWrapper = styled.div`
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
`

const TextColumnContainer = styled.div`
display: flex;
flex-direction: column;
Expand Down
14 changes: 3 additions & 11 deletions src/components/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { COIN_TICKER } from '~/utils'
import useGeb from '~/hooks/useGeb'
import { Tooltip as ReactTooltip } from 'react-tooltip'
import { checkUserGasBalance } from '~/utils'
import useFuulSDK from '~/hooks/useFuulSDK'
import LowGasModal from './Modals/LowGasModal'

const Steps = () => {
Expand All @@ -28,11 +27,12 @@ const Steps = () => {
const { popupsModel: popupsActions, connectWalletModel: connectWalletActions } = useStoreActions((state) => state)

const addTransaction = useTransactionAdder()
const { sendConnectWalletEvent } = useFuulSDK()

const { step, isWrongNetwork, isStepLoading, blockNumber, ctHash } = connectWalletState

const handleConnectWallet = () => popupsActions.setIsConnectorsWalletOpen(true)
const handleConnectWallet = () => {
popupsActions.setIsConnectorsWalletOpen(true)
}

const handleCreateAccount = async () => {
if (!account || !provider || !chainId) return false
Expand All @@ -42,14 +42,6 @@ const Steps = () => {
return
}
try {
const referralProgram = localStorage.getItem('referralProgram') === 'true'
if (referralProgram) {
try {
await sendConnectWalletEvent(account)
} catch (e) {
console.debug('User declined Fuul program ', e)
}
}
const txData = await geb.contracts.proxyRegistry.populateTransaction['build()']()
const signer = provider.getSigner(account)
connectWalletActions.setIsStepLoading(true)
Expand Down
20 changes: 12 additions & 8 deletions src/components/VaultStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,12 @@ const VaultStats = ({
}}
>
Safety:{' '}
{Number(
safeState.liquidationData!.collateralLiquidationData[collateralName]
.safetyCRatio
) * 100}
{Math.round(
Number(
safeState.liquidationData!.collateralLiquidationData[collateralName]
.safetyCRatio
) * 100
)}
%
</span>{' '}
&nbsp;
Expand All @@ -229,10 +231,12 @@ const VaultStats = ({
}}
>
Minimum:{' '}
{Number(
safeState.liquidationData!.collateralLiquidationData[collateralName]
.liquidationCRatio
) * 100}
{Math.round(
Number(
safeState.liquidationData!.collateralLiquidationData[collateralName]
.liquidationCRatio
) * 100
)}
%
</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Analytics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const Analytics = () => {
title: 'Surplus in Treasury',
value: surplusInTreasury,
description:
"Total HAI accrued by the system's stability fees. It's stored in the Stability Fee Treasury accountance",
"Total OD accrued by the system's stability fees. It's stored in the Stability Fee Treasury accountance",
}

const liquidityUniswap = {
Expand Down
Loading

0 comments on commit c796625

Please sign in to comment.