Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: disable swap minting #1740

Merged
merged 27 commits into from
Jan 23, 2025
Merged
Changes from 25 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
868bbd4
remove bed and ic21 from swap
janndriessen Jan 17, 2025
45691cd
remove obsolete quote util
janndriessen Jan 17, 2025
fa24720
remove ic21 refs
janndriessen Jan 17, 2025
b789252
remove test
janndriessen Jan 17, 2025
05c8874
use gtceth from tokenlists
janndriessen Jan 18, 2025
f3e304d
remove test
janndriessen Jan 18, 2025
d9d2c9d
pass token decimals only
janndriessen Jan 19, 2025
f917f86
update path resolver to be redeeming by default
janndriessen Jan 20, 2025
a3987ba
toggle minting only for index
janndriessen Jan 20, 2025
b9c67d3
lint
janndriessen Jan 20, 2025
310c0cd
Merge branch 'master' into task/disable-swap-minting
janndriessen Jan 21, 2025
3db7e4d
add legacy token type
janndriessen Jan 21, 2025
94cc34d
dseth and hyeth need to remain mintable too
janndriessen Jan 21, 2025
c34914e
add legacy path to bed on products page
janndriessen Jan 21, 2025
0b784f3
remove buy
janndriessen Jan 21, 2025
908c41c
make index default
janndriessen Jan 21, 2025
cafe0c4
update protection logic
janndriessen Jan 21, 2025
066364a
fix tests
janndriessen Jan 21, 2025
ec31d32
fix requires protection
janndriessen Jan 21, 2025
e89d2a2
remove obsolete test
janndriessen Jan 21, 2025
a1fd1c7
remove obsolete test
janndriessen Jan 21, 2025
7e75849
update tokenlists
janndriessen Jan 21, 2025
f105d98
update flash mint sdk
janndriessen Jan 21, 2025
e20d268
add missing debt issuance contract addresses
janndriessen Jan 21, 2025
dee2867
readd check
janndriessen Jan 21, 2025
2b2a225
revert back to previous return
janndriessen Jan 21, 2025
d05b578
refactor: token (#1743)
janndriessen Jan 22, 2025
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
44 changes: 22 additions & 22 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -28,8 +28,8 @@
"@headlessui/react": "2.1.6",
"@heroicons/react": "^2.1.3",
"@indexcoop/analytics-sdk": "0.28.0",
"@indexcoop/flash-mint-sdk": "3.18.0",
"@indexcoop/tokenlists": "3.5.0",
"@indexcoop/flash-mint-sdk": "3.21.0",
"@indexcoop/tokenlists": "3.10.0",
"@rainbow-me/rainbowkit": "^2.0.7",
"@safe-global/api-kit": "2.5.4",
"@safe-global/protocol-kit": "4.0.4",
1 change: 0 additions & 1 deletion public/assets/gtceth_logo.svg

This file was deleted.

65 changes: 0 additions & 65 deletions public/assets/ic21_logo.svg

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import Image from 'next/image'

import { LegacyToken } from '@/app/legacy/types'
import { StyledSkeleton } from '@/components/skeleton'
import { Caption } from '@/components/swap/components/caption'
import { Token } from '@/constants/tokens'

type ReceiveProps = {
isLoading: boolean
outputAmounts: string[]
outputAmountsUsd: string[]
ouputTokens: Token[]
ouputTokens: LegacyToken[]
totalOutputAmountUsd: string
onSelectToken: () => void
}
19 changes: 12 additions & 7 deletions src/app/legacy/config.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import {
DebtIssuanceModuleAddress,
DebtIssuanceModuleV2Address,
DebtIssuanceModuleV2PolygonAddress,
IndexDebtIssuanceModuleV2Address,
IndexDebtIssuanceModuleV2Address_v2,
} from '@indexcoop/flash-mint-sdk'
import { getTokenByChainAndSymbol } from '@indexcoop/tokenlists'

import { LegacyToken } from '@/app/legacy/types'
import {
BedIndex,
Bitcoin2xFlexibleLeverageIndex,
DATA,
Ethereum2xFlexibleLeverageIndex,
GitcoinStakedETHIndex,
GmiIndex,
ic21,
LeveragedRethStakingYield,
} from '@/constants/tokens'

@@ -26,6 +24,13 @@ import {
Matic2xFlexibleLeverageIndexPolygon,
} from './polygon'

const DebtIssuanceModuleAddress = '0x39F024d621367C044BacE2bf0Fb15Fb3612eCB92'
const DebtIssuanceModuleV2PolygonAddress =
'0xf2dC2f456b98Af9A6bEEa072AF152a7b0EaA40C9'
Comment on lines +30 to +32
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curious- why define these here as opposed to flash mint sdk? if we need to define them in this codebase, thoughts on putting them in some sort of config?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are removed in the SDK as we actually don't really use them any longer - expect for deprecated products. So I would say here it's fine? and then we can completely remove once those products are removed from legacy?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good to me , thanks for the context 👍


const GitcoinStakedETHIndex = getTokenByChainAndSymbol(1, 'gtcETH')
const ic21 = getTokenByChainAndSymbol(1, 'ic21')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding directly from tokenlists. Removing lots of obsolete references/assets throughout the app.


export const Issuance = {
[BedIndex.symbol]: IndexDebtIssuanceModuleV2Address_v2,
[Bitcoin2xFlexibleLeverageIndex.symbol]: DebtIssuanceModuleV2Address,
@@ -49,11 +54,11 @@ export const Issuance = {
DebtIssuanceModuleV2PolygonAddress,
}

export const LegacyTokenList = [
export const LegacyTokenList: LegacyToken[] = [
Bitcoin2xFlexibleLeverageIndex,
Ethereum2xFlexibleLeverageIndex,
ic21,
GitcoinStakedETHIndex,
{ ...ic21, image: ic21.logoURI },
{ ...GitcoinStakedETHIndex, image: GitcoinStakedETHIndex.logoURI },
GmiIndex,
DATA,
LeveragedRethStakingYield,
4 changes: 2 additions & 2 deletions src/app/legacy/providers/redeem-provider.tsx
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ import {
LegacyTokenList,
PolygonLegacyTokenList,
} from '@/app/legacy/config'
import { LegacyRedemptionQuoteResult } from '@/app/legacy/types'
import { LegacyRedemptionQuoteResult, LegacyToken } from '@/app/legacy/types'
import { POLYGON } from '@/constants/chains'
import { LeveragedRethStakingYield, Token } from '@/constants/tokens'
import { QuoteType } from '@/lib/hooks/use-best-quote/types'
@@ -23,7 +23,7 @@ import { useWallet } from '@/lib/hooks/use-wallet'
import { isValidTokenInput, parseUnits } from '@/lib/utils'

interface RedeemContextProps {
inputTokenList: Token[]
inputTokenList: LegacyToken[]
inputValue: string
isDepositing: boolean
isFetchingQuote: boolean
Loading