Skip to content

Commit

Permalink
Merge branch 'dev' into add-credit-guild-earn-page
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0neerpat committed Jul 10, 2024
2 parents fe440da + aafec60 commit 3e49053
Show file tree
Hide file tree
Showing 30 changed files with 1,008 additions and 550 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
6 changes: 3 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
script-src 'self' blob: https://kb.wowto.ai https://app.wowto.ai http://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/matomo.js https://usekeyp.matomo.cloud/matomo.js;
media-src 'self';
img-src 'self' data: blob: https://explorer-api.walletconnect.com https://usekeyp.matomo.cloud https://app.opendollar.com;
connect-src 'self' blob: https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
connect-src 'self' blob: https://eth-pokt.nodies.app http://localhost:3000 https://*.quiknode.pro https://api.opensea.io https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://eth.llamarpc.com https://base.llamarpc.com https://polygon-bor-rpc.publicnode.com https://eth-pokt.nodies.app https://polygon-pokt.nodies.app https://op-pokt.nodies.app https://arb-pokt.nodies.app https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
object-src 'self' blob:;
form-action 'self';
font-src 'self' data: https://fonts.gstatic.com;
Expand Down 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
Binary file added src/assets/turtle-club.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@ const ETH: AddEthereumChainParameter['nativeCurrency'] = {
decimals: 18,
}

export const RPC_URL_ETHEREUM =
process.env.REACT_APP_RPC_URL_ETHEREUM && process.env.NODE_ENV !== 'development'
? process.env.REACT_APP_RPC_URL_ETHEREUM
: 'https://eth.llamarpc.com'
export const RPC_URL_ETHEREUM = process.env.REACT_APP_RPC_URL_ETHEREUM
? process.env.REACT_APP_RPC_URL_ETHEREUM
: 'https://eth.llamarpc.com'
export const RPC_URL_ARBITRUM = 'https://arbitrum.blockpi.network/v1/rpc/public'
export const RPC_URL_OPTIMISM = 'https://op-pokt.nodies.app'
export const RPC_URL_POLYGON = 'https://polygon-bor-rpc.publicnode.com'
Expand Down
8 changes: 4 additions & 4 deletions src/components/Bolts/AddressCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import styled from 'styled-components'

interface AddressCellProps {
address: string
userFuulDataAddress: string
userBoltsDataAddress: string
data: LeaderboardUser[]
}

const AddressCell: React.FC<AddressCellProps> = ({ address, userFuulDataAddress, data }) => {
const AddressCell: React.FC<AddressCellProps> = ({ address, userBoltsDataAddress, data }) => {
const userInTop10 = useMemo(() => data.find((user) => user.rank <= 10 && user.address === address), [data, address])
// Skip ENS check for users not in the top 10
const resolvedAddress = useAddress(address, 0, !userInTop10)

return (
<Address>
{userFuulDataAddress === address && (
{userBoltsDataAddress === address && (
<Badge
style={{
backgroundColor: '#e2f1ff',
Expand All @@ -43,7 +43,7 @@ const AddressCell: React.FC<AddressCellProps> = ({ address, userFuulDataAddress,
export default React.memo(AddressCell, (prevProps, nextProps) => {
return (
prevProps.address === nextProps.address &&
prevProps.userFuulDataAddress === nextProps.userFuulDataAddress &&
prevProps.userBoltsDataAddress === nextProps.userBoltsDataAddress &&
prevProps.data === nextProps.data
)
})
Expand Down
3 changes: 0 additions & 3 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ const Footer: React.FC = () => {
<Row className="linksContainer">
<Column>
<Header>PROJECT</Header>
<Link target="_blank" href="https://app.opendollar.com/">
Join Testnet
</Link>
<Link target="_blank" href="https://docs.opendollar.com/">
Docs
</Link>
Expand Down
10 changes: 0 additions & 10 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,7 +27,6 @@ const Steps = () => {
const { popupsModel: popupsActions, connectWalletModel: connectWalletActions } = useStoreActions((state) => state)

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

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

Expand All @@ -42,14 +40,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
12 changes: 10 additions & 2 deletions src/containers/Analytics/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const Analytics = () => {
globalDebt,
globalDebtCeiling,
globalDebtUtilization,
surplusInTreasury,
marketPrice,
redemptionPrice,
totalLiquidity,
Expand Down Expand Up @@ -162,6 +163,13 @@ const Analytics = () => {

const circulation = { title: 'circulation', value: erc20Supply, description: 'Circulating supply of OD stablecoin' }

const surplusInTreasuryData: DataCardProps = {
title: 'Surplus in Treasury',
value: surplusInTreasury,
description:
"Total OD accrued by the system's stability fees. It's stored in the Stability Fee Treasury accountance",
}

const liquidityUniswap = {
title: 'OD/ETH Liquidity in Camelot',
value: totalLiquidity,
Expand Down Expand Up @@ -244,6 +252,7 @@ const Analytics = () => {
// totalFeesEarned,
globalDebtUtilizationData,
globalDebtData,
surplusInTreasuryData,
]

const pricesData: DataCardProps[] = [
Expand All @@ -267,7 +276,6 @@ const Analytics = () => {
0,
true
).toString()

const colRows = Object.fromEntries(
Object.entries(analyticsData?.tokenAnalyticsData).map(([key, value]) => {
const lockedAmountInUsd = multiplyWad(
Expand Down Expand Up @@ -324,7 +332,7 @@ const Analytics = () => {
analyticsData.globalDebt,
analyticsData.globalDebtCeiling
),
surplusInTreasury: formatDataNumber(analyticsData.surplusInTreasury, 18, 0, true),
surplusInTreasury: `${formatDataNumber(analyticsData.surplusInTreasury, 18, 0)} OD`,
marketPrice: formatDataNumber(analyticsData.marketPrice, 18, 3, true, undefined, 4),
redemptionPrice: formatDataNumber(analyticsData.redemptionPrice, 18, 3, true, undefined, 4),
totalLiquidity: formattedLiquidity,
Expand Down
Loading

0 comments on commit 3e49053

Please sign in to comment.