Skip to content
This repository was archived by the owner on Dec 18, 2023. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
36f0468
staking reducer, updater, actions
kyscott18 Feb 22, 2022
7edb32c
new external staking rewards hook
kyscott18 Feb 22, 2022
04611c7
fix references to staking hooks
kyscott18 Feb 22, 2022
9636709
add new redux for just pools
kyscott18 Feb 22, 2022
53610a7
mobius pool updater
kyscott18 Feb 22, 2022
0b47a7d
partly refactored swap
kyscott18 Feb 22, 2022
f6fe0eb
change swap hooks
kyscott18 Feb 22, 2022
44ea8ea
remove deprecated hooks from
kyscott18 Feb 22, 2022
484c3b4
fix all calculator errors
kyscott18 Feb 24, 2022
8affecb
still issues with pulling data
kyscott18 Feb 24, 2022
d32c08f
big int fix
kyscott18 Feb 24, 2022
6df938f
merge conflicts
kyscott18 Feb 24, 2022
ab12878
swap math doesn't error but incorrect values
kyscott18 Feb 24, 2022
a74b6e1
change hooks to use stablePools
kyscott18 Feb 24, 2022
9544c25
remove duplicate mobi from constants
kyscott18 Feb 24, 2022
1ad09e8
move tokensTradeable to Token hooks
kyscott18 Feb 24, 2022
9db5449
added token
kyscott18 Feb 24, 2022
680da8e
move ust
kyscott18 Feb 24, 2022
113859e
add mobi rate to staking
kyscott18 Feb 25, 2022
73b2662
gauge reducer
kyscott18 Feb 26, 2022
af9dca4
gauge reducer working
kyscott18 Feb 27, 2022
e196748
gauge update bug fix:
kyscott18 Feb 27, 2022
3a890e3
remove mint and burn reducer
kyscott18 Feb 27, 2022
c8d595f
clear input amount on switch currencies
kyscott18 Feb 27, 2022
f2ec1ca
only look for proposals from genesis block
kyscott18 Feb 27, 2022
7bf34da
new staking hooks
kyscott18 Feb 27, 2022
2bbe096
stats header
kyscott18 Feb 27, 2022
544de77
stake page
kyscott18 Feb 27, 2022
04f0966
gauge hooks 1
kyscott18 Feb 27, 2022
18008e1
add single gauge hooks
kyscott18 Feb 27, 2022
20026c2
upgrade gauge reducer
kyscott18 Feb 27, 2022
a234b7e
staking lock
kyscott18 Feb 27, 2022
69d8829
stake vote page
kyscott18 Feb 27, 2022
8734d1b
stake positions
kyscott18 Feb 27, 2022
30aa65f
calc boosts
kyscott18 Feb 27, 2022
16944b2
price refactor
kyscott18 Feb 27, 2022
95ec869
fixed token price reducer
kyscott18 Feb 27, 2022
b7ce977
use mobi price hook
kyscott18 Feb 27, 2022
6976b98
mobi token utils
kyscott18 Feb 27, 2022
cdd9d44
calculator
kyscott18 Feb 27, 2022
210a01b
.
kyscott18 Feb 28, 2022
ca93058
cleanup
kyscott18 Feb 28, 2022
6265d32
more cleanup
kyscott18 Feb 28, 2022
9d229e6
more cleanups
kyscott18 Feb 28, 2022
dea09c6
remove files
kyscott18 Feb 28, 2022
45e234c
claim cleanup
kyscott18 Feb 28, 2022
2c97d7c
will this ever build
kyscott18 Feb 28, 2022
5828a1a
stable pool card
kyscott18 Feb 28, 2022
10efe8c
deposit modal
kyscott18 Mar 1, 2022
d4025ce
withdraw modal
kyscott18 Mar 1, 2022
bc1d8bf
added tokens
kyscott18 Mar 1, 2022
4c5e03c
builds
kyscott18 Mar 1, 2022
e36ed3c
pools build
kyscott18 Mar 1, 2022
44f4133
update eslint
kyscott18 Mar 1, 2022
2f30ad3
multicall fix
kyscott18 Mar 1, 2022
bab09ae
bug fixes
kyscott18 Mar 1, 2022
66edff0
fix apy:
kyscott18 Mar 1, 2022
7282b83
deposit and withdraw
kyscott18 Mar 1, 2022
c0f04f9
price fix
kyscott18 Mar 1, 2022
ff870af
bug fix
kyscott18 Mar 1, 2022
3d514ca
charts still broken
kyscott18 Mar 2, 2022
a3ad7dc
manage page
kyscott18 Mar 3, 2022
bd349b7
staking modal
kyscott18 Mar 3, 2022
4e06f27
claim mobi modal
kyscott18 Mar 7, 2022
60e3246
fix on max speed
kyscott18 Mar 7, 2022
30d37f1
claim rewards modal
kyscott18 Mar 7, 2022
dca67b5
.
kyscott18 Mar 7, 2022
dd9826f
add some pools
kyscott18 Mar 7, 2022
9b89f0b
add hooks to pool page
kyscott18 Mar 8, 2022
baa9a99
bug fix
kyscott18 Mar 8, 2022
25027d0
cleanup and backup subgraph
kyscott18 Mar 10, 2022
1329247
merge
kyscott18 Mar 16, 2022
3b4c1a5
price impact fix
kyscott18 Mar 16, 2022
1ab0ebe
mento updater cleanup
kyscott18 Mar 16, 2022
f9d2435
.
kyscott18 Mar 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .envrc

This file was deleted.

2 changes: 0 additions & 2 deletions Deploys.csv

This file was deleted.

4 changes: 0 additions & 4 deletions SNX_Addresses.txt

This file was deleted.

91 changes: 0 additions & 91 deletions TestPoolInfo.txt

This file was deleted.

3 changes: 0 additions & 3 deletions craco.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

const now = Math.floor(new Date().getTime() / 1000)

module.exports = {
webpack: {
plugins: {
Expand Down
15 changes: 0 additions & 15 deletions flake.nix

This file was deleted.

2 changes: 0 additions & 2 deletions netlify.toml

This file was deleted.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
"@reach/portal": "^0.15.0",
"@reduxjs/toolkit": "^1.5.1",
"@typechain/ethers-v5": "^7.0.1",
"@types/jest": "^26.0.23",
"@types/ledgerhq__hw-transport-webusb": "^4.70.1",
"@types/lodash": "^4.14.170",
"@types/luxon": "^2.0.7",
"@types/multicodec": "^2.1.0",
"@types/node": "^14.14.37",
"@types/react": "^17.0.11",
Expand Down Expand Up @@ -125,13 +123,19 @@
"@ethersproject/strings": "^5.3.0",
"@ethersproject/units": "^5.3.0",
"@sentry/react": "^6.9.0",
"@types/jest": "^27.4.1",
"@types/lodash.mapvalues": "^4.6.6",
"@types/luxon": "^2.0.9",
"@types/react-date-range": "^1.1.8",
"@types/react-vis": "^1.11.7",
"@ubeswap/sdk": "^2.1.0",
"@ubeswap/token-math": "^4.4.4",
"axios": "^0.21.4",
"bignumber.js": "^9.0.1",
"graphql": "^15.7.1",
"jsbi": "^4.1.0",
"lodash": "^4.17.21",
"lodash.mapvalues": "^4.6.0",
"randombytes": "^2.1.0",
"react-circular-progressbar": "^2.0.4",
"react-countdown": "^2.3.2",
Expand Down
7 changes: 0 additions & 7 deletions shell.nix

This file was deleted.

40 changes: 13 additions & 27 deletions src/components/CurrencyInputPanel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Pair, Token } from '@ubeswap/sdk'
import { useColor } from 'hooks/useColor'
import { Token, TokenAmount } from 'lib/token-utils'
import { darken } from 'polished'
import React, { useCallback, useState } from 'react'
import { useTranslation } from 'react-i18next'
Expand All @@ -12,7 +12,6 @@ import { useIsDarkMode } from '../../state/user/hooks'
import { useTokenBalance } from '../../state/wallet/hooks'
import { TYPE } from '../../theme'
import CurrencyLogo from '../CurrencyLogo'
import DoubleCurrencyLogo from '../DoubleLogo'
import { Input as NumericalInput } from '../NumericalInput'
import { RowBetween } from '../Row'
import CurrencySearchModal from '../SearchModal/CurrencySearchModal'
Expand Down Expand Up @@ -47,7 +46,6 @@ const CurrencySelect = styled.button<{
walletConnected: boolean
bgColor: any
isDarkMode: boolean
pair: boolean
}>`
display: flex;
align-items: center;
Expand All @@ -64,7 +62,7 @@ const CurrencySelect = styled.button<{
cursor: pointer;
user-select: none;
border: none;
width: ${({ pair }) => (pair ? '14rem' : '10rem')};
width: 10rem;
height: 2.4rem;
padding: 0 8px;

Expand Down Expand Up @@ -139,14 +137,13 @@ export enum TokenType {
interface CurrencyInputPanelProps {
value: string
onUserInput: (value: string) => void
onMax?: () => void
onMax?: (max?: TokenAmount) => void
showMaxButton: boolean
label?: string
onCurrencySelect?: (currency: Token) => void
currency?: Token | null
disableCurrencySelect?: boolean
hideBalance?: boolean
pair?: Pair | null
hideInput?: boolean
disableInput?: boolean
otherCurrency?: Token | null
Expand All @@ -165,7 +162,6 @@ export default function CurrencyInputPanel({
disableCurrencySelect = false,
hideBalance = false,
disableInput = false,
pair = null, // used for double token logo
hideInput = false,
otherCurrency,
id,
Expand Down Expand Up @@ -197,7 +193,7 @@ export default function CurrencyInputPanel({
</TYPE.body>
{connected && (
<TYPE.body
onClick={onMax}
onClick={() => (onMax ? onMax(selectedCurrencyBalance) : null)}
color={theme.text2}
fontWeight={500}
fontSize={14}
Expand All @@ -217,7 +213,6 @@ export default function CurrencyInputPanel({
bgColor={tokenSelectBackground}
selected={!!currency}
walletConnected={connected}
pair={!!pair}
className="open-currency-select-button"
onClick={() => {
if (!disableCurrencySelect) {
Expand All @@ -226,24 +221,15 @@ export default function CurrencyInputPanel({
}}
>
<Aligner>
{pair ? (
<DoubleCurrencyLogo currency0={pair.token0} currency1={pair.token1} size={24} margin={true} />
) : currency ? (
<CurrencyLogo currency={currency} size={'24px'} />
) : null}
{pair ? (
<StyledTokenName active={!!currency} className="pair-name-container">
{pair?.token0.symbol}:{pair?.token1.symbol}
</StyledTokenName>
) : (
<StyledTokenName className="token-symbol-container" active={Boolean(currency && currency.symbol)}>
{(currency && currency.symbol && currency.symbol.length > 20
? currency.symbol.slice(0, 4) +
'...' +
currency.symbol.slice(currency.symbol.length - 5, currency.symbol.length)
: currency?.symbol) || t('Select Token')}
</StyledTokenName>
)}
{currency ? <CurrencyLogo currency={currency} size={'24px'} /> : null}
<StyledTokenName className="token-symbol-container" active={Boolean(currency && currency.symbol)}>
{(currency && currency.symbol && currency.symbol.length > 20
? currency.symbol.slice(0, 4) +
'...' +
currency.symbol.slice(currency.symbol.length - 5, currency.symbol.length)
: currency?.symbol) || t('Select Token')}
</StyledTokenName>

{!disableCurrencySelect && <StyledDropDown selected={!!currency} />}
</Aligner>
</CurrencySelect>
Expand Down
13 changes: 4 additions & 9 deletions src/components/CurrencyLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Token } from '@ubeswap/sdk'
import { Token } from 'lib/token-utils'
import React, { useMemo } from 'react'
import styled from 'styled-components'

import useHttpLocations from '../../hooks/useHttpLocations'
import { WrappedTokenInfo } from '../../state/lists/hooks'
import Logo from '../Logo'

const StyledLogo = styled(Logo)<{ size: string }>`
Expand All @@ -23,15 +22,11 @@ export default function CurrencyLogo({
size?: string
style?: React.CSSProperties
}) {
const uriLocations = useHttpLocations(currency instanceof WrappedTokenInfo ? currency.logoURI : undefined)
const uriLocations = useHttpLocations(currency?.icon ?? undefined)

const srcs: string[] = useMemo(() => {
if (currency instanceof Token) {
if (currency instanceof WrappedTokenInfo) {
return [...uriLocations, currency.logoURI ?? currency.address]
}

return []
if (currency) {
return [...uriLocations, currency.icon ?? currency.address]
}
return []
}, [currency, uriLocations])
Expand Down
2 changes: 1 addition & 1 deletion src/components/CurrencyPoolLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Token } from '@ubeswap/sdk'
import { Token } from 'lib/token-utils'
import React from 'react'
import styled from 'styled-components'

Expand Down
2 changes: 1 addition & 1 deletion src/components/DoubleLogo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Token } from '@ubeswap/sdk'
import { Token } from 'lib/token-utils'
import React from 'react'
import styled from 'styled-components'

Expand Down
3 changes: 2 additions & 1 deletion src/components/FormattedCurrencyAmount/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Fraction, JSBI, TokenAmount } from '@ubeswap/sdk'
import JSBI from 'jsbi'
import { Fraction, TokenAmount } from 'lib/token-utils'
import React from 'react'

const CURRENCY_AMOUNT_MIN = new Fraction(JSBI.BigInt(1), JSBI.BigInt(1000000))
Expand Down
8 changes: 4 additions & 4 deletions src/components/Header/URLWarning.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChainId } from '@ubeswap/sdk'
import { ChainId } from 'lib/token-utils'
import React from 'react'
import { isMobile } from 'react-device-detect'
import { AlertTriangle, X } from 'react-feather'
Expand All @@ -25,9 +25,9 @@ export const StyledClose = styled(X)`
`

const appURL: { [id in ChainId]: string } = {
[ChainId.MAINNET]: 'mobius.money',
[ChainId.ALFAJORES]: 'app-alfajores.mobius.money',
[ChainId.BAKLAVA]: 'app-baklava.mobius.money',
[ChainId.Mainnet]: 'mobius.money',
[ChainId.Alfajores]: 'app-alfajores.mobius.money',
[ChainId.Baklava]: 'app-baklava.mobius.money',
}

export default function URLWarning() {
Expand Down
6 changes: 2 additions & 4 deletions src/components/Header/UbeBalanceContent.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import Loader from 'components/Loader'
import QuestionHelper from 'components/QuestionHelper'
import { useMobi } from 'hooks/Tokens'
import React from 'react'
import { X } from 'react-feather'
import { useMobiPrice } from 'state/application/hooks'
import styled from 'styled-components'
import { useCUSDPrice } from 'utils/useCUSDPrice'

import tokenLogo from '../../assets/images/MOBI-200.png'
import { CHAIN, MOBI } from '../../constants'
Expand Down Expand Up @@ -44,8 +43,7 @@ export default function UbeBalanceContent({ setShowUbeBalanceModal }: { setShowU
const ube = MOBI[CHAIN]

const total = useAggregateUbeBalance()
const mobi = useMobi()
const mobiprice = useCUSDPrice(mobi)
const mobiprice = useMobiPrice()
const ret = useCirculatingSupply()

return (
Expand Down
3 changes: 2 additions & 1 deletion src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CELO, TokenAmount } from '@ubeswap/sdk'
import { CardNoise } from 'components/earn/styled'
import Modal from 'components/Modal'
import usePrevious from 'hooks/usePrevious'
import { TokenAmount } from 'lib/token-utils'
import { darken } from 'polished'
import React, { useState } from 'react'
import { isMobile } from 'react-device-detect'
Expand All @@ -17,6 +17,7 @@ import { CountUp } from 'use-count-up'

import Logo from '../../assets/svg/mobius.svg'
import { CHAIN } from '../../constants'
import { CELO } from '../../constants/tokens'
import { useWeb3Context } from '../../hooks'
import useTheme from '../../hooks/useTheme'
import { useDarkModeManager } from '../../state/user/hooks'
Expand Down
Loading